mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-28 18:10:38 +00:00
97 lines
2.4 KiB
Kotlin
97 lines
2.4 KiB
Kotlin
plugins {
|
|
java
|
|
application
|
|
eclipse
|
|
`check-lib-versions`
|
|
id("org.graalvm.buildtools.native") version "0.10.4"
|
|
}
|
|
|
|
version = "0.13.11"
|
|
|
|
java {
|
|
sourceCompatibility = JavaVersion.VERSION_21
|
|
targetCompatibility = JavaVersion.VERSION_21
|
|
|
|
if (!JavaVersion.current().isCompatibleWith(targetCompatibility)) {
|
|
toolchain {
|
|
languageVersion.set(JavaLanguageVersion.of(targetCompatibility.majorVersion))
|
|
}
|
|
}
|
|
}
|
|
|
|
application {
|
|
mainClass.set("org.asamk.signal.Main")
|
|
}
|
|
|
|
graalvmNative {
|
|
binaries {
|
|
this["main"].run {
|
|
buildArgs.add("--install-exit-handlers")
|
|
buildArgs.add("-Dfile.encoding=UTF-8")
|
|
buildArgs.add("-J-Dfile.encoding=UTF-8")
|
|
resources.autodetect()
|
|
configurationFileDirectories.from(file("graalvm-config-dir"))
|
|
if (System.getenv("GRAALVM_HOME") == null) {
|
|
toolchainDetection.set(true)
|
|
javaLauncher.set(javaToolchains.launcherFor {
|
|
languageVersion.set(JavaLanguageVersion.of(21))
|
|
})
|
|
} else {
|
|
toolchainDetection.set(false)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation(libs.bouncycastle)
|
|
implementation(libs.jackson.databind)
|
|
implementation(libs.argparse4j)
|
|
implementation(libs.dbusjava)
|
|
implementation(libs.slf4j.api)
|
|
implementation(libs.slf4j.jul)
|
|
implementation(libs.logback)
|
|
implementation(project(":lib"))
|
|
}
|
|
|
|
configurations {
|
|
implementation {
|
|
resolutionStrategy.failOnVersionConflict()
|
|
}
|
|
}
|
|
|
|
|
|
tasks.withType<AbstractArchiveTask>().configureEach {
|
|
isPreserveFileTimestamps = false
|
|
isReproducibleFileOrder = true
|
|
}
|
|
|
|
tasks.withType<JavaCompile> {
|
|
options.encoding = "UTF-8"
|
|
}
|
|
|
|
tasks.withType<Jar> {
|
|
manifest {
|
|
attributes(
|
|
"Implementation-Title" to project.name,
|
|
"Implementation-Version" to project.version,
|
|
"Main-Class" to application.mainClass.get()
|
|
)
|
|
}
|
|
}
|
|
|
|
task("fatJar", type = Jar::class) {
|
|
archiveBaseName.set("${project.name}-fat")
|
|
exclude(
|
|
"META-INF/*.SF",
|
|
"META-INF/*.DSA",
|
|
"META-INF/*.RSA",
|
|
"META-INF/NOTICE*",
|
|
"META-INF/LICENSE*",
|
|
"META-INF/INDEX.LIST",
|
|
"**/module-info.class"
|
|
)
|
|
duplicatesStrategy = DuplicatesStrategy.WARN
|
|
from(configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) })
|
|
with(tasks.jar.get())
|
|
}
|