mirror of
https://github.com/apple/pkl.git
synced 2026-04-25 09:48:41 +02:00
Enable caching of native image building and test tasks (#409)
Enable caching for the native image building task and improves the caching effectiveness of some of the test tasks in the project.
This commit is contained in:
@@ -32,5 +32,5 @@ dependencies {
|
||||
tasks.test {
|
||||
inputs.files(fileTree("modules").matching {
|
||||
include("**/pages/*.adoc")
|
||||
})
|
||||
}).withPropertyName("asciiDocFiles").withPathSensitivity(PathSensitivity.RELATIVE)
|
||||
}
|
||||
|
||||
@@ -138,9 +138,11 @@ fun Exec.configureExecutable(isEnabled: Boolean, outputFile: Provider<RegularFil
|
||||
enabled = isEnabled
|
||||
dependsOn(":installGraalVm")
|
||||
|
||||
inputs.files(sourceSets.main.map { it.output })
|
||||
inputs.files(configurations.runtimeClasspath)
|
||||
inputs.files(sourceSets.main.map { it.output }).withPropertyName("mainSourceSets").withPathSensitivity(PathSensitivity.RELATIVE)
|
||||
inputs.files(configurations.runtimeClasspath).withPropertyName("runtimeClasspath").withNormalizer(ClasspathNormalizer::class)
|
||||
inputs.files(file(buildInfo.graalVm.baseDir).resolve("bin/native-image")).withPropertyName("graalVmNativeImage").withPathSensitivity(PathSensitivity.ABSOLUTE)
|
||||
outputs.file(outputFile)
|
||||
outputs.cacheIf { true }
|
||||
|
||||
workingDir(outputFile.map { it.asFile.parentFile })
|
||||
executable = "${buildInfo.graalVm.baseDir}/bin/native-image"
|
||||
|
||||
@@ -154,9 +154,9 @@ tasks.compileKotlin {
|
||||
}
|
||||
|
||||
tasks.test {
|
||||
inputs.dir("src/test/files/LanguageSnippetTests/input")
|
||||
inputs.dir("src/test/files/LanguageSnippetTests/input-helper")
|
||||
inputs.dir("src/test/files/LanguageSnippetTests/output")
|
||||
inputs.dir("src/test/files/LanguageSnippetTests/input").withPropertyName("languageSnippetTestsInput").withPathSensitivity(PathSensitivity.RELATIVE)
|
||||
inputs.dir("src/test/files/LanguageSnippetTests/input-helper").withPropertyName("languageSnippetTestsInputHelper").withPathSensitivity(PathSensitivity.RELATIVE)
|
||||
inputs.dir("src/test/files/LanguageSnippetTests/output").withPropertyName("languageSnippetTestsOutput").withPathSensitivity(PathSensitivity.RELATIVE)
|
||||
|
||||
useJUnitPlatform {
|
||||
excludeEngines("MacAmd64LanguageSnippetTestsEngine")
|
||||
@@ -168,9 +168,9 @@ tasks.test {
|
||||
}
|
||||
|
||||
val testJavaExecutable by tasks.registering(Test::class) {
|
||||
inputs.dir("src/test/files/LanguageSnippetTests/input")
|
||||
inputs.dir("src/test/files/LanguageSnippetTests/input-helper")
|
||||
inputs.dir("src/test/files/LanguageSnippetTests/output")
|
||||
inputs.dir("src/test/files/LanguageSnippetTests/input").withPropertyName("languageSnippetTestsInput").withPathSensitivity(PathSensitivity.RELATIVE)
|
||||
inputs.dir("src/test/files/LanguageSnippetTests/input-helper").withPropertyName("languageSnippetTestsInputHelper").withPathSensitivity(PathSensitivity.RELATIVE)
|
||||
inputs.dir("src/test/files/LanguageSnippetTests/output").withPropertyName("languageSnippetTestsOutput").withPathSensitivity(PathSensitivity.RELATIVE)
|
||||
|
||||
testClassesDirs = files(tasks.test.get().testClassesDirs)
|
||||
classpath =
|
||||
@@ -196,9 +196,9 @@ val testMacExecutableAmd64 by tasks.registering(Test::class) {
|
||||
enabled = buildInfo.os.isMacOsX && buildInfo.graalVm.isGraal22
|
||||
dependsOn(":pkl-cli:macExecutableAmd64")
|
||||
|
||||
inputs.dir("src/test/files/LanguageSnippetTests/input")
|
||||
inputs.dir("src/test/files/LanguageSnippetTests/input-helper")
|
||||
inputs.dir("src/test/files/LanguageSnippetTests/output")
|
||||
inputs.dir("src/test/files/LanguageSnippetTests/input").withPropertyName("languageSnippetTestsInput").withPathSensitivity(PathSensitivity.RELATIVE)
|
||||
inputs.dir("src/test/files/LanguageSnippetTests/input-helper").withPropertyName("languageSnippetTestsInputHelper").withPathSensitivity(PathSensitivity.RELATIVE)
|
||||
inputs.dir("src/test/files/LanguageSnippetTests/output").withPropertyName("languageSnippetTestsOutput").withPathSensitivity(PathSensitivity.RELATIVE)
|
||||
|
||||
testClassesDirs = files(tasks.test.get().testClassesDirs)
|
||||
classpath = tasks.test.get().classpath
|
||||
|
||||
@@ -14,6 +14,6 @@ dependencies {
|
||||
}
|
||||
|
||||
tasks.test {
|
||||
inputs.dir("src/test/files/SnippetTests/input")
|
||||
inputs.dir("src/test/files/SnippetTests/output")
|
||||
inputs.dir("src/test/files/SnippetTests/input").withPropertyName("snippetTestsInput").withPathSensitivity(PathSensitivity.RELATIVE)
|
||||
inputs.dir("src/test/files/SnippetTests/output").withPropertyName("snippetTestsOutput").withPathSensitivity(PathSensitivity.RELATIVE)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user