Fix for slow startup time on GraalVM 20 (#288)

This commit is contained in:
Michiel Borkent 2020-03-06 16:55:52 +01:00 committed by GitHub
parent 0b23dd0fdb
commit 5723206ca2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 0 deletions

View file

@ -0,0 +1,19 @@
import org.graalvm.nativeimage.Platform;
import org.graalvm.nativeimage.Platforms;
import com.oracle.svm.core.annotate.TargetClass;
import com.oracle.svm.core.annotate.Delete;
public final class CutOffCoreServicesDependencies {
}
// @Platforms(Platform.DARWIN.class)
// @TargetClass(className = "sun.net.spi.DefaultProxySelector")
// @Delete
// final class Target_sun_net_spi_DefaultProxySelector {
// }
@Platforms(Platform.DARWIN.class)
@TargetClass(className = "apple.security.KeychainStore")
@Delete
final class Target_apple_security_KeychainStore {
}

View file

@ -17,6 +17,8 @@ BABASHKA_VERSION=$(cat resources/BABASHKA_VERSION)
export JAVA_HOME=$GRAALVM_HOME
$GRAALVM_HOME/bin/javac -cp $GRAALVM_HOME/jre/lib/svm/builder/svm.jar resources/CutOffCoreServicesDependencies.java
lein with-profiles +reflection do run
lein do clean, uberjar
@ -37,6 +39,7 @@ args=( -jar target/babashka-$BABASHKA_VERSION-standalone.jar \
--verbose \
--no-fallback \
--no-server \
--report-unsupported-elements-at-runtime \
"$BABASHKA_XMX" )
if [ "$BABASHKA_STATIC" = "true" ]; then