-
Notifications
You must be signed in to change notification settings - Fork 50
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
Plugin application fails on Gradle 8.0 #131
Comments
I switched to JVM Test Suite (as suggested in #132) and ended up with: testing {
suites {
test {
useJUnitJupiter()
}
integTest(JvmTestSuite) {
sources.java.srcDirs = ['src/integtest/java']
sources.resources.srcDirs = ['src/integtest/resources']
dependencies {
implementation project()
implementation sourceSets.test.output
}
targets {
all {
testTask.configure {
shouldRunAfter(test)
}
}
}
}
}
}
configurations {
integTestImplementation.extendsFrom testImplementation
}
tasks.named('check') {
dependsOn(testing.suites.integTest)
}
tasks.named("sourcesJar") {
dependsOn("compileJava")
dependsOn("compileTestJava")
dependsOn("compileIntegTestJava")
}
tasks.named("javadoc") {
dependsOn("compileJava")
dependsOn("compileTestJava")
dependsOn("compileIntegTestJava")
} |
The fix is to replace classifier with archiveClassifier, at least according to https://discuss.gradle.org/t/publishing-jars-with-classifiers-after-v5-0/30144 |
Here's the bug: gradle-testsets-plugin/src/main/kotlin/org/unbrokendome/gradle/plugins/testsets/TestSetsPlugin.kt Lines 130 to 133 in 1c6fc3f
|
So either gradle-testsets-plugin can't ever be used with Gradle 8.x or newer, or has to be non-backward-compatible with Gradle earlier than 5.1. It's not possible to have it both ways (unless the repo is forked). |
@tomasbjerre thanks for your example code, the JVM Test Suite seems indeed a more future-proof solution for what we so far have set up using the test sets plugin. However, I'd avoid setting these: // Breaks conventions :(
sources.java.srcDirs = ['src/integtest/java']
sources.resources.srcDirs = ['src/integtest/resources'] If you just remove those lines and let them get derived from convention, then you end up with the folder |
This bug can probably be fixed via reflection. First use reflection try to get the task.archiveClassifier declared field. If present, use reflection to set the field. If not present, use reflection to get the task.classifier field, make it accessible, and set it. |
The very excellent unbroken-dome testsets plugin did the Gradle build configuration for us. With Gradle 8, it has stopped working, and held back this project from upgrading Gradle. References: - #358 - unbroken-dome/gradle-testsets-plugin#131 - https://docs.gradle.org/current/userguide/java_testing.html#sec:configuring_java_integration_tests
This bug is also a problem for me...I need to use gradle 8 (actually 8.1.1), |
@dhakehurst, the JVM Test Suite feature can pretty much replace what this plugin does, see conversation above. |
It looks like Gradle's built-in solution can still hurt us if we want back the following behavior configured for all subprojects without code duplication:
In detail, see gradle/gradle#19870 (comment) . |
This fails since
AbstractArchiveTask#setClassifier
is dropped in Gradle 8.0.gradle-testsets-plugin/src/main/kotlin/org/unbrokendome/gradle/plugins/testsets/TestSetsPlugin.kt
Line 133 in 1c6fc3f
The text was updated successfully, but these errors were encountered: