aboutsummaryrefslogtreecommitdiff
path: root/docker/ant
diff options
context:
space:
mode:
authorRoel Spilker <r.spilker@gmail.com>2017-11-28 23:37:34 +0100
committerRoel Spilker <r.spilker@gmail.com>2017-11-28 23:37:34 +0100
commit1f7b8c3d2c5dc1afc59faaedee94abeefcffec3c (patch)
tree09edd97918d9197056757fba67a712b6b5acc284 /docker/ant
parent192ce9bc16e7d49533ba6ce12fc570c2bcfab550 (diff)
downloadlombok-1f7b8c3d2c5dc1afc59faaedee94abeefcffec3c.tar.gz
lombok-1f7b8c3d2c5dc1afc59faaedee94abeefcffec3c.tar.bz2
lombok-1f7b8c3d2c5dc1afc59faaedee94abeefcffec3c.zip
add ant Dockerfile, use jdk major version numbers instead
Diffstat (limited to 'docker/ant')
-rw-r--r--docker/ant/Dockerfile33
-rw-r--r--docker/ant/files/jdk-8/build.xml25
-rw-r--r--docker/ant/files/jdk-9/build.xml35
-rw-r--r--docker/ant/readme.md33
4 files changed, 126 insertions, 0 deletions
diff --git a/docker/ant/Dockerfile b/docker/ant/Dockerfile
new file mode 100644
index 00000000..32457709
--- /dev/null
+++ b/docker/ant/Dockerfile
@@ -0,0 +1,33 @@
+FROM ubuntu:16.04 as downloader
+
+ARG jdk=9
+ADD provision/jdk/java-${jdk}.sh provision/jdk/java-${jdk}.sh
+RUN provision/jdk/java-${jdk}.sh
+
+ARG ant=1.10.1
+ADD provision/ant/ant-${ant}.sh provision/ant/ant-${ant}.sh
+RUN provision/ant/ant-${ant}.sh
+
+FROM ubuntu:16.04
+
+COPY --from=downloader /usr/local/apache-ant/ /usr/local/apache-ant/
+COPY --from=downloader /opt/jdk/ /opt/jdk/
+
+RUN update-alternatives --install /usr/bin/java java /opt/jdk/bin/java 1000 && update-alternatives --install /usr/bin/javac javac /opt/jdk/bin/javac 1000 && update-alternatives --install /usr/bin/javadoc javadoc /opt/jdk/bin/javadoc 1000 && update-alternatives --install /usr/bin/javap javap /opt/jdk/bin/javap 1000
+
+WORKDIR workspace
+
+ADD shared/ ./
+
+ARG jdk=9
+ADD ant/files/jdk-${jdk} ./
+
+ARG lombokjar=lombok.jar
+ADD https://projectlombok.org/downloads/${lombokjar} lombok.jar
+
+ENV JDK_VERSION=${jdk}
+ENV JAVA_HOME=/opt/jdk
+ENV ANT_HOME=/usr/local/apache-ant/apache-ant
+ENV PATH="${JAVA_HOME}/bin:${ANT_HOME}/bin:${PATH}"
+
+ENTRYPOINT bash
diff --git a/docker/ant/files/jdk-8/build.xml b/docker/ant/files/jdk-8/build.xml
new file mode 100644
index 00000000..2fc38879
--- /dev/null
+++ b/docker/ant/files/jdk-8/build.xml
@@ -0,0 +1,25 @@
+<project name="example" default="dist" basedir=".">
+ <property name="src" location="src/main/java"/>
+ <property name="build" location="build"/>
+ <property name="dist" location="dist"/>
+ <property name="build.sysclasspath" value="ignore"/>
+
+ <target name="init">
+ <tstamp/>
+ <mkdir dir="${build}"/>
+ </target>
+
+ <target name="compile" depends="init" description="compile the source">
+ <javac classpath="lombok.jar" srcdir="${src}" destdir="${build}" fork="true"/>
+ </target>
+
+ <target name="dist" depends="compile" description="generate the distribution">
+ <mkdir dir="${dist}/lib"/>
+ <jar jarfile="${dist}/lib/example-${DSTAMP}.jar" basedir="${build}"/>
+ </target>
+
+ <target name="clean" description="clean up">
+ <delete dir="${build}"/>
+ <delete dir="${dist}"/>
+ </target>
+</project> \ No newline at end of file
diff --git a/docker/ant/files/jdk-9/build.xml b/docker/ant/files/jdk-9/build.xml
new file mode 100644
index 00000000..3f181ed9
--- /dev/null
+++ b/docker/ant/files/jdk-9/build.xml
@@ -0,0 +1,35 @@
+<project name="example" default="dist" basedir=".">
+ <property name="src" location="src/main/java"/>
+ <property name="build" location="build"/>
+ <property name="dist" location="dist"/>
+ <property name="build.sysclasspath" value="ignore"/>
+
+ <target name="init">
+ <tstamp/>
+ <mkdir dir="${build}"/>
+ </target>
+
+ <target name="compile" depends="init" description="compile the source">
+ <javac classpath="lombok.jar" srcdir="${src}" destdir="${build}" fork="true">
+ <compilerarg value="-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED"/>
+ <compilerarg value="-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED"/>
+ <compilerarg value="-J--add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED"/>
+ <compilerarg value="-J--add-opens=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED"/>
+ <compilerarg value="-J--add-opens=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED"/>
+ <compilerarg value="-J--add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED"/>
+ <compilerarg value="-J--add-opens=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED"/>
+ <compilerarg value="-J--add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED"/>
+ <compilerarg value="-J--add-opens=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED"/>
+ </javac>
+ </target>
+
+ <target name="dist" depends="compile" description="generate the distribution">
+ <mkdir dir="${dist}/lib"/>
+ <jar jarfile="${dist}/lib/example-${DSTAMP}.jar" basedir="${build}"/>
+ </target>
+
+ <target name="clean" description="clean up">
+ <delete dir="${build}"/>
+ <delete dir="${dist}"/>
+ </target>
+</project> \ No newline at end of file
diff --git a/docker/ant/readme.md b/docker/ant/readme.md
new file mode 100644
index 00000000..d6462523
--- /dev/null
+++ b/docker/ant/readme.md
@@ -0,0 +1,33 @@
+## Configuration
+
+[_(general configuration and options)_](../readme.md)
+
+### `ARG ant=1.10.1`
+
+The ant version to be used. Supported values:
+
+- `1.10.1` (default)
+
+## Example build commands:
+
+(To be executed from the `<lombokhome>/docker` directory)
+
+```
+docker build -t lombok-ant-jdk9 -f gradle/Dockerfile .
+
+docker build -t lombok-ant-jdk9 --build-arg lombokjar=lombok-1.16.18.jar -f gradle/Dockerfile .
+```
+
+## Example run commands:
+
+```
+docker run -it lombok-ant-jdk9
+
+docker run --rm -it -v /<lombokhome>/dist/lombok.jar:/workspace/lombok.jar lombok-ant-jdk9
+```
+
+## Example container commands:
+
+```
+ant dist
+```