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.8.1")
27 implementation("com.github.hypfvieh:dbus-java:3.2.4")
28 implementation("org.slf4j:slf4j-simple:1.7.30")
29 implementation(project(":lib"))
34 resolutionStrategy.failOnVersionConflict()
38 tasks.withType<JavaCompile> {
39 options.encoding = "UTF-8"
45 "Implementation-Title" to project.name,
46 "Implementation-Version" to project.version,
47 "Main-Class" to application.mainClass.get()
52 tasks.withType<JavaExec> {
53 val appArgs: String? by project
54 if (appArgs != null) {
55 // allow passing command-line arguments to the main application e.g.:
56 // $ gradle run -PappArgs="['-u', '+...', 'daemon', '--json']"
57 args = groovy.util.Eval.me(appArgs) as MutableList<String>
61 val assembleNativeImage by tasks.registering {
66 graalVMHome = System.getenv("GRAALVM_HOME")
67 ?: throw GradleException("Required GRAALVM_HOME environment variable not set.")
71 val nativeBinaryOutputPath = "$buildDir/native-image"
72 val nativeBinaryName = "signal-cli"
74 mkdir(nativeBinaryOutputPath)
77 workingDir = File(".")
78 commandLine("$graalVMHome/bin/native-image",
79 "-H:Path=$nativeBinaryOutputPath",
80 "-H:Name=$nativeBinaryName",
81 "-H:JNIConfigurationFiles=graalvm-config-dir/jni-config.json",
82 "-H:DynamicProxyConfigurationFiles=graalvm-config-dir/proxy-config.json",
83 "-H:ResourceConfigurationFiles=graalvm-config-dir/resource-config.json",
84 "-H:ReflectionConfigurationFiles=graalvm-config-dir/reflect-config.json",
86 "--allow-incomplete-classpath",
87 "--report-unsupported-elements-at-runtime",
88 "--enable-url-protocols=http,https",
90 "--enable-all-security-services",
92 sourceSets.main.get().runtimeClasspath.asPath,
93 application.mainClass.get())