Skip to content

Commit 5c74774

Browse files
committed
Fixed Configuration Cache problem for buildLambda task
The main reason of the problem was using the Project object in task action (https://docs.gradle.org/8.9/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution).
1 parent 5ac507c commit 5c74774

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

build.gradle.kts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,14 @@ tasks.withType<BootJar> {
130130
}
131131

132132
val buildLambda by tasks.creating(Zip::class) {
133-
val lambdaWorkDirectoryPath = "/var/task/"
133+
val propertyFile = propertyFile
134+
val propertyFileContent = generateProperties("/var/task/")
135+
134136
from(tasks.compileKotlin)
135137
from(tasks.processResources) {
136138
eachFile {
137139
if (name == propertyFile) {
138-
file.writeText(generateProperties(lambdaWorkDirectoryPath))
140+
file.writeText(propertyFileContent)
139141
}
140142
}
141143
}

0 commit comments

Comments
 (0)