Closed zepurplez closed 12 hours ago
There is another way to specify a dependency with classifier or artifactType
dependencies {
api(variantOf(libs.jodaTime) { classifier("no-tzdb") })
}
In this case, running ./gradlew :lib:fixDependencies
won't give any advice to adding the dependency to the testFixtures configuration and print the next message:
> Task :lib:fixDependencies
Fixing dependencies for /Users/r.zaremba/Developer/sample-proj/lib/build.gradle.kts.
line 8:18 extraneous input 'libs.jodaTime' expecting ')'
line 9:1 extraneous input '<EOF>' expecting {'}', ID}
Can't fix dependencies for ':lib': 1: extraneous input 'libs.jodaTime' expecting ')'; 8:18, 2: extraneous input '<EOF>' expecting {'}', ID}; 9:1
Thanks for the report! Can you please try again with v2.5.0? it was just released yesterday, and it has improved support for parsing and rewriting .gradle.kts files.
In version 2.5.0 it works as expected in both cases. Thank you!
Great, thanks for confirming! I'll close this issue then.
Plugin version 2.4.2
Gradle version 8.11
JDK version 17
(Optional) Kotlin and Kotlin Gradle Plugin (KGP) version 1.9.24
Describe the bug There is a kotlin project with java-test-fixture plugin.
src/main
has only one class with arguments from library(jodatime for example) and stub implementation insrc/testFixtures
.build.gradle.kts
src/main
src/testFixtures
So when you try to run a command
./gradlew :lib:fixDependencies
it will add new dependency totestFixturesApi
configuration and it will be looks like this:Expected behavior