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

Cordapp Plugin - Usage of deprecated compile configuration #404

Open
raynay-r opened this issue Apr 1, 2021 · 2 comments
Open

Cordapp Plugin - Usage of deprecated compile configuration #404

raynay-r opened this issue Apr 1, 2021 · 2 comments

Comments

@raynay-r
Copy link

raynay-r commented Apr 1, 2021

The Cordapp plugin seems to only include dependencies declared with the compile configuration in the fat jar. Since the compile configuration is deprecated and should be replaced with either implementation or api, the plugin should imho also support including these dependencies. More information on that topic can be found here.

I think the problem is in CordappPlugin.kt#L182. Here the deprecated constant RUNTIME_CONFIGURATION_NAME is used. According to the documentation this constant should be replaced with RUNTIME_ELEMENTS_CONFIGURATION_NAME.

I tested the behavior with the following two tasks:

tasks.register("listd1") {
    doLast {
        println("List RUNTIME_ELEMENTS")
        val runtimeConfiguration = project.configurations.single {it.name == RUNTIME_ELEMENTS_CONFIGURATION_NAME}
        runtimeConfiguration.allDependencies.map { println(it) }
        println("Finished RUNTIME_ELEMENTS")
    }
}

tasks.register("listd2") {
    doLast {
        println("List RUNTIME")
        val runtimeConfiguration = project.configurations.single {it.name == RUNTIME_CONFIGURATION_NAME}
        runtimeConfiguration.allDependencies.map { println(it) }
        println("Finished RUNTIME")
    }
}

From my point of view RUNTIME_ELEMENTS_CONFIGURATION_NAME provides the correct behavior. If you are interested in making the change I could provide a pull request.

@chrisr3
Copy link
Contributor

chrisr3 commented Apr 1, 2021

Thank you for your report. These plugins all use Gradle's deprecated compile and runtime configurations internally, but we cannot trivially change to using their modern replacements without also affecting how the plugins behave in everyone's build.gradle files. For example, the cordapp plugin would then also include any implementation or api dependencies inside the CorDapp "semi-fat" jar, and this isn't something that we can hide behind a minor version change.

@raynay-r
Copy link
Author

raynay-r commented Apr 2, 2021

Are you considering updating the behavior and making a new major release? Because in my case it makes difficult to use the plugin in a new project. I use the buildSrc folder to declare dependencies for multiple modules and the plugin forces me to either declare the dependencies twice or declare them as compile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants