mirror of
https://github.com/apple/pkl.git
synced 2026-04-19 15:01:26 +02:00
Update to Gradle 8.6 (#245)
- Fix and clean up the pkl-commons-test build script. - Change tests to read test packages/certs directly from the file system instead of packaging and reading them from the class path. - Update expected checksums of some test packages. - Fix a conflict between Pkl's and Gradle's Kotlin libraries in the pkl-gradle project. - Fix build deprecation warnings. - Ensure Gradle distribution integrity with `distributionSha256Sum`. - Manually verify integrity of Gradle wrapper added by this commit.
This commit is contained in:
@@ -56,11 +56,11 @@ dependencies {
|
||||
|
||||
testImplementation(projects.pklCommonsTest)
|
||||
|
||||
stagedMacAmd64Executable(files("$buildDir/executable/pkl-macos-amd64"))
|
||||
stagedMacAarch64Executable(files("$buildDir/executable/pkl-macos-aarch64"))
|
||||
stagedLinuxAmd64Executable(files("$buildDir/executable/pkl-linux-amd64"))
|
||||
stagedLinuxAarch64Executable(files("$buildDir/executable/pkl-linux-aarch64"))
|
||||
stagedAlpineLinuxAmd64Executable(files("$buildDir/executable/pkl-alpine-linux-amd64"))
|
||||
stagedMacAmd64Executable(files("build/executable/pkl-macos-amd64"))
|
||||
stagedMacAarch64Executable(files("build/executable/pkl-macos-aarch64"))
|
||||
stagedLinuxAmd64Executable(files("build/executable/pkl-linux-amd64"))
|
||||
stagedLinuxAarch64Executable(files("build/executable/pkl-linux-aarch64"))
|
||||
stagedAlpineLinuxAmd64Executable(files("build/executable/pkl-alpine-linux-amd64"))
|
||||
}
|
||||
|
||||
tasks.jar {
|
||||
@@ -90,7 +90,7 @@ tasks.shadowJar {
|
||||
|
||||
val javaExecutable by tasks.registering(ExecutableJar::class) {
|
||||
inJar.set(tasks.shadowJar.flatMap { it.archiveFile })
|
||||
outJar.set(file("$buildDir/executable/jpkl"))
|
||||
outJar.set(file("build/executable/jpkl"))
|
||||
|
||||
// uncomment for debugging
|
||||
//jvmArgs.addAll("-ea", "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005")
|
||||
@@ -117,7 +117,7 @@ tasks.check {
|
||||
// To catch this and similar problems, test that Java executable starts successfully.
|
||||
val testStartJavaExecutable by tasks.registering(Exec::class) {
|
||||
dependsOn(javaExecutable)
|
||||
val outputFile = file("$buildDir/testStartJavaExecutable") // dummy output to satisfy up-to-date check
|
||||
val outputFile = file("build/testStartJavaExecutable") // dummy output to satisfy up-to-date check
|
||||
outputs.file(outputFile)
|
||||
|
||||
executable = javaExecutable.get().outputs.files.singleFile.toString()
|
||||
@@ -209,7 +209,7 @@ fun Exec.configureExecutable(isEnabled: Boolean, outputFile: File, extraArgs: Li
|
||||
* Builds the pkl CLI for macOS/amd64.
|
||||
*/
|
||||
val macExecutableAmd64: TaskProvider<Exec> by tasks.registering(Exec::class) {
|
||||
configureExecutable(buildInfo.os.isMacOsX && buildInfo.graalVm.isGraal22, file("$buildDir/executable/pkl-macos-amd64"))
|
||||
configureExecutable(buildInfo.os.isMacOsX && buildInfo.graalVm.isGraal22, file("build/executable/pkl-macos-amd64"))
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -221,7 +221,7 @@ val macExecutableAmd64: TaskProvider<Exec> by tasks.registering(Exec::class) {
|
||||
val macExecutableAarch64: TaskProvider<Exec> by tasks.registering(Exec::class) {
|
||||
configureExecutable(
|
||||
buildInfo.os.isMacOsX && !buildInfo.graalVm.isGraal22,
|
||||
file("$buildDir/executable/pkl-macos-aarch64"),
|
||||
file("build/executable/pkl-macos-aarch64"),
|
||||
listOf(
|
||||
"--initialize-at-run-time=org.msgpack.core.buffer.DirectBufferAccess",
|
||||
"-H:+AllowDeprecatedBuilderClassesOnImageClasspath"
|
||||
@@ -233,7 +233,7 @@ val macExecutableAarch64: TaskProvider<Exec> by tasks.registering(Exec::class) {
|
||||
* Builds the pkl CLI for linux/amd64.
|
||||
*/
|
||||
val linuxExecutableAmd64: TaskProvider<Exec> by tasks.registering(Exec::class) {
|
||||
configureExecutable(buildInfo.os.isLinux && buildInfo.arch == "amd64", file("$buildDir/executable/pkl-linux-amd64"))
|
||||
configureExecutable(buildInfo.os.isLinux && buildInfo.arch == "amd64", file("build/executable/pkl-linux-amd64"))
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -243,7 +243,7 @@ val linuxExecutableAmd64: TaskProvider<Exec> by tasks.registering(Exec::class) {
|
||||
* ARM instances.
|
||||
*/
|
||||
val linuxExecutableAarch64: TaskProvider<Exec> by tasks.registering(Exec::class) {
|
||||
configureExecutable(buildInfo.os.isLinux && buildInfo.arch == "aarch64", file("$buildDir/executable/pkl-linux-aarch64"))
|
||||
configureExecutable(buildInfo.os.isLinux && buildInfo.arch == "aarch64", file("build/executable/pkl-linux-aarch64"))
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -255,7 +255,7 @@ val linuxExecutableAarch64: TaskProvider<Exec> by tasks.registering(Exec::class)
|
||||
val alpineExecutableAmd64: TaskProvider<Exec> by tasks.registering(Exec::class) {
|
||||
configureExecutable(
|
||||
buildInfo.os.isLinux && buildInfo.arch == "amd64" && buildInfo.hasMuslToolchain,
|
||||
file("$buildDir/executable/pkl-alpine-linux-amd64"),
|
||||
file("build/executable/pkl-alpine-linux-amd64"),
|
||||
listOf(
|
||||
"--static",
|
||||
"--libc=musl",
|
||||
|
||||
@@ -109,7 +109,7 @@ class CliPackageDownloaderTest {
|
||||
packageUris =
|
||||
listOf(
|
||||
PackageUri(
|
||||
"package://localhost:12110/birds@0.5.0::sha256:3f19ab9fcee2f44f93a75a09e531db278c6d2cd25206836c8c2c4071cd7d3118"
|
||||
"package://localhost:12110/birds@0.5.0::sha256:0a5ad2dc13f06f73f96ba94e8d01d48252bc934e2de71a837620ca0fef8a7453"
|
||||
),
|
||||
),
|
||||
noTransitive = true
|
||||
@@ -140,7 +140,7 @@ class CliPackageDownloaderTest {
|
||||
"""
|
||||
Cannot download package `package://localhost:12110/birds@0.5.0` because the computed checksum for package metadata does not match the expected checksum.
|
||||
|
||||
Computed checksum: "3f19ab9fcee2f44f93a75a09e531db278c6d2cd25206836c8c2c4071cd7d3118"
|
||||
Computed checksum: "0a5ad2dc13f06f73f96ba94e8d01d48252bc934e2de71a837620ca0fef8a7453"
|
||||
Expected checksum: "intentionallyBogusChecksum"
|
||||
Asset URL: "https://localhost:12110/birds@0.5.0"
|
||||
"""
|
||||
@@ -204,7 +204,7 @@ class CliPackageDownloaderTest {
|
||||
Failed to download package://localhost:12110/badChecksum@1.0.0 because:
|
||||
Cannot download package `package://localhost:12110/badChecksum@1.0.0` because the computed checksum does not match the expected checksum.
|
||||
|
||||
Computed checksum: "0ec8a501e974802d0b71b8d58141e1e6eaa10bc2033e18200be3a978823d98aa"
|
||||
Computed checksum: "a6bf858cdd1c09da475c2abe50525902580910ee5cc1ff624999170591bf8f69"
|
||||
Expected checksum: "intentionally bogus checksum"
|
||||
Asset URL: "https://localhost:12110/badChecksum@1.0.0/badChecksum@1.0.0.zip"
|
||||
|
||||
|
||||
@@ -248,7 +248,7 @@ class CliProjectPackagerTest {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/fruit@1.0.5",
|
||||
"checksums": {
|
||||
"sha256": "b4ea243de781feeab7921227591e6584db5d0673340f30fab2ffe8ad5c9f75f5"
|
||||
"sha256": "abd173e8a25f5b930b0e34269a441e32c9d95e0b0a715bc6eff918f0afd0688e"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -915,7 +915,7 @@ class CliProjectPackagerTest {
|
||||
Package `package://localhost:12110/birds@0.5.0` was already published with different contents.
|
||||
|
||||
Computed checksum: 7324e17214b6dcda63ebfb57d5a29b077af785c13bed0dc22b5138628a3f8d8f
|
||||
Published checksum: 3f19ab9fcee2f44f93a75a09e531db278c6d2cd25206836c8c2c4071cd7d3118
|
||||
Published checksum: 0a5ad2dc13f06f73f96ba94e8d01d48252bc934e2de71a837620ca0fef8a7453
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
|
||||
@@ -102,14 +102,14 @@ class CliProjectResolverTest {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/birds@0.5.0",
|
||||
"checksums": {
|
||||
"sha256": "3f19ab9fcee2f44f93a75a09e531db278c6d2cd25206836c8c2c4071cd7d3118"
|
||||
"sha256": "0a5ad2dc13f06f73f96ba94e8d01d48252bc934e2de71a837620ca0fef8a7453"
|
||||
}
|
||||
},
|
||||
"package://localhost:12110/fruit@1": {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/fruit@1.0.5",
|
||||
"checksums": {
|
||||
"sha256": "b4ea243de781feeab7921227591e6584db5d0673340f30fab2ffe8ad5c9f75f5"
|
||||
"sha256": "abd173e8a25f5b930b0e34269a441e32c9d95e0b0a715bc6eff918f0afd0688e"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -157,14 +157,14 @@ class CliProjectResolverTest {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/birds@0.5.0",
|
||||
"checksums": {
|
||||
"sha256": "3f19ab9fcee2f44f93a75a09e531db278c6d2cd25206836c8c2c4071cd7d3118"
|
||||
"sha256": "0a5ad2dc13f06f73f96ba94e8d01d48252bc934e2de71a837620ca0fef8a7453"
|
||||
}
|
||||
},
|
||||
"package://localhost:12110/fruit@1": {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/fruit@1.0.5",
|
||||
"checksums": {
|
||||
"sha256": "b4ea243de781feeab7921227591e6584db5d0673340f30fab2ffe8ad5c9f75f5"
|
||||
"sha256": "abd173e8a25f5b930b0e34269a441e32c9d95e0b0a715bc6eff918f0afd0688e"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -255,14 +255,14 @@ class CliProjectResolverTest {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/birds@0.5.0",
|
||||
"checksums": {
|
||||
"sha256": "3f19ab9fcee2f44f93a75a09e531db278c6d2cd25206836c8c2c4071cd7d3118"
|
||||
"sha256": "0a5ad2dc13f06f73f96ba94e8d01d48252bc934e2de71a837620ca0fef8a7453"
|
||||
}
|
||||
},
|
||||
"package://localhost:12110/fruit@1": {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/fruit@1.1.0",
|
||||
"checksums": {
|
||||
"sha256": "98ad9fc407a79dc3fd5595e7a29c3803ade0a6957c18ec94b8a1624360b24f01"
|
||||
"sha256": "a82e92e0c259591111d09d18a14f5ad66e2b6e13d827ee3e6f7ce06f5d0fbe0c"
|
||||
}
|
||||
},
|
||||
"package://localhost:12110/package2@5": {
|
||||
@@ -337,14 +337,14 @@ class CliProjectResolverTest {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/birds@0.5.0",
|
||||
"checksums": {
|
||||
"sha256": "3f19ab9fcee2f44f93a75a09e531db278c6d2cd25206836c8c2c4071cd7d3118"
|
||||
"sha256": "0a5ad2dc13f06f73f96ba94e8d01d48252bc934e2de71a837620ca0fef8a7453"
|
||||
}
|
||||
},
|
||||
"package://localhost:12110/fruit@1": {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/fruit@1.0.5",
|
||||
"checksums": {
|
||||
"sha256": "b4ea243de781feeab7921227591e6584db5d0673340f30fab2ffe8ad5c9f75f5"
|
||||
"sha256": "abd173e8a25f5b930b0e34269a441e32c9d95e0b0a715bc6eff918f0afd0688e"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -420,14 +420,14 @@ class CliProjectResolverTest {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/birds@0.5.0",
|
||||
"checksums": {
|
||||
"sha256": "3f19ab9fcee2f44f93a75a09e531db278c6d2cd25206836c8c2c4071cd7d3118"
|
||||
"sha256": "0a5ad2dc13f06f73f96ba94e8d01d48252bc934e2de71a837620ca0fef8a7453"
|
||||
}
|
||||
},
|
||||
"package://localhost:12110/fruit@1": {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/fruit@1.0.5",
|
||||
"checksums": {
|
||||
"sha256": "b4ea243de781feeab7921227591e6584db5d0673340f30fab2ffe8ad5c9f75f5"
|
||||
"sha256": "abd173e8a25f5b930b0e34269a441e32c9d95e0b0a715bc6eff918f0afd0688e"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -445,7 +445,7 @@ class CliProjectResolverTest {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/fruit@1.1.0",
|
||||
"checksums": {
|
||||
"sha256": "98ad9fc407a79dc3fd5595e7a29c3803ade0a6957c18ec94b8a1624360b24f01"
|
||||
"sha256": "a82e92e0c259591111d09d18a14f5ad66e2b6e13d827ee3e6f7ce06f5d0fbe0c"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user