2 apply plugin: 'application'
3 apply plugin: 'eclipse'
5 sourceCompatibility = JavaVersion.VERSION_11
6 targetCompatibility = JavaVersion.VERSION_11
8 mainClassName = 'org.asamk.signal.Main'
12 compileJava.options.encoding = 'UTF-8'
20 implementation 'com.github.turasa:signal-service-java:2.15.3_unofficial_17'
21 implementation 'org.bouncycastle:bcprov-jdk15on:1.68'
22 implementation 'net.sourceforge.argparse4j:argparse4j:0.8.1'
23 implementation 'com.github.hypfvieh:dbus-java:3.2.4'
24 implementation 'org.slf4j:slf4j-simple:1.7.30'
30 'Implementation-Title': project.name,
31 'Implementation-Version': project.version,
32 'Main-Class': project.mainClassName,
38 if (project.hasProperty("appArgs")) {
39 // allow passing command-line arguments to the main application e.g.:
40 // $ gradle run -PappArgs="['-u', '+...', 'daemon', '--json']"
45 // Find any 3rd party libraries which have released new versions
46 // to the central Maven repo since we last upgraded.
47 task checkLibVersions {
51 configurations.each { configuration ->
52 configuration.allDependencies.each { dependency ->
53 def version = dependency.version
54 if (!checked[dependency]) {
55 def group = dependency.group
56 def path = group.replace('.', '/')
57 def name = dependency.name
58 def url = "https://repo1.maven.org/maven2/$path/$name/maven-metadata.xml"
60 def metadata = new XmlSlurper().parseText(url.toURL().text)
61 def newest = metadata.versioning.latest;
62 if ("$version" != "$newest") {
63 println "UPGRADE {\"group\": \"$group\", \"name\": \"$name\", \"current\": \"$version\", \"latest\": \"$newest\"}"
65 } catch (FileNotFoundException e) {
66 logger.debug "Unable to download $url: $e.message"
67 } catch (org.xml.sax.SAXParseException e) {
68 logger.debug "Unable to parse $url: $e.message"
70 checked[dependency] = true
78 task buildNativeBinary {
81 def graalVMHome = System.getenv("GRAALVM_HOME")
83 throw new GradleException('Required GRAALVM_HOME environment variable not set.')
85 def nativeBinaryOutputPath = "$buildDir/native-image"
86 def nativeBinaryName = "signal-cli"
88 mkdir nativeBinaryOutputPath
92 commandLine "$graalVMHome/bin/native-image",
93 "-H:Path=$nativeBinaryOutputPath",
94 "-H:Name=$nativeBinaryName",
95 "-H:JNIConfigurationFiles=",
96 "-H:DynamicProxyConfigurationFiles=",
97 "-H:ReflectionConfigurationFiles=",
98 "-H:ResourceConfigurationFiles=",
100 "--allow-incomplete-classpath",
101 "--report-unsupported-elements-at-runtime",
102 "--enable-url-protocols=http,https",
104 "--enable-all-security-services",
105 "-H:ResourceConfigurationFiles=graalvm-config-dir/resource-config.json",
106 "-H:ReflectionConfigurationFiles=graalvm-config-dir/reflect-config.json",
108 sourceSets.main.runtimeClasspath.asPath,
109 project.mainClassName