diff --git a/build.gradle.kts b/build.gradle.kts index faa7fa6..8ff7c50 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,9 +7,11 @@ repositories { mavenLocal() } +val graalVersion = "1.0.0-rc10" + dependencies { compile("org.apache.httpcomponents:httpclient:4.5.2") - compileOnly("com.oracle.substratevm:svm:GraalVM-1.0.0-rc8") + compileOnly("com.oracle.substratevm:svm:GraalVM-$graalVersion") } tasks { @@ -29,7 +31,8 @@ tasks { commandLine("docker", "run", "--rm", "--volume", "${projectDir.absolutePath}:${projectDir.absolutePath}", "--workdir", projectDir.absolutePath, - "ubuntu:latest", "./run.sh") + "oracle/graalvm-ce:$graalVersion", + "./run.sh", graalVersion) } withType { gradleVersion = "4.8" diff --git a/run.sh b/run.sh index 881abb3..9229e29 100755 --- a/run.sh +++ b/run.sh @@ -1,13 +1,8 @@ #!/usr/bin/env bash -GRAAL_VERSION=1.0.0-rc8 -WORK_DIR=$(pwd) -apt-get update && apt-get install -y build-essential zlib1g-dev curl maven -cd /opt -curl -L https://github.com/oracle/graal/releases/download/vm-${GRAAL_VERSION}/graalvm-ce-${GRAAL_VERSION}-linux-amd64.tar.gz | tar -xz +GRAAL_VERSION=$1 +yum install -y build-essential zlib1g-dev maven ln -sf /opt/graalvm-ce-${GRAAL_VERSION} /opt/graal -PATH=$PATH:/opt/graal/bin mvn install:install-file -Dfile=/opt/graal/jre/lib/svm/builder/svm.jar -DgroupId=com.oracle.substratevm -DartifactId=svm -Dversion=GraalVM-${GRAAL_VERSION} -Dpackaging=jar -cd ${WORK_DIR} export JAVA_HOME=/opt/graal ./gradlew jar cp /opt/graal/jre/lib/amd64/libsunec.so $(pwd) @@ -16,4 +11,4 @@ native-image -jar build/libs/graal-vs-apache-httpclient.jar \ --report-unsupported-elements-at-runtime --no-server \ -H:+JNI -H:+UseServiceLoaderFeature chmod +x graal-vs-apache-httpclient -./graal-vs-apache-httpclient \ No newline at end of file +./graal-vs-apache-httpclient -Djavax.net.ssl.trustStore=/opt/graal/jre/lib/security/cacerts -Djavax.net.ssl.trustStorePassword=changeit \ No newline at end of file