diff --git a/README.md b/README.md index e12bb08..96898af 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@
diff --git a/fantom/Dockerfile b/fantom/Dockerfile new file mode 100644 index 0000000..8616544 --- /dev/null +++ b/fantom/Dockerfile @@ -0,0 +1,16 @@ +# syntax=docker/dockerfile:1 +# escape=\ +FROM 100hellos/000-base:local + +RUN sudo \ + apk add --no-cache \ + bash zip openjdk8 + +ENV JAVA_HOME=/usr/lib/jvm/java-1.8-openjdk + +COPY --chown=human:human ./artifacts /artifacts +RUN cd /artifacts && make install + +ENV PATH="/artifacts/fan/bin:${PATH}" + +COPY --chown=human:human ./files /hello-world diff --git a/fantom/Makefile b/fantom/Makefile new file mode 100644 index 0000000..56b9235 --- /dev/null +++ b/fantom/Makefile @@ -0,0 +1 @@ +include ../Makefile.language-container.mk \ No newline at end of file diff --git a/fantom/artifacts/Makefile b/fantom/artifacts/Makefile new file mode 100644 index 0000000..1ae90bf --- /dev/null +++ b/fantom/artifacts/Makefile @@ -0,0 +1,19 @@ +PREFIX ?= /usr/local + +.PHONY: install + +# This is the only necessary target in the Makefile +# and it's expected to place the language interpretter +# or compiler in the path. +install: + curl -o fantom.zip -L https://github.com/fantom-lang/fantom/releases/download/v1.0.80/fantom-1.0.80.zip + unzip fantom.zip -d fantom + mv fantom/fantom-1.0.80 rel + chmod +x rel/bin/* + rm -rf fantom && rm -f fantom.zip + echo -e "\n\njdkHome=$$JAVA_HOME/\ndevHome=/artifacts/fan/\n" >> rel/etc/build/config.props + git clone --depth=1 https://github.com/fantom-lang/fantom fan + echo -e "\n\njdkHome=$$JAVA_HOME/" >> fan/etc/build/config.props + rel/bin/fan fan/src/buildall.fan superclean + rel/bin/fan fan/src/buildboot.fan compile + fan/bin/fan fan/src/buildpods.fan compile diff --git a/fantom/files/hello-world.fan b/fantom/files/hello-world.fan new file mode 100644 index 0000000..bf75c44 --- /dev/null +++ b/fantom/files/hello-world.fan @@ -0,0 +1,12 @@ +#!/usr/bin/env fan +using [java] java.lang + +class HelloWorld +{ + + Void main() + { + System.out.println("Hello World!") + } + +} \ No newline at end of file