Skip to content

Commit

Permalink
Fixed Configuration Cache problem for buildLambda task
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
dkrasnoff committed Sep 3, 2024
1 parent 5ac507c commit 5c74774
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,14 @@ tasks.withType<BootJar> {
}

val buildLambda by tasks.creating(Zip::class) {
val lambdaWorkDirectoryPath = "/var/task/"
val propertyFile = propertyFile
val propertyFileContent = generateProperties("/var/task/")

from(tasks.compileKotlin)
from(tasks.processResources) {
eachFile {
if (name == propertyFile) {
file.writeText(generateProperties(lambdaWorkDirectoryPath))
file.writeText(propertyFileContent)
}
}
}
Expand Down

0 comments on commit 5c74774

Please sign in to comment.