mirror of
https://github.com/AsamK/signal-cli
synced 2025-09-02 12:30:39 +00:00
Initial GraalVM configuration
This commit is contained in:
parent
d50db1d671
commit
91bd304f8d
4 changed files with 1439 additions and 3 deletions
14
README.md
14
README.md
|
@ -82,6 +82,20 @@ dependencies. If you have a recent gradle version installed, you can replace `./
|
||||||
|
|
||||||
./gradlew distTar
|
./gradlew distTar
|
||||||
|
|
||||||
|
### Building a native binary with GraalVM
|
||||||
|
|
||||||
|
It is possible to build a native binary with [GraalVM](https://www.graalvm.org).
|
||||||
|
|
||||||
|
1. [Install GraalVM and setup the enviroment](https://www.graalvm.org/docs/getting-started/#install-graalvm)
|
||||||
|
2. [Install prerequisites](https://www.graalvm.org/reference-manual/native-image/#prerequisites)
|
||||||
|
2. Execute Gradle:
|
||||||
|
|
||||||
|
./gradle nativeImage
|
||||||
|
|
||||||
|
The binary is available at
|
||||||
|
|
||||||
|
build/native-image/signal-cli
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
If you use a version of the Oracle JRE and get an InvalidKeyException you need to enable unlimited strength crypto. See https://stackoverflow.com/questions/6481627/java-security-illegal-key-size-or-default-parameters for instructions.
|
If you use a version of the Oracle JRE and get an InvalidKeyException you need to enable unlimited strength crypto. See https://stackoverflow.com/questions/6481627/java-security-illegal-key-size-or-default-parameters for instructions.
|
||||||
|
|
||||||
|
|
30
build.gradle
30
build.gradle
|
@ -1,6 +1,9 @@
|
||||||
apply plugin: 'java'
|
plugins {
|
||||||
apply plugin: 'application'
|
id 'java'
|
||||||
apply plugin: 'eclipse'
|
id 'application'
|
||||||
|
id 'eclipse'
|
||||||
|
id 'org.mikeneck.graalvm-native-image' version 'v1.0.0'
|
||||||
|
}
|
||||||
|
|
||||||
sourceCompatibility = JavaVersion.VERSION_11
|
sourceCompatibility = JavaVersion.VERSION_11
|
||||||
targetCompatibility = JavaVersion.VERSION_11
|
targetCompatibility = JavaVersion.VERSION_11
|
||||||
|
@ -24,6 +27,27 @@ dependencies {
|
||||||
implementation 'org.slf4j:slf4j-simple:1.7.30'
|
implementation 'org.slf4j:slf4j-simple:1.7.30'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nativeImage {
|
||||||
|
mainClass = mainClassName
|
||||||
|
executableName = 'signal-cli'
|
||||||
|
arguments(
|
||||||
|
"--no-fallback",
|
||||||
|
"--allow-incomplete-classpath",
|
||||||
|
"--report-unsupported-elements-at-runtime",
|
||||||
|
"--enable-url-protocols=http,https",
|
||||||
|
"--enable-https",
|
||||||
|
"--enable-all-security-services",
|
||||||
|
"-J-Djavax.net.ssl.trustStore=/root/graalvm-ce-java11-20.3.0/lib/security/cacerts",
|
||||||
|
"-J-Djavax.net.ssl.trustAnchors=/root/graalvm-ce-java11-20.3.0/lib/security/cacerts",
|
||||||
|
"-J-Djavax.net.ssl.trustStorePassword=changeit",
|
||||||
|
"-Djavax.net.ssl.trustStore=/root/graalvm-ce-java11-20.3.0/lib/security/cacerts",
|
||||||
|
"-Djavax.net.ssl.trustAnchors=/root/graalvm-ce-java11-20.3.0/lib/security/cacerts",
|
||||||
|
"-Djavax.net.ssl.trustStorePassword=changeit",
|
||||||
|
"-H:ResourceConfigurationFiles=graalvm-config-dir/resource-config.json",
|
||||||
|
"-H:ReflectionConfigurationFiles=graalvm-config-dir/reflect-config.json"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
manifest {
|
manifest {
|
||||||
attributes(
|
attributes(
|
||||||
|
|
1387
graalvm-config-dir/reflect-config.json
Normal file
1387
graalvm-config-dir/reflect-config.json
Normal file
File diff suppressed because it is too large
Load diff
11
graalvm-config-dir/resource-config.json
Normal file
11
graalvm-config-dir/resource-config.json
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"resources":{
|
||||||
|
"includes":[
|
||||||
|
{"pattern":"com/google/i18n/phonenumbers/data/.*"},
|
||||||
|
{"pattern":"libzkgroup.so"},
|
||||||
|
{"pattern":"org/asamk/signal/manager/ias.store"},
|
||||||
|
{"pattern":"org/asamk/signal/manager/whisper.store"},
|
||||||
|
{"pattern":"org/slf4j/impl/StaticLoggerBinder.class"}
|
||||||
|
]},
|
||||||
|
"bundles":[{"name":"net.sourceforge.argparse4j.internal.ArgumentParserImpl"}]
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue