Enable Gradle configuration cache (#1646)

Enable the configuration cache feature in Gradle, and adjust various
pieces of build logic that aren't configuration cache compatible.
This commit is contained in:
Daniel Chao
2026-06-05 11:05:19 -07:00
committed by GitHub
parent 74eae0388e
commit 87ec8ee730
20 changed files with 296 additions and 177 deletions
+17 -13
View File
@@ -98,20 +98,22 @@ tasks.processResources {
inputs.property("version", buildInfo.pklVersion)
inputs.property("commitId", buildInfo.commitId)
filesMatching("org/pkl/core/Release.properties") {
val stdlibModules =
fileTree("$rootDir/stdlib") {
include("*.pkl")
exclude("doc-package-info.pkl")
}
.map { "pkl:" + it.nameWithoutExtension }
.sortedBy { it.lowercase() }
val pklVersion = buildInfo.pklVersion
val commitId = buildInfo.commitId
val stdlibModules =
fileTree("$rootDir/stdlib") {
include("*.pkl")
exclude("doc-package-info.pkl")
}
.map { "pkl:" + it.nameWithoutExtension }
.sortedBy { it.lowercase() }
filesMatching("org/pkl/core/Release.properties") {
filter<ReplaceTokens>(
"tokens" to
mapOf(
"version" to buildInfo.pklVersion,
"commitId" to buildInfo.commitId,
"version" to pklVersion.get(),
"commitId" to commitId.get(),
"stdlibModules" to stdlibModules.joinToString(","),
)
)
@@ -140,13 +142,15 @@ val externalReaderFixture by tasks.registering {
group = "build"
dependsOn(tasks.named("compileExternalReaderFixtureJava"))
inputs.files(externalReaderFixtureSourceSet.map { it.output })
val fileName = if (buildInfo.os.isWindows) "externalreader.bat" else "externalreader"
val isWindows = buildInfo.os.isWindows
val fileName = if (isWindows) "externalreader.bat" else "externalreader"
val outputFile = layout.buildDirectory.file("fixtures/$fileName")
outputs.file(outputFile)
val runtimeClasspath = externalReaderFixtureSourceSet.map { it.runtimeClasspath }
doLast {
val classpath = externalReaderFixtureSourceSet.get().runtimeClasspath.asPath
val classpath = runtimeClasspath.get().asPath
val scriptContent =
if (buildInfo.os.isWindows) {
if (isWindows) {
"""
@echo off
java -cp $classpath org.pkl.core.externalreaderfixture.Main