11 sourceCompatibility = JavaVersion.VERSION_11
12 targetCompatibility = JavaVersion.VERSION_11
16 mainClass.set("org.asamk.signal.Main")
25 implementation("org.bouncycastle:bcprov-jdk15on:1.68")
26 implementation("net.sourceforge.argparse4j:argparse4j:0.9.0")
27 implementation("com.github.hypfvieh:dbus-java:3.3.0")
28 implementation("org.slf4j:slf4j-simple:1.7.30")
29 implementation(project(":lib"))
34 resolutionStrategy.failOnVersionConflict()
39 tasks.withType<AbstractArchiveTask>().configureEach {
40 isPreserveFileTimestamps = false
41 isReproducibleFileOrder = true
44 tasks.withType<JavaCompile> {
45 options.encoding = "UTF-8"
51 "Implementation-Title" to project.name,
52 "Implementation-Version" to project.version,
53 "Main-Class" to application.mainClass.get()
58 tasks.withType<JavaExec> {
59 val appArgs: String? by project
60 if (appArgs != null) {
61 // allow passing command-line arguments to the main application e.g.:
62 // $ gradle run -PappArgs="['-u', '+...', 'daemon', '--json']"
63 args = groovy.util.Eval.me(appArgs) as MutableList<String>
67 val assembleNativeImage by tasks.registering {
72 graalVMHome = System.getenv("GRAALVM_HOME")
73 ?: throw GradleException("Required GRAALVM_HOME environment variable not set.")
77 val nativeBinaryOutputPath = "$buildDir/native-image"
78 val nativeBinaryName = "signal-cli"
80 mkdir(nativeBinaryOutputPath)
83 workingDir = File(".")
84 commandLine("$graalVMHome/bin/native-image",
85 "-H:Path=$nativeBinaryOutputPath",
86 "-H:Name=$nativeBinaryName",
87 "-H:JNIConfigurationFiles=graalvm-config-dir/jni-config.json",
88 "-H:DynamicProxyConfigurationFiles=graalvm-config-dir/proxy-config.json",
89 "-H:ResourceConfigurationFiles=graalvm-config-dir/resource-config.json",
90 "-H:ReflectionConfigurationFiles=graalvm-config-dir/reflect-config.json",
92 "--allow-incomplete-classpath",
93 "--report-unsupported-elements-at-runtime",
94 "--enable-url-protocols=http,https",
96 "--enable-all-security-services",
98 sourceSets.main.get().runtimeClasspath.asPath,
99 application.mainClass.get())