Properly populate versions.properties (#3730)

This commit is contained in:
Nicola Corti
2021-05-02 20:26:12 +02:00
committed by GitHub
parent 3120e356b2
commit 9dc55c22b3
3 changed files with 14 additions and 15 deletions

View File

@@ -70,18 +70,19 @@ pluginBundle {
}
}
tasks.processResources {
filter<org.apache.tools.ant.filters.ReplaceTokens>(
"tokens" to mapOf(
"detektVersion" to project.version as String
)
)
}
tasks {
val writeDetektVersionProperties by registering(WriteProperties::class) {
description = "Write the properties file with the Detekt version to be used by the plugin"
encoding = "UTF-8"
outputFile = file("$buildDir/versions.properties")
property("detektVersion", project.version)
}
tasks.processTestResources {
filter<org.apache.tools.ant.filters.ReplaceTokens>(
"tokens" to mapOf(
"detektVersion" to project.version as String
)
)
processResources {
from(writeDetektVersionProperties)
}
processTestResources {
from(writeDetektVersionProperties)
}
}

View File

@@ -1 +0,0 @@
detektVersion=@detektVersion@

View File

@@ -1 +0,0 @@
detektVersion=@detektVersion@