mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-12-03 03:42:21 +00:00
build: rerun addon resource processing when versions change
This commit is contained in:
1 parent
2f36b2d5c4
commit
44408a1b72
1 file changed
+11
-7
@@ -41,22 +41,26 @@ fun Project.configureCompilation() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Gradle doesn't fingerprint filter arguments; the tokens are declared as inputs.
|
||||||
|
val metadataTokens = mapOf(
|
||||||
|
"DESCRIPTION" to properties["terra.description"],
|
||||||
|
"WIKI" to properties["terra.wiki"],
|
||||||
|
"SOURCE" to properties["terra.source"],
|
||||||
|
"ISSUES" to properties["terra.issues"],
|
||||||
|
"LICENSE" to properties["terra.license"]
|
||||||
|
)
|
||||||
tasks.withType<ProcessResources> {
|
tasks.withType<ProcessResources> {
|
||||||
include("**/*.*")
|
include("**/*.*")
|
||||||
|
inputs.properties(metadataTokens.mapKeys { "token.${it.key}" }.mapValues { it.value.toString() })
|
||||||
filter<ReplaceTokens>(
|
filter<ReplaceTokens>(
|
||||||
"tokens" to mapOf(
|
"tokens" to metadataTokens
|
||||||
"DESCRIPTION" to properties["terra.description"],
|
|
||||||
"WIKI" to properties["terra.wiki"],
|
|
||||||
"SOURCE" to properties["terra.source"],
|
|
||||||
"ISSUES" to properties["terra.issues"],
|
|
||||||
"LICENSE" to properties["terra.license"]
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
afterEvaluate {
|
afterEvaluate {
|
||||||
tasks.withType<ProcessResources> {
|
tasks.withType<ProcessResources> {
|
||||||
include("**/*.*")
|
include("**/*.*")
|
||||||
|
inputs.property("token.VERSION", version.toString())
|
||||||
filter<ReplaceTokens>(
|
filter<ReplaceTokens>(
|
||||||
"tokens" to mapOf(
|
"tokens" to mapOf(
|
||||||
"VERSION" to version.toString()
|
"VERSION" to version.toString()
|
||||||
|
|||||||
Reference in new issue
Block a user