Skip to content

Commit

Permalink
Add more config generated by agent
Browse files Browse the repository at this point in the history
  • Loading branch information
AsamK committed Jan 23, 2021
1 parent de3b077 commit b4311c7
Show file tree
Hide file tree
Showing 5 changed files with 488 additions and 29 deletions.
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,18 @@ dependencies. If you have a recent gradle version installed, you can replace `./

./gradlew distTar

### Building a native binary with GraalVM
### Building a native binary with GraalVM (EXPERIMENTAL)

It is possible to build a native binary with [GraalVM](https://www.graalvm.org).
This is still experimental and will not work in all situations.

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:
3. Execute Gradle:

./gradle nativeImage
./gradlew assembleNativeImage

The binary is available at

build/native-image/signal-cli
The binary is available at *build/native-image/signal-cli*

## 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.
Expand Down
14 changes: 6 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ task checkLibVersions {
}
}

task buildNativeBinary {
dependsOn("build")
task assembleNativeImage {
dependsOn("assemble")
doLast {
def graalVMHome = System.getenv("GRAALVM_HOME")
if (!graalVMHome) {
Expand All @@ -92,18 +92,16 @@ task buildNativeBinary {
commandLine "$graalVMHome/bin/native-image",
"-H:Path=$nativeBinaryOutputPath",
"-H:Name=$nativeBinaryName",
"-H:JNIConfigurationFiles=",
"-H:DynamicProxyConfigurationFiles=",
"-H:ReflectionConfigurationFiles=",
"-H:ResourceConfigurationFiles=",
"-H:JNIConfigurationFiles=graalvm-config-dir/jni-config.json",
"-H:DynamicProxyConfigurationFiles=graalvm-config-dir/proxy-config.json",
"-H:ResourceConfigurationFiles=graalvm-config-dir/resource-config.json",
"-H:ReflectionConfigurationFiles=graalvm-config-dir/reflect-config.json",
"--no-fallback",
"--allow-incomplete-classpath",
"--report-unsupported-elements-at-runtime",
"--enable-url-protocols=http,https",
"--enable-https",
"--enable-all-security-services",
"-H:ResourceConfigurationFiles=graalvm-config-dir/resource-config.json",
"-H:ReflectionConfigurationFiles=graalvm-config-dir/reflect-config.json",
"-cp",
sourceSets.main.runtimeClasspath.asPath,
project.mainClassName
Expand Down
13 changes: 13 additions & 0 deletions graalvm-config-dir/jni-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"name":"java.lang.ClassLoader",
"methods":[{"name":"getPlatformClassLoader","parameterTypes":[] }]
},
{
"name":"java.lang.NoSuchMethodError"
},
{
"name":"java.lang.UnsatisfiedLinkError",
"methods":[{"name":"<init>","parameterTypes":["java.lang.String"] }]
}
]
3 changes: 3 additions & 0 deletions graalvm-config-dir/proxy-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[
["org.freedesktop.DBus"]
]
Loading

0 comments on commit b4311c7

Please sign in to comment.