mirror of
https://github.com/apple/pkl.git
synced 2026-06-11 08:12:50 +02:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user