Files
processing4/app/build.xml

119 lines
4.1 KiB
XML

<?xml version="1.0"?>
<project name="Processing PDE" default="build">
<property name="vaqua.url" value="https://violetlib.org/release/vaqua" />
<target name="clean" description="Clean the build directories">
<delete dir="bin" />
<delete file="pde.jar" />
</target>
<target name="download-vaqua">
<get dest="lib" usetimestamp="true">
<url url="${vaqua.url}/8/VAqua8.jar" />
</get>
</target>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Current version of JNA that works with Processing -->
<property name="jna.version" value="5.7.0" />
<!-- the .zip file to be downloaded -->
<property name="jna.zip" value="${jna.version}.zip" />
<!-- the .jar file that's the actual dependency -->
<!-- <property name="batik.jar" value="batik-all-${batik.version}.jar" /> -->
<!-- URL for the version of Batik currently supported by this library.
This should probably be changed to (or at leas mirrored at) a
location on download.processing.org so it's available forever. -->
<property name="jna.url"
value="https://github.com/java-native-access/jna/archive/${jna.zip}" />
<fileset id="jna.files" dir="lib">
<include name="jna.jar" />
<include name="jna-platform.jar" />
</fileset>
<condition property="jna.present">
<resourcecount refid="jna.files" when="eq" count="2" />
</condition>
<!-- <available file="lib/jna.jar" property="jna.present" /> -->
<!-- ok to ignore failed downloads if we at least have a version that's local -->
<condition property="jna.ignorable" value="false" else="true">
<isset property="jna.present" />
</condition>
<target name="download-jna" unless="jna.present">
<get src="${jna.url}" dest="."
ignoreerrors="${jna.ignorable}"
usetimestamp="true" />
<property name="zip.prefix" value="jna-${jna.version}/dist" />
<!-- Formerly used batik-awt-util-1.8.jar, batik-dom-1.8.jar, batik-ext-1.8.jar,
batik-svggen-1.8.jar, batik-util-1.8.jar, batik-xml-1.8.jar but using
the big feller from now on since file size is less important, and there
were complaints about some .jar files not being available. -->
<unzip src="${jna.zip}" dest="lib">
<patternset>
<!-- unzip a single jar from the zip.prefix subdirectory in the .zip -->
<include name="${zip.prefix}/jna.jar" />
<include name="${zip.prefix}/jna-platform.jar" />
</patternset>
<mapper>
<!-- remove the zip.prefix from the path when saving the .jar -->
<globmapper from="${zip.prefix}/*" to="*" />
</mapper>
</unzip>
<delete file="${jna.zip}" />
</target>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<target name="compile" description="Compile sources" depends="download-vaqua, download-jna">
<condition property="core-built">
<available file="../core/library/core.jar" />
</condition>
<fail unless="core-built" message="Please build the core library first and make sure it is located at ../core/library/core.jar" />
<mkdir dir="bin" />
<!-- copy languages files -->
<copy todir="bin">
<fileset dir="src">
<include name="processing/app/languages/*.properties" />
</fileset>
</copy>
<!-- in some cases, pde.jar was not getting built
https://github.com/processing/processing/issues/1792 -->
<delete file="pde.jar" />
<!-- env used to set classpath below -->
<property environment="env" />
<javac source="11"
target="11"
destdir="bin"
excludes="**/tools/format/**"
encoding="UTF-8"
includeAntRuntime="false"
classpath="../core/library/core.jar;
../core/apple.jar;
lib/ant.jar;
lib/ant-launcher.jar;
lib/jna.jar;
lib/jna-platform.jar;
lib/VAqua8.jar"
debug="on"
nowarn="true">
<src path="src" />
</javac>
</target>
<target name="build" depends="compile" description="Build PDE">
<jar basedir="bin" destfile="pde.jar" />
</target>
</project>