ruapu/java/build.gradle.kts
Justin Fung 5baa49677c
Ruapu Java binding (#82)
* Fix rua on macOS

Signed-off-by: Molly Sophia <mollysophia379@gmail.com>

* Release allocate resource

* Formatting

* feat: package native lib into jar;

Signed-off-by: LinHeLurking <LinHe.Lurking@gmail.com>

* fix: multiple platform gradle build;

Signed-off-by: LinHeLurking <LinHe.Lurking@gmail.com>

* fix: linux build;

Signed-off-by: LinHe <LinHe.Lurking@gmail.com>

* Update command to use windows cmd


---------

Signed-off-by: Molly Sophia <mollysophia379@gmail.com>
Signed-off-by: LinHeLurking <LinHe.Lurking@gmail.com>
Signed-off-by: LinHe <LinHe.Lurking@gmail.com>
Co-authored-by: cenkang <cenkang@apical.com.cn>
Co-authored-by: Molly Sophia <mollysophia379@gmail.com>
Co-authored-by: LinHeLurking <LinHe.Lurking@gmail.com>
2024-03-11 22:54:06 +08:00

49 lines
983 B
Plaintext

plugins {
id("java")
}
group = "ruapu"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
}
dependencies {
testImplementation(platform("org.junit:junit-bom:5.9.1"))
testImplementation("org.junit.jupiter:junit-jupiter")
}
tasks.test {
useJUnitPlatform()
}
val host: String = System.getProperty("os.name")!!
tasks.register("buildJNI") {
doLast {
val shell = when {
host.startsWith("Windows") -> "cmd"
else -> "bash"
}
val command = when {
host.startsWith("Windows") -> "/c"
else -> "-c"
}
val script = when {
host.startsWith("Windows") -> "build.bat"
else -> "./build.sh"
}
exec {
commandLine(shell, command, script)
}
}
}
// copy cmake build library to java resources
tasks.jar {
dependsOn("buildJNI")
from("build/cmake/install/ruapu") {
include("*.dll", "*.so", "*.dylib")
}
}