fix(api): native loading by stopping creating tmpDir every time (#197)
* [API] Stop creating tmpDir every time * [API] Add a whitespace after catch * [API] Fix getting imgui-java version * [API] Add final to properties variable * [API] Make it brief to generate properties * [API] Fix the path of imgui-java.properties * [API] Change the order of loading native library 1.imgui.library.path 2.java.library.path 3.extract from resources * [API] Remove debugging codes * [API] Move extraction code before it is loaded
This commit is contained in:
1 parent
f9a152d49f
commit
c46830a3b7
2 files changed
+59
-12
No files matched your search
@@ -34,3 +34,19 @@ jar {
|
||||
attributes 'Automatic-Module-Name': 'imgui.binding'
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
Reference in new issue
Block a user