mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-27 00:38:11 -07:00
Cleaner version computation.
This commit is contained in:
parent
427f9cafa4
commit
33d5afd6c3
1 changed files with 6 additions and 6 deletions
|
@ -169,13 +169,13 @@ val kobaltApp = project(kobaltPluginApi, wrapper) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun readVersion() : String {
|
fun readVersion() : String {
|
||||||
val p = java.util.Properties()
|
val localFile =
|
||||||
var localFile = java.io.File("src/main/resources/kobalt.properties")
|
listOf("src/main/resources/kobalt.properties",
|
||||||
if (! localFile.exists()) {
|
homeDir("kotlin", "kobalt", "src/main/resources/kobalt.properties")).first { File(it).exists() }
|
||||||
localFile = File(homeDir("kotlin", "kobalt", "src/main/resources/kobalt.properties"))
|
with(java.util.Properties()) {
|
||||||
|
load(java.io.FileReader(localFile))
|
||||||
|
return getProperty("kobalt.version")
|
||||||
}
|
}
|
||||||
p.load(java.io.FileReader(localFile))
|
|
||||||
return p.getProperty("kobalt.version")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Task(name = "copyVersionForWrapper", runBefore = arrayOf("assemble"), runAfter = arrayOf("compile"), description = "")
|
@Task(name = "copyVersionForWrapper", runBefore = arrayOf("assemble"), runAfter = arrayOf("compile"), description = "")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue