hyperledger-web3j / web3j-solidity-gradle-plugin

Gradle plugin providing tasks to compile Solidity contracts.
Apache License 2.0
21 stars 25 forks source link

compileSolidity tasks fails when executable set to local path #23

Closed magooster closed 4 years ago

magooster commented 4 years ago

With version 0.2.0 or above of the plugin, if I set the executable the task throws the following error.

plugins {
    id 'java'
    id 'org.web3j' version '4.5.11'
    id 'org.web3j.solidity' version '0.2.0'
}

solidity {
    executable = '/usr/local/bin/solc'
}
> Task :compileSolidity FAILED

Execution failed for task ':compileSolidity'.
> Cannot invoke method split() on null object
magooster commented 4 years ago

If I set the version in the plugin configuration then the task runs ok, and uses the installed solc.

solidity {
    executable = '/usr/local/bin/solc'
    version = '0.6.8'
}

version doesn't actually have to match the version of the installed solc can set to any valid version string.

xaviarias commented 4 years ago

The version property disables certain Solidity compiler options. The one you specified must have disabled the option causing the error.

This is the normal expected behavior for now, but with the Sokt integration in the next release that will be fixed and any Solidity version available.