Skip to content

Commit

Permalink
feat: added option to attach to build
Browse files Browse the repository at this point in the history
  • Loading branch information
Aldo Borrero committed May 1, 2020
1 parent c179195 commit fc32f87
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Once the plugin is applied, you can configure it with the following options (def

```groovy
solidity {
attachToBuild.set(true)
command.set("docker run --rm")
solidityImage.set("ethereum/solc:stable")
evmVersion.set(EVMVersion.ISTANBUL)
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ apply(plugin = "io.spring.dependency-management")
apply(from = "${project.rootDir}/gradle/versions.gradle")

group = "dev.north.fortyone.gradle"
version = "0.1.0"
version = "0.1.1"

repositories {
mavenLocal()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ open class SolidityExtension internal constructor(
objectFactory: ObjectFactory
) {

/**
* Attaches to build task to be executed automatically whenever build task is called.
*/
val attachToBuild: Property<Boolean> = objectFactory.property { set(true) }

/**
* The executable command to use.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ open class SolidityPlugin @Inject constructor(
}

// Make buildSolidity task dependant of generic build
project.tasks.getByName("build").dependsOn(compileTask)
if (extension.attachToBuild.get()) {
project.tasks.getByName("build").dependsOn(compileTask)
}
}
}

0 comments on commit fc32f87

Please sign in to comment.