From 1a9e66915b415cb1ca2bc2680f8fb4ff1883787c Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Wed, 15 Jun 2016 00:36:31 +0200 Subject: common/compiler: simplify solc wrapper Support for legacy version 0.9.x is gone. The compiler version is no longer cached. Compilation results (and the version) are read directly from stdout using the --combined-json flag. As a workaround for ethereum/solidity#651, source code is written to a temporary file before compilation. Integration of solc in package ethapi and cmd/abigen is now much simpler because the compiler wrapper is no longer passed around as a pointer. Fixes #2806, accidentally --- cmd/abigen/main.go | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'cmd/abigen/main.go') diff --git a/cmd/abigen/main.go b/cmd/abigen/main.go index f36391351..9c9ab6d31 100644 --- a/cmd/abigen/main.go +++ b/cmd/abigen/main.go @@ -68,18 +68,7 @@ func main() { for _, kind := range strings.Split(*excFlag, ",") { exclude[strings.ToLower(kind)] = true } - // Build the Solidity source into bindable components - solc, err := compiler.New(*solcFlag) - if err != nil { - fmt.Printf("Failed to locate Solidity compiler: %v\n", err) - os.Exit(-1) - } - source, err := ioutil.ReadFile(*solFlag) - if err != nil { - fmt.Printf("Failed to read Soldity source code: %v\n", err) - os.Exit(-1) - } - contracts, err := solc.Compile(string(source)) + contracts, err := compiler.CompileSolidity(*solcFlag, *solFlag) if err != nil { fmt.Printf("Failed to build Solidity contract: %v\n", err) os.Exit(-1) -- cgit v1.2.3