Files
processing4/core/build.xml
A Pottinger 7463042501 Switch to 11 build target / source on javac.
Minor bit of cleanup in the ant scripts around the build src and target on javac, enabling use of Java 11 language features within processing itself. Note that the build is sustained on either 1.8 or 11 in terms of lanugage features but the code is no longer compatible with the Java 8 runtime due to backwards-incompatable changes made starting in Java 9.
2019-10-08 08:22:28 -07:00

123 lines
4.1 KiB
XML

<?xml version="1.0"?>
<project name="Processing Core" default="build">
<property environment="env"/>
<target name="clean" description="Clean out the build directories">
<delete dir="bin" />
<delete dir="bin-test" />
<delete file="library/core.jar" />
</target>
<target name="methods-check">
<available file="methods/methods.jar" property="methods.present" />
</target>
<target name="methods-build" depends="methods-check" unless="methods.present">
<subant buildpath="methods" target="dist" />
</target>
<path id="classpath.base">
<!-- kinda gross, but if not using the JDT, this just ignored anyway -->
<pathelement location="apple.jar" />
<pathelement location="library/jogl-all.jar" />
<pathelement location="library/gluegen-rt.jar" />
<pathelement location="library/javafx-swt.jar" />
<pathelement location="library/javafx.base.jar" />
<pathelement location="library/javafx.controls.jar" />
<pathelement location="library/javafx.fxml.jar" />
<pathelement location="library/javafx.graphics.jar" />
<pathelement location="library/javafx.media.jar" />
<pathelement location="library/javafx.properties" />
<pathelement location="library/javafx.swing.jar" />
<pathelement location="library/javafx.web.jar" />
</path>
<path id="classpath.test">
<pathelement location="library-test/junit-4.8.1.jar" />
<pathelement location="library-test/mockito-all-1.10.19.jar" />
<pathelement location="bin-test" />
<path refid="classpath.base" />
</path>
<macrodef name="compilecommon">
<attribute name="destdir"/>
<attribute name="srcdir"/>
<attribute name="classpath"/>
<sequential>
<taskdef name="methods"
classname="PAppletMethods"
classpath="methods/methods.jar" />
<methods dir="${basedir}/src/processing/core" recorder="true" />
<!-- Where can I expect to find Java Mode JARs? -->
<property name="java.mode" value="../java/mode/" />
<!-- JavaFX got removed from the Oracle's JDK for arm and Java 11 -->
<condition property="fx.unavailable" value="true">
<or>
<equals arg1="${os.arch}" arg2="arm" />
<equals arg1="${os.arch}" arg2="aarch64" />
</or>
</condition>
<!-- link against apple.jar for the ThinkDifferent class -->
<mkdir dir="@{destdir}" />
<javac source="11"
target="11"
encoding="UTF-8"
includeAntRuntime="false"
debug="true"
destdir="@{destdir}"
nowarn="true">
<classpath refid="@{classpath}"/>
<src path="@{srcdir}" />
<include name="processing/**" />
<exclude name="processing/javafx/**" if="fx.unavailable" />
</javac>
<!-- Copy the jnilib to the bin folder so it's included. -->
<copy todir="bin/japplemenubar"
file="src/japplemenubar/libjAppleMenuBar.jnilib" />
<!-- Copy shaders to bin. (Eclipse does this automatically.) -->
<copy todir="bin">
<fileset dir="src">
<include name="processing/opengl/shaders/*.glsl" />
<include name="processing/opengl/cursors/*.png" />
<include name="icon/*.png" />
</fileset>
</copy>
</sequential>
</macrodef>
<target name="test-compile" description="Compile" depends="methods-build">
<compilecommon srcdir="src; test" destdir="bin-test" classpath="classpath.test" />
</target>
<target name="clean-pre-test" description="Required step prior to test">
<delete dir="resource-test/scratch" />
</target>
<target name="test" depends="test-compile, clean-pre-test">
<junit haltonfailure="true">
<classpath refid="classpath.test" />
<formatter type="brief" usefile="false" />
<batchtest>
<fileset dir="test">
<include name="**/*Test.java" />
</fileset>
</batchtest>
</junit>
</target>
<target name="compile" description="Compile" depends="test">
<compilecommon srcdir="src" destdir="bin" classpath="classpath.base" />
</target>
<target name="build" depends="compile" description="Build core library">
<jar basedir="bin" destfile="library/core.jar" />
</target>
</project>