Files
processing4/core/build.xml

159 lines
5.8 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" />
<delete>
<fileset dir="library" includes="gluegen-rt*.jar" />
<fileset dir="library" includes="jogl-all*.jar" />
</delete>
</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>
<!-- Base URL for the current version of JOGL. This should probably be changed to
a location on download.processing.org so that we know it's available forever. -->
<property name="jogl.url"
value="https://jogamp.org/deployment/archive/rc/v2.4.0-rc-20200115/jar" />
<available file="library/jogl-all.jar" property="jogl.present" />
<!-- ok to ignore failed downloads if we at least have a version that's local -->
<condition property="jogl.ignorable" value="false" else="true">
<isset property="jogl.present" />
</condition>
<target name="download-jogl" unless="jogl.present">
<get dest="library" usetimestamp="true" ignoreerrors="${jogl.ignorable}">
<url url="${jogl.url}/gluegen-rt-natives-linux-aarch64.jar" />
<url url="${jogl.url}/gluegen-rt-natives-linux-amd64.jar" />
<url url="${jogl.url}/gluegen-rt-natives-linux-armv6hf.jar" />
<url url="${jogl.url}/gluegen-rt-natives-linux-i586.jar" />
<url url="${jogl.url}/gluegen-rt-natives-macosx-universal.jar" />
<url url="${jogl.url}/gluegen-rt-natives-windows-amd64.jar" />
<url url="${jogl.url}/gluegen-rt-natives-windows-i586.jar" />
<url url="${jogl.url}/gluegen-rt.jar" />
<url url="${jogl.url}/jogl-all-natives-linux-aarch64.jar" />
<url url="${jogl.url}/jogl-all-natives-linux-amd64.jar" />
<url url="${jogl.url}/jogl-all-natives-linux-armv6hf.jar" />
<url url="${jogl.url}/jogl-all-natives-linux-i586.jar" />
<url url="${jogl.url}/jogl-all-natives-macosx-universal.jar" />
<url url="${jogl.url}/jogl-all-natives-windows-amd64.jar" />
<url url="${jogl.url}/jogl-all-natives-windows-i586.jar" />
<url url="${jogl.url}/jogl-all.jar" />
</get>
</target>
<path id="classpath.base">
<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>
<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="build, 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">
<compilecommon srcdir="src" destdir="bin" classpath="classpath.base" />
</target>
<target name="build" depends="download-jogl, methods-build, compile"
description="Build core library">
<jar basedir="bin" destfile="library/core.jar" />
</target>
</project>