Slackbot
06/22/2022, 4:03 PMDavid Chang
06/22/2022, 4:39 PMephemient
06/22/2022, 4:44 PMdoFirst
or doLast
blocks? I think the most likely case is that one of those is capturing the build script reference. but you should provide more details on how the task is created.Matthieu Ghilain
06/22/2022, 6:21 PMMatthieu Ghilain
06/22/2022, 6:21 PMMatthieu Ghilain
06/22/2022, 6:23 PMMatthieu Ghilain
06/22/2022, 6:24 PMval version = project.version
val staticResourceDirectory = project.fileTree("$buildDir/resources/main/static/")
tasks.processResources.configure {
inputs.property("projectVersion", version)
outputs.cacheIf { true }
doLast {
staticResourceDirectory.forEach {
postProcessApiFile(it)
}
}
}
Matthieu Ghilain
06/22/2022, 6:24 PMephemient
06/22/2022, 6:24 PMpostProcessApiFile
is a function defined locally, yes it's forbiddenMatthieu Ghilain
06/22/2022, 6:41 PMval version = project.version
val staticResourceDirectory = project.fileTree("$buildDir/resources/main/static/").asFileTree
tasks.processResources.configure {
inputs.property("projectVersion", version)
outputs.cacheIf { true }
doLast {
staticResourceDirectory.forEach {
//postProcessApiFile(it, version as String)
}
}
}
Matthieu Ghilain
06/22/2022, 6:41 PMMatthieu Ghilain
06/22/2022, 6:41 PMstaticResourceDirectory
is the issue.Matthieu Ghilain
06/22/2022, 6:42 PM