diff options
author | Michael Bien <[email protected]> | 2011-02-08 20:39:44 +0100 |
---|---|---|
committer | Michael Bien <[email protected]> | 2011-02-08 20:39:44 +0100 |
commit | 3ed09af3cf9322001d959d13672f6446ddaca643 (patch) | |
tree | 658fb076f94d16677447f6228e310f51c2b7a0ad /build.xml | |
parent | aec6036ac7c70c905573c5f5f133646555e4a58e (diff) |
jdk7 try-with-resource support
Diffstat (limited to 'build.xml')
-rw-r--r-- | build.xml | 34 |
1 files changed, 33 insertions, 1 deletions
@@ -34,7 +34,39 @@ <property name="dist.zip.name" value="jocl-${jocl.version}-${os.and.arch}"/> </target> - <target name="-pre-compile" depends="generate-binding"/> + <target name="-pre-compile" depends="detect-jdk,prepare-jdk5-build,prepare-jdk7-build,generate-binding"/> + + <target name="detect-jdk"> + <condition property="enable.jdk7.features"> + <or> + <equals arg1="1.7" arg2="${javac.source}"/> + <equals arg1="1.8" arg2="${javac.source}"/> + </or> + </condition> + </target> + + <target name="prepare-jdk5-build" if="${enable.jdk7.features}"> + + <echo message="JDK7 features enabled"/> + + <copy file="${basedir}/src/com/jogamp/common/AutoCloseable.jtemplate" + tofile="${basedir}/gensrc/java/com/jogamp/common/AutoCloseable.java" overwrite="true"> + <filterchain> + <replaceregex pattern="/\*extends java.lang.AutoCloseable\*/" replace="extends java.lang.AutoCloseable"/> + </filterchain> + </copy> + + </target> + + <target name="prepare-jdk7-build" unless="${enable.jdk7.features}"> + + <echo message="JDK7 features dissabled"/> + + <copy file="${basedir}/src/com/jogamp/common/AutoCloseable.jtemplate" + tofile="${basedir}/gensrc/java/com/jogamp/common/AutoCloseable.java" overwrite="true"> + </copy> + + </target> <target name="generate-binding" depends="prepare-build,preprocess-headers" unless="dont-generate"> |