Skip to content

Commit c51331d

Browse files
committed
Centralize test configuration into special-tests and make sure it doesn't get overwritten.
1 parent aa0c878 commit c51331d

File tree

5 files changed

+5
-28
lines changed

5 files changed

+5
-28
lines changed

lib-extra/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ dependencies {
2525
// we'll hold the core lib to a high standard
2626
spotbugs { reportLevel = 'low' } // low|medium|high (low = sensitive to even minor mistakes)
2727

28-
test {
29-
useJUnitPlatform()
28+
apply from: rootProject.file('gradle/special-tests.gradle')
29+
tasks.named('test') {
3030
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_16)) {
3131
// needed for EclipseCdtFormatterStepTest
3232
jvmArgs '--add-opens=java.base/java.lang=ALL-UNNAMED'

lib/build.gradle

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,7 @@ dependencies {
112112
// we'll hold the core lib to a high standard
113113
spotbugs { reportLevel = 'low' } // low|medium|high (low = sensitive to even minor mistakes)
114114

115-
tasks.withType(Test).configureEach {
116-
useJUnitPlatform()
117-
}
118-
115+
apply from: rootProject.file('gradle/special-tests.gradle')
119116
jar {
120117
for (glue in NEEDS_GLUE) {
121118
from sourceSets.getByName(glue).output.classesDirs

plugin-gradle/build.gradle

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,11 @@ dependencies {
2727
testImplementation "com.diffplug.durian:durian-testlib:${VER_DURIAN}"
2828
}
2929

30-
test {
31-
useJUnitPlatform()
30+
apply from: rootProject.file('gradle/special-tests.gradle')
31+
tasks.named('test') {
3232
testLogging.showStandardStreams = true
3333
}
3434

35-
apply from: rootProject.file('gradle/special-tests.gradle')
36-
3735
//////////////////////////
3836
// GRADLE PLUGIN PORTAL //
3937
//////////////////////////

plugin-maven/build.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,7 @@ dependencies {
6767
}
6868

6969
apply from: rootProject.file('gradle/special-tests.gradle')
70-
7170
tasks.withType(Test).configureEach {
72-
useJUnitPlatform()
7371
systemProperty 'spotlessMavenPluginVersion', project.version
7472
dependsOn 'publishToMavenLocal'
7573
dependsOn ':lib:publishToMavenLocal'

testlib/build.gradle

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,6 @@ dependencies {
2121
// we'll hold the testlib to a low standard (prize brevity)
2222
spotbugs { reportLevel = 'high' } // low|medium|high (low = sensitive to even minor mistakes)
2323

24-
test {
25-
useJUnitPlatform()
26-
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_16)) {
27-
// for GJF https://github.com/diffplug/spotless/issues/834
28-
def args = [
29-
'--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED',
30-
'--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED',
31-
'--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED',
32-
'--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED',
33-
'--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED',
34-
'--add-opens=java.base/java.lang=ALL-UNNAMED'
35-
]
36-
jvmArgs args
37-
}
38-
}
39-
4024
apply from: rootProject.file('gradle/special-tests.gradle')
4125

4226
javadoc {

0 commit comments

Comments
 (0)