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:
Stefano Baghino
2024-04-18 17:28:56 +02:00
committed by GitHub
parent 31917d1556
commit 81bfdb7cbd
4 changed files with 16 additions and 14 deletions

View File

@@ -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