Skip to content

Commit

Permalink
Update to Gradle 8.12 (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
wmdietl authored Dec 26, 2024
1 parent 36b365f commit 9cc6b0e
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
15 changes: 12 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<String> specFiles = new TreeSet<>();
Expand All @@ -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
Expand Down Expand Up @@ -202,7 +210,7 @@ tasks.withType(Test).configureEach {
showStackTraces = false
showStandardStreams = true
events "failed"
exceptionFormat "full"
exceptionFormat = "full"
}
}

Expand Down Expand Up @@ -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',
Expand Down
4 changes: 2 additions & 2 deletions conformance-test-framework/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 1 addition & 2 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 9cc6b0e

Please sign in to comment.