mirror of
https://github.com/AsamK/signal-cli
synced 2025-09-02 04:20:38 +00:00
moved from gradle graalvm-native-image plugin to native-build.sh
This commit is contained in:
parent
98ca1eeb9a
commit
cdf829c75e
2 changed files with 42 additions and 21 deletions
30
build.gradle
30
build.gradle
|
@ -1,9 +1,6 @@
|
|||
plugins {
|
||||
id 'java'
|
||||
id 'application'
|
||||
id 'eclipse'
|
||||
id 'org.mikeneck.graalvm-native-image' version '1.1.0'
|
||||
}
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'application'
|
||||
apply plugin: 'eclipse'
|
||||
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
targetCompatibility = JavaVersion.VERSION_11
|
||||
|
@ -27,21 +24,6 @@ dependencies {
|
|||
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",
|
||||
"-H:ResourceConfigurationFiles=graalvm-config-dir/resource-config.json",
|
||||
"-H:ReflectionConfigurationFiles=graalvm-config-dir/reflect-config.json"
|
||||
)
|
||||
}
|
||||
|
||||
jar {
|
||||
manifest {
|
||||
attributes(
|
||||
|
@ -92,3 +74,9 @@ task checkLibVersions {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
task printRuntimeClasspath {
|
||||
doLast {
|
||||
print sourceSets.main.runtimeClasspath.asPath
|
||||
}
|
||||
}
|
||||
|
|
33
native-build.sh
Executable file
33
native-build.sh
Executable file
|
@ -0,0 +1,33 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ -z "$GRAALVM_HOME" ]; then
|
||||
echo "The GRAALVM_HOME environment variable is required.\n\n e.g. export GRAALVM_HOME=../graalvm-ce-java11-21.0.0/\n" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
export JAVA_HOME=$GRAALVM_HOME
|
||||
|
||||
./gradlew clean build
|
||||
|
||||
RUNTIME_CLASSPATH=$(./gradlew -q printRuntimeClasspath)
|
||||
|
||||
mkdir -p build/native-image
|
||||
|
||||
echo Compiling native-image...
|
||||
$GRAALVM_HOME/bin/native-image \
|
||||
-cp "$RUNTIME_CLASSPATH"\
|
||||
-H:Path=build/native-image\
|
||||
-H:Name=signal-cli\
|
||||
-H:JNIConfigurationFiles=\
|
||||
-H:DynamicProxyConfigurationFiles=\
|
||||
-H:ReflectionConfigurationFiles=\
|
||||
-H:ResourceConfigurationFiles=\
|
||||
--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\
|
||||
org.asamk.signal.Main
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue