Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve Gradle build scripts (#3062)
* Convert build.gradle.kts outliers back to build.gradle to be consistent It also needs more hacky code than benefits. Builds will be faster too. * Remove unnecessary inclusion of dead repositories * Remove dead repository, mavenLocal() is not used, because we depend on project() objects. Even if it was, a repositories {} inside a build.gradle file doesn't override, it appends (confirmed with `println(repositories.collect())` before and after the block; so globally declared repos might win in resolution. * Remove unused dependency * Generalize ordering of build.gradle headings: imports plugins { } apply from: description dependencies ... everything else and make plugin syntax consistent. Also fix ordering dependency on description being set before including a file. * Add missing dependencies.gradle inclusions * Format * Introduce new module type: java-test Change: junitJupiterExtensionTest and junitJupiterInlineMockMakerExtensionTest had the javadoc task enabled. * Add java version to new module type: java-test Change: memory-test, osgi-test, junitJupiterExtensionTest and junitJupiterInlineMockMakerExtensionTest had no java compatibility declared, now it's 11. * Nominate more modules as java-test. Change: extTest, junitJupiterParallelTest, groovyTest, groovyInlineTest had no java compatibility declared, now it's 11. Change: extTest, junitJupiterParallelTest, groovyTest, groovyInlineTest, kotlinReleaseCoroutinesTest and kotlinTest had the javadoc task enabled.
- Loading branch information
1 parent
f008531
commit a7bc931
Showing
26 changed files
with
102 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apply plugin: "java" | ||
|
||
// Test modules don't need to be published, so there's no need to build javadoc for them. | ||
// Most test modules don't have src/main, but this is here in shared configuration just in case. | ||
tasks.javadoc.enabled = false | ||
|
||
java { | ||
sourceCompatibility = 11 | ||
targetCompatibility = 11 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
plugins { | ||
id('java-platform') | ||
id 'java-platform' | ||
} | ||
|
||
description = "Mockito Bill of Materials (BOM)" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
subprojects/junitJupiterExtensionTest/junitJupiterExtensionTest.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apply from: "$rootDir/gradle/dependencies.gradle" | ||
apply from: "$rootDir/gradle/java-test.gradle" | ||
|
||
description = "End-to-end tests for automatic registration of MockitoExtension." | ||
|
||
dependencies { | ||
testImplementation project(":junit-jupiter") | ||
testImplementation libraries.assertj | ||
testImplementation libraries.junitJupiterApi | ||
testRuntimeOnly libraries.junitJupiterEngine | ||
testRuntimeOnly libraries.junitPlatformLauncher | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
} |
25 changes: 0 additions & 25 deletions
25
subprojects/junitJupiterExtensionTest/junitJupiterExtensionTest.gradle.kts
This file was deleted.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
.../junitJupiterInlineMockMakerExtensionTest/junitJupiterInlineMockMakerExtensionTest.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apply from: "$rootDir/gradle/dependencies.gradle" | ||
apply from: "$rootDir/gradle/java-test.gradle" | ||
|
||
description = "End-to-end tests for automatic registration of MockitoExtension with the inline mock maker." | ||
|
||
dependencies { | ||
testImplementation project(":junit-jupiter") | ||
testImplementation libraries.assertj | ||
testImplementation libraries.junitJupiterApi | ||
testRuntimeOnly libraries.junitJupiterEngine | ||
testRuntimeOnly libraries.junitPlatformLauncher | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
} |
25 changes: 0 additions & 25 deletions
25
...itJupiterInlineMockMakerExtensionTest/junitJupiterInlineMockMakerExtensionTest.gradle.kts
This file was deleted.
Oops, something went wrong.
5 changes: 2 additions & 3 deletions
5
subprojects/junitJupiterParallelTest/junitJupiterParallelTest.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 4 additions & 19 deletions
23
subprojects/kotlinReleaseCoroutinesTest/kotlinReleaseCoroutinesTest.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,14 @@ | ||
plugins { | ||
id 'java' | ||
} | ||
description = "Test suite memory usage of Mockito" | ||
|
||
apply from: "$rootDir/gradle/dependencies.gradle" | ||
apply from: "$rootDir/gradle/java-test.gradle" | ||
|
||
description = "Test suite memory usage of Mockito" | ||
|
||
dependencies { | ||
implementation project.rootProject | ||
testImplementation libraries.junit4 | ||
testImplementation libraries.assertj | ||
} | ||
|
||
tasks.javadoc.enabled = false | ||
|
||
test { | ||
maxHeapSize = "128m" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,10 @@ | ||
plugins { | ||
id 'java' | ||
} | ||
apply from: "$rootDir/gradle/dependencies.gradle" | ||
apply from: "$rootDir/gradle/java-test.gradle" | ||
|
||
description = "Test suite for Java 9 modules with Mockito" | ||
|
||
apply from: "$rootDir/gradle/dependencies.gradle" | ||
|
||
dependencies { | ||
implementation project.rootProject | ||
testImplementation libraries.junit4 | ||
testImplementation libraries.assertj | ||
} | ||
|
||
tasks.javadoc.enabled = false | ||
|
||
java { | ||
sourceCompatibility = 11 | ||
targetCompatibility = 11 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.