Open conor10 opened 5 years ago
Is there a workaround for this?
This code snippet workarounds this issue:
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
dependsOn 'generateContractWrappers'
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
dependsOn 'generateTestContractWrappers'
}
sourceSets {
main.kotlin.srcDirs += "${web3j.generatedFilesBaseDir}/main/java"
test.kotlin.srcDirs += "${web3j.generatedFilesBaseDir}/test/java"
}
When using the plugin in a Kotlin project, the
compileKotlin
task comes beforecompileSolidity
andgenerateContractWrappers
. This means that if you have Kotlin code trying to use the generated contracts in the same module as where they are created they will not be found.There was a similar issue with the protobuf plugin https://github.com/google/protobuf-gradle-plugin/issues/100.