From 9cc6b0ed4e0719fb5f7a6cddddc0360aab2b5df0 Mon Sep 17 00:00:00 2001 From: Werner Dietl Date: Thu, 26 Dec 2024 16:01:03 -0500 Subject: [PATCH] Update to Gradle 8.12 (#215) --- build.gradle | 15 ++++++++++++--- conformance-test-framework/build.gradle | 4 ++-- gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew | 3 +-- settings.gradle | 4 ++-- 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/build.gradle b/build.gradle index 251909f0..9451bf22 100644 --- a/build.gradle +++ b/build.gradle @@ -109,6 +109,12 @@ if (jspecify != null) { assemble.dependsOn(jspecify.task(':assemble')) } +// Enable exec/javaexec +interface InjectedExecOps { + @Inject + ExecOperations getExecOps() +} + tasks.withType(JavaCompile).configureEach { options.compilerArgs.add("-Xlint:all") // ErrorProne makes suppressing these easier @@ -146,6 +152,8 @@ tasks.register('includeJSpecifyJDK') { inputs.dir file(srcDir) outputs.dir file(dstDir) + def injected = project.objects.newInstance(InjectedExecOps) + doLast { FileTree srcTree = fileTree(dir: srcDir) NavigableSet specFiles = new TreeSet<>(); @@ -168,7 +176,7 @@ tasks.register('includeJSpecifyJDK') { include specFile.substring(srcPrefixSize) } } - javaexec { + injected.execOps.javaexec { classpath = sourceSets.main.runtimeClasspath standardOutput = System.out errorOutput = System.err @@ -202,7 +210,7 @@ tasks.withType(Test).configureEach { showStackTraces = false showStandardStreams = true events "failed" - exceptionFormat "full" + exceptionFormat = "full" } } @@ -293,10 +301,11 @@ if (checkerFramework != null) { def cfQualJar = checkerFramework.projectDir.toPath() .resolve("checker-qual/build/libs/checker-qual-${libs.versions.checkerFramework.get()}.jar") + def injected = project.objects.newInstance(InjectedExecOps) if (!cfQualJar.toFile().exists()) { mkdir(cfQualJar.parent) - exec { + injected.execOps.exec { executable 'jar' args = [ 'cf', diff --git a/conformance-test-framework/build.gradle b/conformance-test-framework/build.gradle index 633ff854..2065f9ff 100644 --- a/conformance-test-framework/build.gradle +++ b/conformance-test-framework/build.gradle @@ -2,8 +2,8 @@ plugins { id 'java-library' } -group 'org.jspecify.conformance' -version '0.0.0-SNAPSHOT' +group = 'org.jspecify.conformance' +version = '0.0.0-SNAPSHOT' repositories { mavenCentral() diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 9355b415..cea7a793 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index f5feea6d..f3b75f3b 100755 --- a/gradlew +++ b/gradlew @@ -86,8 +86,7 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s -' "$PWD" ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum diff --git a/settings.gradle b/settings.gradle index ff46e82a..f71ab402 100644 --- a/settings.gradle +++ b/settings.gradle @@ -6,9 +6,9 @@ include 'conformance-test-framework' // See https://docs.gradle.org/current/userguide/composite_builds.html#included_build_declaring_substitutions includeBuild(".") -exec { +providers.exec { executable './initialize-project' -} +}.result.get() dependencyResolutionManagement { versionCatalogs {