]> nmode's Git Repositories - signal-cli/blob - build.gradle
Update libsignal
[signal-cli] / build.gradle
1 apply plugin: 'java'
2 apply plugin: 'application'
3 apply plugin: 'eclipse'
4
5 sourceCompatibility = JavaVersion.VERSION_11
6 targetCompatibility = JavaVersion.VERSION_11
7
8 mainClassName = 'org.asamk.signal.Main'
9
10 version = '0.7.4'
11
12 compileJava.options.encoding = 'UTF-8'
13
14 repositories {
15 mavenLocal()
16 mavenCentral()
17 }
18
19 dependencies {
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'
25 }
26
27 jar {
28 manifest {
29 attributes(
30 'Implementation-Title': project.name,
31 'Implementation-Version': project.version,
32 'Main-Class': project.mainClassName,
33 )
34 }
35 }
36
37 run {
38 if (project.hasProperty("appArgs")) {
39 // allow passing command-line arguments to the main application e.g.:
40 // $ gradle run -PappArgs="['-u', '+...', 'daemon', '--json']"
41 args Eval.me(appArgs)
42 }
43 }
44
45 // Find any 3rd party libraries which have released new versions
46 // to the central Maven repo since we last upgraded.
47 task checkLibVersions {
48 doLast {
49 def checked = [:]
50 allprojects {
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"
59 try {
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\"}"
64 }
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"
69 }
70 checked[dependency] = true
71 }
72 }
73 }
74 }
75 }
76 }
77
78 task buildNativeBinary {
79 dependsOn("build")
80 doLast {
81 def graalVMHome = System.getenv("GRAALVM_HOME")
82 if (!graalVMHome) {
83 throw new GradleException('Required GRAALVM_HOME environment variable not set.')
84 }
85 def nativeBinaryOutputPath = "$buildDir/native-image"
86 def nativeBinaryName = "signal-cli"
87
88 mkdir nativeBinaryOutputPath
89
90 exec {
91 workingDir "."
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=",
99 "--no-fallback",
100 "--allow-incomplete-classpath",
101 "--report-unsupported-elements-at-runtime",
102 "--enable-url-protocols=http,https",
103 "--enable-https",
104 "--enable-all-security-services",
105 "-H:ResourceConfigurationFiles=graalvm-config-dir/resource-config.json",
106 "-H:ReflectionConfigurationFiles=graalvm-config-dir/reflect-config.json",
107 "-cp",
108 sourceSets.main.runtimeClasspath.asPath,
109 project.mainClassName
110 }
111 }
112 }