Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task compileKotlin is coming before compileSolidity #24

Open
conor10 opened this issue Apr 1, 2019 · 3 comments
Open

Task compileKotlin is coming before compileSolidity #24

conor10 opened this issue Apr 1, 2019 · 3 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@conor10
Copy link
Contributor

conor10 commented Apr 1, 2019

When using the plugin in a Kotlin project, the compileKotlin task comes before compileSolidity and generateContractWrappers. 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 google/protobuf-gradle-plugin#100.

@conor10 conor10 added bug Something isn't working enhancement New feature or request and removed bug Something isn't working labels Apr 1, 2019
@iikirilov
Copy link
Contributor

Is there a workaround for this?

@iikirilov
Copy link
Contributor

@xaviarias
Copy link
Contributor

xaviarias commented Apr 18, 2019

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"
    }

@xaviarias xaviarias added the bug Something isn't working label Apr 18, 2019
@xaviarias xaviarias self-assigned this Aug 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants