* [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
53 lines
1.2 KiB
Groovy
53 lines
1.2 KiB
Groovy
import tool.generator.GenerateLibs
|
|
|
|
plugins {
|
|
id 'java'
|
|
id 'checkstyle'
|
|
id 'maven-publish'
|
|
id 'signing'
|
|
}
|
|
|
|
java {
|
|
toolchain {
|
|
languageVersion.set(JavaLanguageVersion.of(8))
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.3'
|
|
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.9.3'
|
|
}
|
|
|
|
test {
|
|
useJUnitPlatform()
|
|
}
|
|
|
|
tasks.register('generateLibs', GenerateLibs) {
|
|
it.dependsOn assemble
|
|
}
|
|
|
|
apply from: "$rootDir/publish.gradle"
|
|
configurePublishing('imgui-java-binding', 'JNI based binding for Dear ImGui', project.version)
|
|
|
|
jar {
|
|
manifest {
|
|
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
|
|
}
|