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
7.6 RC3: DependencyAdder.invoke cannot be called with the arguments supplied #22720
Comments
Hi Ian, this is an expected change to the Take a look at the Introduced strongly-typed dependencies block for JVM test suites section in the release notes and the updated example in the JVM Test Suite Plugin page of the user guide. In short, you need to switch from referencing the current project via The methods used to add dependencies to Test Suites differ from those used in the top-level block. In Gradle 7.6, Test Suites make use of a new type DependencyAdder, which accepts a This is a subtle change, and definitely a possible stumbling block. Thanks for pointing it out! We'll add a note to the upgrade guide. |
…ncies in Test Suites <!--- The issue this PR addresses --> Fixes #22720 Co-authored-by: Thomas Tresansky <ttresansky@gradle.com>
Thanks @tresat, I was able to upgrade to 7.6 RC3 successfully using |
For people discovering this issue with versions catalog items, you need to change the declarations this way testing {
suites {
val test by getting(JvmTestSuite::class) {
useJUnitJupiter(libs.versions.junit.jupiter.get())
dependencies {
- implementation(libs.assertj)
+ implementation.add(libs.assertj)
- implementation(libs.bundles.batik)
+ implementation.bundle(libs.bundles.batik)
}
} To find the relevant method, inspect As this isn't clearly explained in neither the release note nor the differences doc. There's only a mention of the bundle lost in a long list. I believe some examples would have been better in this case. |
@bric3 - Finally got around to updating the docs here: #28828. Thank you for pointing this out! |
Expected Behavior
Precompiled script plugins configuring a project dependency for an additional test suite via the JVM Test Site Plugin continue to compile after upgrading to Gradle 7.6 RC3.
Current Behavior
The script fails to compile:
Context
I'm unable to upgrade to Gradle 7.6.
Steps to Reproduce
Reproducer: https://github.com/sdkotlin/sd-kotlin-talks/tree/a54afe81013c1806550ff23478efe48973033deb
Line in error: https://github.com/sdkotlin/sd-kotlin-talks/blob/a54afe81013c1806550ff23478efe48973033deb/build-logic/src/main/kotlin/org.sdkotlin.build.test.integration-test-suite.gradle.kts#L20
Your Environment
Gradle 7.6-rc3
Kotlin 1.7.21
Java 11.0.17
The text was updated successfully, but these errors were encountered: