Skip to content

Commit

Permalink
buildscripts: use "configureEach" to reduce task configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Oct 25, 2023
1 parent b8207d9 commit 30f9ba6
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion DacWizard/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
id 'application'
}

tasks.withType(JavaExec) { // Java runtime options:
tasks.withType(JavaExec).configureEach { // Java runtime options:
args '--openGL3'
}

Expand Down
2 changes: 1 addition & 1 deletion Jme3Examples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

java.sourceCompatibility = JavaVersion.VERSION_1_8

tasks.withType(JavaCompile) { // Java compile-time options:
tasks.withType(JavaCompile).configureEach { // Java compile-time options:
options.deprecation = true
}

Expand Down
2 changes: 1 addition & 1 deletion MinieAssets/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ext {
plaid = assets + 'Textures/plaid.png'
}

tasks.withType(JavaCompile) { // Java compile-time options:
tasks.withType(JavaCompile).configureEach { // Java compile-time options:
options.deprecation = true
}

Expand Down
2 changes: 1 addition & 1 deletion MinieDump/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
id 'application'
}

tasks.withType(JavaCompile) { // Java compile-time options:
tasks.withType(JavaCompile).configureEach { // Java compile-time options:
options.deprecation = true
}

Expand Down
2 changes: 1 addition & 1 deletion MinieExamples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ application {

java.sourceCompatibility = JavaVersion.VERSION_1_8

tasks.withType(JavaCompile) { // Java compile-time options:
tasks.withType(JavaCompile).configureEach { // Java compile-time options:
options.deprecation = true
}

Expand Down
2 changes: 1 addition & 1 deletion MinieLibrary/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ publishMavenPublicationToOSSRHRepository.dependsOn('assemble')
signing {
sign publishing.publications.maven
}
tasks.withType(Sign) {
tasks.withType(Sign).configureEach {
onlyIf { rootProject.hasProperty('signing.keyId') }
}
signMavenPublication.dependsOn('module')
Expand Down
2 changes: 1 addition & 1 deletion TutorialApps/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
id 'application'
}

tasks.withType(JavaCompile) { // Java compile-time options:
tasks.withType(JavaCompile).configureEach { // Java compile-time options:
options.deprecation = true
}

Expand Down
2 changes: 1 addition & 1 deletion VhacdTuner/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
id 'application'
}

tasks.withType(JavaExec) { // Java runtime options:
tasks.withType(JavaExec).configureEach { // Java runtime options:
args '--openGL3'
}

Expand Down
6 changes: 3 additions & 3 deletions common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ checkstyle {
toolVersion '9.3'
}

tasks.withType(JavaCompile) { // Java compile-time options:
tasks.withType(JavaCompile).configureEach { // Java compile-time options:
options.compilerArgs << '-Xdiags:verbose'
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_14)) {
// Suppress warnings that source value 7 is obsolete.
Expand All @@ -29,7 +29,7 @@ tasks.withType(JavaCompile) { // Java compile-time options:
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
Boolean isMacOS = DefaultNativePlatform.currentOperatingSystem.isMacOsX()

tasks.withType(JavaExec) { // Java runtime options:
tasks.withType(JavaExec).configureEach { // Java runtime options:
if (isMacOS) {
jvmArgs '-XstartOnFirstThread'
} else {
Expand All @@ -44,7 +44,7 @@ tasks.withType(JavaExec) { // Java runtime options:
//jvmArgs '-XX:+UseG1GC', '-XX:MaxGCPauseMillis=10'
}

configurations.all {
configurations.configureEach {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds' // to disable caching of SNAPSHOTs
}

Expand Down

0 comments on commit 30f9ba6

Please sign in to comment.