Skip to content

Commit

Permalink
Upgrade to Gradle 8.8
Browse files Browse the repository at this point in the history
Gradle 8.7 introduced a ["better API for updating collection
properties"](https://docs.gradle.org/8.7/release-notes.html#better-api-for-updating-collection-properties),
which [we promptly put to use](e41ef90)
even though it was `@Incubating`.  Gradle 8.8 removes this new API.  OK,
no problem, we can go back to using the original API.

[The File Permissions API is now stable](https://docs.gradle.org/8.8/release-notes.html#file-permissions-api-is-now-stable),
while `Copy.fileMode` and related APIs are deprecated.  OK, let's switch
to the File Permissions API.  That API is semantically higher-level and
therefore nicer to use anyway, so I'm happy to make this change.
  • Loading branch information
liblit committed Jun 6, 2024
1 parent 2f79c10 commit 9a68b2d
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ tasks.withType<JavaCompile>().configureEach {
options.errorprone {
if (!name.contains("test", true)) {
error("NullAway")
errorproneArgs.appendAll(
errorproneArgs.addAll(
"-XepOpt:NullAway:AnnotatedPackages=com.ibm.wala",
"-XepOpt:NullAway:JSpecifyMode=true",
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ fun addJvmLibrary(binary: CppBinary, linkTask: AbstractLinkTask, project: Projec

fun addRpath(linkTask: AbstractLinkTask, library: File) {
if (!(linkTask.project.rootProject.extra["isWindows"] as Boolean)) {
linkTask.linkerArgs.append("-Wl,-rpath,${library.parent}")
linkTask.linkerArgs.add("-Wl,-rpath,${library.parent}")
}
}

Expand Down
8 changes: 7 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,13 @@ tasks.register<Copy>("installGitHooks") {
from("config/hooks/pre-commit-stub")
rename { "pre-commit" }
into(".git/hooks")
fileMode = 0b111_111_111
filePermissions {
listOf(user, group, other).forEach {
it.read = true
it.write = true
it.execute = true
}
}
}

listOf("check", "spotlessCheck", "spotlessApply").forEach {
Expand Down
2 changes: 1 addition & 1 deletion cast/cast/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ library {
.configure(
closureOf<LinkSharedLibrary> {
if (targetMachine.operatingSystemFamily.isMacOs) {
linkerArgs.append("-Wl,-install_name,@rpath/${nativeLibraryOutput.name}")
linkerArgs.add("-Wl,-install_name,@rpath/${nativeLibraryOutput.name}")
}
addJvmLibrary(this@whenElementFinalized, this, project)
})
Expand Down
7 changes: 3 additions & 4 deletions cast/smoke_main/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,15 @@ application {

// xlator Java bytecode + implementation of native methods
val pathElements = project.objects.listProperty<File>()
pathElements.appendAll(
files("../build/classes/java/test", libxlatorTest.parent))
pathElements.addAll(files("../build/classes/java/test", libxlatorTest.parent))

// "primordial.txt" resource loaded during test
pathElements.append(coreResources.singleFile)
pathElements.add(coreResources.singleFile)
inputs.files(coreResources)

// additional supporting Java class files
inputs.files(smokeMainExtraPathElements)
pathElements.appendAll(smokeMainExtraPathElements)
pathElements.addAll(smokeMainExtraPathElements)

// all combined as a colon-delimited path list
argumentProviders.add { listOf(pathElements.get().joinToString(":")) }
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=194717442575a6f96e1c1befa2c30e9a4fc90f701d7aee33eb879b79e7ff05c0
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
distributionSha256Sum=f8b4f4772d302c8ff580bc40d0f56e715de69b163546944f787c87abf209c961
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down

0 comments on commit 9a68b2d

Please sign in to comment.