-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Make configuration inheritance consistent with Gradle #165
Make configuration inheritance consistent with Gradle #165
Conversation
Old behavior: * `integrationCompileClasspath` extends from testCompileClasspath * `integrationRuntimeOnly extends from `testRuntimeClasspath` New behavior: * `integrationImplementation` extends from testImplementation * `integrationRuntimeOnly extends from `testRuntimeOnly` This is more consistent with what Gradle does with test -> main inheritance and what it recommends in its documentation, resulting in less confusion when extending integration configurations
LGTM! Thanks @rafalh! |
@rafalh thanks for the thorough analysis with all the links! Really appreciated. I left few small nitpicks in the review. Thanks for it as well.
I believe we should extend it as well, but it can be done in a separate PR. It would be more aligned with the P.S. @bgalek I feel summoned by you 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR and the thorough analysis!
src/integration/kotlin/com/coditory/gradle/integration/ConfigurationInheritanceTest.kt
Outdated
Show resolved
Hide resolved
src/integration/kotlin/com/coditory/gradle/integration/ConfigurationInheritanceTest.kt
Outdated
Show resolved
Hide resolved
Thanks for merging! Is there any ETA for next release? @pmendelski |
@rafalh It's released under |
Changes
In my project I have a custom test suite that is supposed to inherit dependencies from the integration test classpath.
It is achieved by extending configurations used by the new suite from ones used by integration tests:
It used to work in version 1.x of this plugin but doesn't work anymore in 2.x.
After improvements in #144 I could achieve what I need extending from
integrationCompileClasspath
configuration (which extends directly fromtestCompileClasspath
and indirectly fromtestImplementation
andtestCompileOnly
). My code currently fails becauseintegrationImplementation
does not depend ontestImplementation
.Why I think current approach may be not optimal:
testImplementation
configuration in example setup for integration tests:implementation
andruntimeOnly
configs (from main source-set) and notcompileClasspath
implementation
config in multiple samples, e.g. hereNot sure if
compileOnly
andannotationProcessor
configurations should be extended. Gradle does do it in itstest
source-set or integration tests example, which IMHO makes some sense (those dependencies should only be needed to compile the source-set, not to use it). I left it as is to avoid potential breaking changes.Old behavior:
integrationCompileClasspath
extends fromtestCompileClasspath
integrationRuntimeOnly extends from
testRuntimeClasspath`New behavior:
integrationImplementation
extends fromtestImplementation
integrationRuntimeOnly extends from
testRuntimeOnly`I think new behavior is more consistent with Gradle recommendations, which should cause less confusion when extending integration test configurations. At the same time I think this change should not break existing setups, because
integrationCompileClasspath
already extendsintegrationImplementation
andintegrationCompileOnly
. Runtime classpath should also not be affected because it's implementation+runtimeOnly.Checklist