Skip to content

Commit

Permalink
Centralize test configuration into special-tests and make sure it d…
Browse files Browse the repository at this point in the history
…oesn't get overwritten.
  • Loading branch information
nedtwigg committed Jan 17, 2023
1 parent aa0c878 commit c51331d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 28 deletions.
4 changes: 2 additions & 2 deletions lib-extra/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ dependencies {
// we'll hold the core lib to a high standard
spotbugs { reportLevel = 'low' } // low|medium|high (low = sensitive to even minor mistakes)

test {
useJUnitPlatform()
apply from: rootProject.file('gradle/special-tests.gradle')
tasks.named('test') {
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_16)) {
// needed for EclipseCdtFormatterStepTest
jvmArgs '--add-opens=java.base/java.lang=ALL-UNNAMED'
Expand Down
5 changes: 1 addition & 4 deletions lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,7 @@ dependencies {
// we'll hold the core lib to a high standard
spotbugs { reportLevel = 'low' } // low|medium|high (low = sensitive to even minor mistakes)

tasks.withType(Test).configureEach {
useJUnitPlatform()
}

apply from: rootProject.file('gradle/special-tests.gradle')
jar {
for (glue in NEEDS_GLUE) {
from sourceSets.getByName(glue).output.classesDirs
Expand Down
6 changes: 2 additions & 4 deletions plugin-gradle/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,11 @@ dependencies {
testImplementation "com.diffplug.durian:durian-testlib:${VER_DURIAN}"
}

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

apply from: rootProject.file('gradle/special-tests.gradle')

//////////////////////////
// GRADLE PLUGIN PORTAL //
//////////////////////////
Expand Down
2 changes: 0 additions & 2 deletions plugin-maven/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ dependencies {
}

apply from: rootProject.file('gradle/special-tests.gradle')

tasks.withType(Test).configureEach {
useJUnitPlatform()
systemProperty 'spotlessMavenPluginVersion', project.version
dependsOn 'publishToMavenLocal'
dependsOn ':lib:publishToMavenLocal'
Expand Down
16 changes: 0 additions & 16 deletions testlib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,6 @@ dependencies {
// we'll hold the testlib to a low standard (prize brevity)
spotbugs { reportLevel = 'high' } // low|medium|high (low = sensitive to even minor mistakes)

test {
useJUnitPlatform()
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_16)) {
// for GJF https://github.com/diffplug/spotless/issues/834
def args = [
'--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED',
'--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED',
'--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED',
'--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED',
'--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED',
'--add-opens=java.base/java.lang=ALL-UNNAMED'
]
jvmArgs args
}
}

apply from: rootProject.file('gradle/special-tests.gradle')

javadoc {
Expand Down

0 comments on commit c51331d

Please sign in to comment.