Skip to content

Commit

Permalink
Native image capabilities.
Browse files Browse the repository at this point in the history
  • Loading branch information
boris-spas committed Jul 13, 2018
1 parent e97f6d2 commit abac873
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ graalvm/
/Coco.jar
component/sl-component.jar
language/dependency-reduced-pom.xml
native/slnative
7 changes: 7 additions & 0 deletions native/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# The simple language native image

Truffle language implementations can be AOT compiled using the GraalVM
[native-image](https://www.graalvm.org/docs/reference-manual/aot-compilation/)
tool. Running `mvn package` in the simplelanguage folder also builds a
`slnative` executable This executable is the full Simple Language
implementation as a native application, and has no need for a JVM to run.
3 changes: 3 additions & 0 deletions native/clean_native.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

[ -f slnative ] && rm slnative || echo "slnative not found."
5 changes: 5 additions & 0 deletions native/make_native.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
$JAVA_HOME/bin/native-image --tool:truffle -H:MaxRuntimeCompileMethods=1200 \
-cp ../language/target/simplelanguage.jar:../launcher/target/launcher-1.0.0-rc3-SNAPSHOT.jar \
com.oracle.truffle.sl.launcher.SLMain \
slnative
42 changes: 42 additions & 0 deletions native/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.oracle</groupId>
<artifactId>simplelanguage-graalvm-native</artifactId>
<version>1.0.0-rc3-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<m2e.apt.activation>jdt_apt</m2e.apt.activation>
</properties>
<packaging>pom</packaging>
<build>
<plugins>
<plugin>
<artifactId>exec-maven-plugin</artifactId>
<groupId>org.codehaus.mojo</groupId>
<executions>
<execution>
<id>make_native</id>
<phase>package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>${basedir}/make_native.sh</executable>
</configuration>
</execution>
<execution>
<id>clean_native</id>
<phase>clean</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>${basedir}/clean_native.sh</executable>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
<module>language</module>
<module>launcher</module>
<module>component</module>
<module>native</module>
</modules>
</project>

0 comments on commit abac873

Please sign in to comment.