tweak(api): simplify version get from imgui-java.properties file (#204)
Instead of generating `properties` file we make it always. To provide version value we replace specific token. Also, small tweaks in code which gets the version
This commit is contained in:
1 parent
3f2532a478
commit
49fffaf02d
3 files changed
+12
-20
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import org.apache.tools.ant.filters.ReplaceTokens
|
||||
import tool.generator.GenerateLibs
|
||||
|
||||
plugins {
|
||||
@@ -35,18 +36,10 @@ jar {
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register('makePropertyResource') {
|
||||
def directory = file "${buildDir}/resources/main/imgui/"
|
||||
directory.mkdirs()
|
||||
def propertyFile = file "${directory}/imgui-java.properties"
|
||||
def props = new Properties()
|
||||
if (propertyFile.exists()) {
|
||||
propertyFile.withReader { props.load(it) }
|
||||
}
|
||||
props.setProperty("version", project.version)
|
||||
propertyFile.withWriter { props.store(it, "imgui-java") }
|
||||
}
|
||||
|
||||
processResources {
|
||||
dependsOn makePropertyResource
|
||||
filesMatching('**/imgui-java.properties') {
|
||||
filter(ReplaceTokens, tokens: [
|
||||
'version': project.version
|
||||
])
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user