Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
DmPanov committed Jan 9, 2019
1 parent 07ea5ca commit 553be40
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
7 changes: 5 additions & 2 deletions build.gradle.kts
Expand Up @@ -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 {
Expand All @@ -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<Wrapper> {
gradleVersion = "4.8"
Expand Down
11 changes: 3 additions & 8 deletions 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)
Expand All @@ -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
./graal-vs-apache-httpclient -Djavax.net.ssl.trustStore=/opt/graal/jre/lib/security/cacerts -Djavax.net.ssl.trustStorePassword=changeit

0 comments on commit 553be40

Please sign in to comment.