Files
processing4/build/build.xml

1918 lines
68 KiB
XML

<?xml version="1.0"?>
<project name="Processing" default="build">
<property environment="env"/>
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="library/ant-contrib-0.6.jar"/>
</classpath>
</taskdef>
<!-- Sets properties for macosx/windows/linux depending on current system -->
<condition property="platform" value="macosx">
<os family="mac" />
</condition>
<condition property="platform" value="windows">
<os family="windows" />
</condition>
<condition property="platform" value="linux">
<and>
<os family="unix" />
<not>
<os family="mac" />
</not>
</and>
</condition>
<target name="ignore-tools">
<echo message="Ignore the 'Unable to locate tools.jar' message." />
<echo message="The tools.jar file is not required to build Processing." />
</target>
<!-- detetect Raspberry Pi and friends -->
<condition property="linux-arm32" value="linux-arm32">
<and>
<equals arg1="${target-platform}" arg2="linux" />
<equals arg1="${os.arch}" arg2="arm" />
<equals arg1="${jdk.data.model}" arg2="32" />
</and>
</condition>
<condition property="linux-arm64" value="linux-arm64">
<and>
<equals arg1="${target-platform}" arg2="linux" />
<equals arg1="${os.arch}" arg2="aarch64" />
<equals arg1="${jdk.data.model}" arg2="64" />
</and>
</condition>
<!-- there is currently no JRE available for ARM -->
<target name="check-linux-arm32" if="linux-arm32">
<property name="jdk.download.jdk" value="true" />
<property name="jdk.downloader" value="linux-arm32-vfp-hflt.tar.gz" />
<property name="linux.dist" value="linux/processing-${version}-linux-armv6hf.tgz" />
<property name="launch4j.variant" value="linux-armv6hf" />
</target>
<target name="check-linux-arm64" if="linux-arm64">
<property name="jdk.download.jdk" value="true" />
<property name="jdk.downloader" value="linux-arm64-vfp-hflt.tar.gz" />
<property name="linux.dist" value="linux/processing-${version}-linux-arm64.tgz" />
</target>
<!-- Require Java 11 everywhere. -->
<fail message="Unsupported Java version: ${java.version}. To build, make sure that Java 11 is installed, and that JAVA_HOME points at the JDK that you want to use. For instance, on macOS, set it with:${line.separator}export JAVA_HOME=&quot;`/usr/libexec/java_home -v 11`&quot;">
<condition>
<not>
<or>
<contains string="${java.version}" substring="11." />
</or>
</not>
</condition>
</fail>
<!-- JavaFX got removed from the Oracle's JDK for arm and Java 11 -->
<condition property="jfx.available" value="true">
<and>
<not><equals arg1="${os.arch}" arg2="arm" /></not>
</and>
</condition>
<!-- could prompt here to download the necessary JRE
(Windows/Linux) or JDK (on Mac OS X) -->
<property name="examples.dir"
value="../../processing-docs/content/examples" />
<property name="jdk.train" value="11" />
<property name="jdk.version" value="0" />
<property name="jdk.update" value="8" />
<property name="jdk.build" value="10" />
<property name="jdk.prefix" value="jdk" />
<property name="jdk.esoteric" value="${jdk.train}.${jdk.version}.${jdk.update}" />
<!-- as of 200815, gluon is currently working on 14.0, and has 11.0.8 available for
commercial clients as an LTS release, but 11.0.2 is the latest public version -->
<property name="jfx.train" value="11" />
<property name="jfx.version" value="0" />
<property name="jfx.update" value="2" />
<property name="jfx.build" value="0" />
<property name="jfx.name" value="${jfx.train}.${jfx.version}.${jfx.update}" />
<!-- Figure out the JRE download location for Linux and Windows. -->
<!--
<condition property="jdk.file"
value="jdk-${jdk.short}-${target-platform}-i586.tar.gz">
<equals arg1="${jdk.data.model}" arg2="32" />
</condition>
<condition property="jdk.file"
value="jdk-${jdk.short}-${target-platform}-x64.tar.gz">
<equals arg1="${jdk.data.model}" arg2="64" />
</condition>
-->
<!-- JDK location for Mac OS X -->
<!--
<condition property="jdk.file" value="jdk-${jdk.short}-macosx-x64.dmg">
<equals arg1="${target-platform}" arg2="macosx" />
</condition>
-->
<!-- These lists haven't been updated since Java 6. The new list:
http://www.oracle.com/technetwork/java/javase/jdk-8-readme-2095710.html
Please help: https://github.com/processing/processing/issues/3288 -->
<fileset dir="macosx/work/Processing.app/Contents" id="jdk-optional-macosx">
<include name="Java/core/library/libjfxwebkit.dylib" />
</fileset>
<fileset dir="windows/work" id="jdk-optional-windows">
<include name="java/lib/ext/dnsns.jar" />
<include name="java/bin/dtplugin" />
<include name="java/bin/plugin2" />
<include name="java/bin/kinit.exe" />
<include name="java/bin/klist.exe" />
<include name="java/bin/ktab.exe" />
<include name="java/bin/keytool" /> <!-- needed for Android -->
<include name="java/bin/orbd" />
<include name="java/bin/policytool" />
<include name="java/bin/rmid" />
<include name="java/bin/rmiregistry" />
<include name="java/bin/servertool" />
<include name="java/bin/tnameserv" />
<include name="java/bin/javaws.exe" />
<include name="java/lib/javaws.jar" />
<include name="java/lib/cmm/PYCC.pf" />
<include name="java/lib/src.zip" />
<include name="core/library/jfxwebkit.dll" />
</fileset>
<fileset dir="linux/work" id="jdk-optional-linux">
<include name="java/bin/keytool" /> <!-- needed for Android -->
<include name="java/lib/ext/dnsns.jar" />
<include name="java/bin/orbd" />
<include name="java/bin/policytool" />
<include name="java/bin/rmid" />
<include name="java/bin/rmiregistry" />
<include name="java/bin/servertool" />
<include name="java/bin/tnameserv" />
<include name="java/bin/javaws" />
<include name="java/lib/javaws.jar" />
<include name="java/lib/src.zip" />
<include name="core/library/libjfxwebkit.so" />
<include name="java/lib/cmm/PYCC.pf" />
</fileset>
<!-- Unused JavaFX files that can be removed from the JRE on Windows
and Linux. On Mac OS X, this is removed by the appbundler task.
www.oracle.com/technetwork/java/javase/jdk-7-readme-429198.html
However, we're now looking into using JavaFX as the default 2D
renderer for 3.0. So in 3.0a8, we're no longer removing javafx. -->
<fileset dir="${target-platform}/work/java" id="javafx-basics">
<include name="THIRDPARTYLICENSEREADME-JAVAFX.txt" />
<include name="lib/javafx.properties" />
<include name="lib/jfxrt.jar" />
<include name="lib/security/javafx.policy" />
</fileset>
<fileset dir="windows/work/java" id="javafx-windows">
<include name="bin/decora-sse.dll" />
<include name="bin/fxplugins.dll" />
<include name="bin/glass.dll" />
<include name="bin/glib-lite.dll" />
<include name="bin/gstreamer-lite.dll" />
<include name="bin/javafx-font.dll" />
<include name="bin/javafx-iio.dll" />
<include name="bin/jfxmedia.dll" />
<include name="bin/jfxwebkit.dll" />
<include name="bin/libxml2.dll" />
<include name="bin/libxslt.dll" />
</fileset>
<fileset dir="linux/work/java" id="javafx-linux-32">
<include name="lib/i386/fxavcodecplugin-52.so" />
<include name="lib/i386/fxavcodecplugin-53.so" />
<include name="lib/i386/fxplugins.so" />
<include name="lib/i386/libglass.so" />
<include name="lib/i386/libgstplugins-lite.so" />
<include name="lib/i386/libgstreamer-lite.so" />
<include name="lib/i386/libjavafx-font.so" />
<include name="lib/i386/libjavafx-iio.so" />
<include name="lib/i386/libjfxmedia.so" />
<include name="lib/i386/libjfxwebkit.so" />
<include name="lib/i386/libprism-es2.so" />
</fileset>
<fileset dir="linux/work/java" id="javafx-linux-64">
<include name="lib/amd64/fxavcodecplugin-52.so" />
<include name="lib/amd64/fxavcodecplugin-53.so" />
<include name="lib/amd64/fxplugins.so" />
<include name="lib/amd64/libglass.so" />
<include name="lib/amd64/libgstplugins-lite.so" />
<include name="lib/amd64/libgstreamer-lite.so" />
<include name="lib/amd64/libjavafx-font.so" />
<include name="lib/amd64/libjavafx-iio.so" />
<include name="lib/amd64/libjfxmedia.so" />
<include name="lib/amd64/libjfxwebkit.so" />
<include name="lib/amd64/libprism-es2.so" />
</fileset>
<!--
<echo message="${java.class.path}" />
-->
<!-- Macro to help set the platform ant vars appropriately -->
<macrodef name="settarget">
<attribute name="platform"/>
<attribute name="datamodel"/>
<sequential>
<property name="host-platform" value="${platform}" />
<!-- Set a property named macosx, linux, or windows.
The 'value' chosen is arbitrary. -->
<property name="target-platform" value="@{platform}" />
<property name="${target-platform}" value="${target-platform}" />
<property name="jdk.tgz.path" value="${target-platform}/jdk-${jdk.esoteric}.tgz" />
<property name="jdk.data.model" value="@{datamodel}" />
<property name="jfx.path.zip" value="${target-platform}/jfx-${jfx.name}.zip" />
<property name="jfx.path.dist" value="${target-platform}/javafx-sdk-${jfx.name}" />
<property name="jfx.path.lib" value="${jfx.path.dist}/lib" />
<condition property="jdk.tgz.path" value="${target-platform}/jdk-${jdk.esoteric}.tgz">
<not>
<equals arg1="${target-platform}" arg2="windows" />
</not>
</condition>
<condition property="jdk.tgz.path" value="${target-platform}/jdk-${jdk.esoteric}.zip">
<equals arg1="${target-platform}" arg2="windows" />
</condition>
</sequential>
</macrodef>
<macrodef name="preparejfx">
<sequential>
<if>
<equals arg1="${jfx.available}" arg2="true" />
<then>
<!-- Extract JFX -->
<echo message="Target jfx: ${jfx.path.zip}"/>
<unzip dest="${target-platform}" src="${jfx.path.zip}" overwrite="true"/>
</then>
</if>
</sequential>
</macrodef>
<macrodef name="nativecopy">
<attribute name="src"/>
<attribute name="dest"/>
<sequential>
<local name="src-abs"/>
<local name="dest-abs"/>
<local name="src-local"/>
<local name="dest-local"/>
<property name="src-abs" value="${basedir}/@{src}"/>
<property name="dest-abs" value="${basedir}/@{dest}"/>
<if>
<equals arg1="${host-platform}" arg2="windows" />
<then>
<propertyregex property="src-local"
input="${src-abs}"
regexp="/"
replace="\\\\"
global="true" />
<propertyregex property="dest-local"
input="${dest-abs}"
regexp="/"
replace="\\\\"
global="true" />
<echo message="Native copy of ${src-local} to ${dest-local}" />
<exec executable="cmd">
<arg line="/C xcopy /s/Y ${src-local} ${dest-local}" />
</exec>
</then>
</if>
<if>
<not><equals arg1="${host-platform}" arg2="windows" /></not>
<then>
<echo message="Native copy of ${src-abs} to ${dest-abs}" />
<exec executable="sh">
<arg line="-c 'cp ${src-abs} ${dest-abs}'"/>
</exec>
</then>
</if>
</sequential>
</macrodef>
<target name="jdk-check">
<echo message="Checking for ${jdk.tgz.path}" />
<available file="${jdk.tgz.path}" property="jdk.tgz.downloaded" />
<echo message="Result: ${jdk.tgz.downloaded}" />
</target>
<target name="jfx-check">
<available file="${jfx.path.zip}" property="jfx.zip.downloaded" />
</target>
<target name="downloader-setup">
<!-- make sure we're built -->
<subant buildpath="jre" target="dist-no-test" />
<!-- define our special JRE downloader task -->
<taskdef name="downloader"
classname="Downloader"
classpath="jre/downloader.jar" />
</target>
<target name="jdk-download" depends="jdk-check, downloader-setup"
unless="jdk.tgz.downloaded">
<condition property="jdk.downloader"
value="${target-platform}-i586.tar.gz">
<equals arg1="${jdk.data.model}" arg2="32" />
</condition>
<condition property="jdk.downloader"
value="${target-platform}-x64.tar.gz">
<equals arg1="${jdk.data.model}" arg2="64" />
</condition>
<downloader component="jdk"
train="${jdk.train}"
version="${jdk.version}"
platform="${target-platform}${jdk.data.model}"
update="${jdk.update}"
build="${jdk.build}"
flavor="${jdk.downloader}"
path="${jdk.tgz.path}" />
</target>
<target name="jfx-download" depends="jfx-check, downloader-setup"
unless="jfx.zip.downloaded">
<downloader component="jfx"
train="${jfx.train}"
version="${jfx.version}"
platform="${target-platform}${jdk.data.model}"
update="${jfx.update}"
build="1"
flavor="${target-platform}${jdk.data.model}.zip"
path="${jfx.path.zip}" />
</target>
<!-- Set the version of Java that must be present to build. -->
<property name="jdk.path.macosx" value="macosx/jdk-${jdk.esoteric}+${jdk.build}" />
<available file="${jdk.path.macosx}" property="macosx_jdk_found" />
<!--
<fail if="linux" unless="java_tools_found"
message="The JAVA_HOME variable must be set to the location of a full JDK. For instance, on Ubuntu Linux, this might be /usr/lib/jvm/java-6-sun." />
-->
<!-- Figure out the platform-specific output directory for all this work. -->
<condition property="target.path"
value="macosx/work/Processing.app/Contents/Java">
<os family="mac" />
</condition>
<condition property="target.path" value="linux/work">
<os family="unix" />
</condition>
<condition property="target.path" value="windows/work">
<os family="windows" />
</condition>
<!-- Libraries required for running processing -->
<!-- also need to copy these to the bundleapp task for macosx -->
<fileset dir=".." id="runtime.jars">
<include name="app/pde.jar" />
<include name="app/lib/antlr-4.7.2-complete.jar" />
<include name="app/lib/jna.jar" />
<include name="app/lib/jna-platform.jar" />
<include name="app/lib/ant.jar" />
<include name="app/lib/ant-launcher.jar" />
<include name="app/lib/VAqua7.jar" />
</fileset>
<target name="build" description="Build Processing.">
<settarget platform="${platform}" datamodel="${sun.arch.data.model}" />
<antcall target="${target-platform}-build" />
</target>
<target name="cross-build-macosx" description="Build Processing.">
<settarget platform="macosx" datamodel="64" />
<antcall target="macosx-build" />
</target>
<target name="cross-build-linux-x64" description="Build Processing.">
<settarget platform="linux" datamodel="64" />
<antcall target="linux-build" />
</target>
<target name="cross-build-linux-aarch64" description="Build Processing.">
<settarget platform="linux" datamodel="Arm" />
<antcall target="linux-build" />
</target>
<target name="cross-build-windows" description="Build Processing.">
<settarget platform="windows" datamodel="64" />
<antcall target="windows-build" />
</target>
<target name="run" description="Run Processing.">
<settarget platform="${platform}" datamodel="${sun.arch.data.model}" />
<antcall target="${target-platform}-run" />
</target>
<!-- Run the app in a more "native" manner, i.e. no additional
console for debugging. Ensures that double-clicking shortcuts
and other desktop integration features work properly. -->
<target name="app" description="Run Processing w/o console.">
<antcall target="${target-platform}-run-app" />
</target>
<target name="dist" depends="revision-check, test"
description="Build Processing for distribution.">
<input message="Enter version number:"
addproperty="version"
defaultvalue="${revision}" />
<available file="${examples.dir}" property="examples.exist" />
<fail unless="examples.exist" message="To do a distribution, the processing-docs repo must be checked out at the same level as the processing repo." />
<!-- do a git pull in the docs repo so that it is up to date -->
<exec executable="git" dir="${examples.dir}">
<arg line="pull" />
</exec>
<antcall target="${target-platform}-dist" />
</target>
<!-- "§$§$&, ant doesn't have a built-in help target :( -->
<target name="help" description="Show project help">
<java classname="org.apache.tools.ant.Main">
<arg value="-p" />
</java>
</target>
<!-- - - - - - - - - - - - - - - - - - -->
<!-- Subprojects: Core, App, Libraries -->
<!-- - - - - - - - - - - - - - - - - - -->
<target name="subprojects-clean">
<subant buildpath="../core" target="clean"/>
<subant buildpath="../app" target="clean"/>
<subant buildpath="../java/libraries/dxf" target="clean"/>
<subant buildpath="../java/libraries/io" target="clean"/>
<subant buildpath="../java/libraries/net" target="clean"/>
<subant buildpath="../java/libraries/pdf" target="clean"/>
<subant buildpath="../java/libraries/serial" target="clean"/>
<subant buildpath="../java/libraries/svg" target="clean"/>
<subant buildpath="shared/tools/MovieMaker" target="clean"/>
<subant buildpath="../java" target="clean"/>
<!-- make sure this isn't around from an old build 140730 -->
<delete dir="../java/examples" />
</target>
<target name="test" depends="build">
<subant buildpath="../core" target="test"/>
<subant buildpath="../java" target="test"/>
<subant buildpath="jre" target="test" />
</target>
<target name="subprojects-build">
<subant buildpath="../core" target="build"/>
<subant buildpath="../app" target="build"/>
<subant buildpath="../java/libraries/dxf" target="build"/>
<subant buildpath="../java/libraries/net" target="build"/>
<subant buildpath="../java/libraries/pdf" target="build"/>
<subant buildpath="../java/libraries/serial" target="build"/>
<subant buildpath="../java/libraries/svg" target="build"/>
<subant buildpath="shared/tools/MovieMaker" target="build"/>
<subant buildpath="../java" target="build"/>
</target>
<!-- I/O library is only compiled on supported ARM platforms -->
<target name="subprojects-build-linux-arm32" if="linux-arm32">
<subant buildpath="../java/libraries/io" target="build"/>
</target>
<target name="subprojects-build-linux-arm64" if="linux-arm64">
<subant buildpath="../java/libraries/io" target="build"/>
</target>
<!-- - - - - - - - - -->
<!-- Basic Assembly -->
<!-- - - - - - - - - -->
<target name="assemble" depends="version-clear, version-write">
<fail unless="target.path"
message="Do not call assemble from the command line." />
<!-- copy shared tools folder -->
<copy todir="${target.path}/tools" preservelastmodified="true">
<fileset dir="shared/tools" />
</copy>
<copy todir="${target.path}/modes/java" preservelastmodified="true">
<fileset dir="../java">
<!-- don't include LWJGL, it's not operational -->
<exclude name="libraries/lwjgl/**" />
<exclude name="reference.zip" />
<exclude name="**/._*" />
</fileset>
</copy>
<!-- get the examples folder, but don't require it to buid -->
<copy todir="${target.path}/modes/java/examples"
preservelastmodified="true" failonerror="false">
<fileset dir="${examples.dir}" />
</copy>
<!-- if we're creating a dist, the reference is required -->
<condition property="reference.ignorable" value="false" else="true">
<isset property="version" />
</condition>
<!--<echo message="ref ignoreable? ${reference.ignorable}" />-->
<get src="http://download.processing.org/reference.zip"
dest="../java/reference.zip"
ignoreerrors="${reference.ignorable}"
usetimestamp="true" />
<unzip dest="${target.path}/modes/java"
src="../java/reference.zip"
overwrite="false">
<patternset>
<exclude name="__MACOSX/**" />
<exclude name="**/._*" />
</patternset>
</unzip>
<!-- copy PDE X mode folder-->
<!--
<copy todir="${target.path}/modes/">
<fileset dir="../pdex/dist" />
</copy>
-->
</target>
<target name="version-clear">
<delete file="${target.path}/lib/version.txt" />
</target>
<target name="version-write" if="version">
<echo file="${target.path}/lib/version.txt" message="${version}"/>
</target>
<!-- - - - - - - - - -->
<!-- Revision check -->
<!-- - - - - - - - - -->
<target name="revision-check">
<!-- figure out the revision number -->
<loadfile srcfile="../todo.txt" property="revision">
<filterchain>
<headfilter lines="1"/>
<tokenfilter>
<stringtokenizer suppressdelims="true"/>
<!-- grab the thing from the first line that's 4 digits -->
<containsregex pattern="(\d\d\d\d)" />
</tokenfilter>
</filterchain>
</loadfile>
<!-- <echo message="revision is ${revision}." /> -->
<!-- figure out the revision number in base.java -->
<loadfile srcfile="../app/src/processing/app/Base.java"
property="revision.base">
<filterchain>
<tokenfilter>
<linetokenizer />
<containsregex pattern="String VERSION_NAME = "/>
<replaceregex pattern="[^0-9]*" flags="g" replace=""/>
</tokenfilter>
</filterchain>
</loadfile>
<!-- <echo message="base revision is ${revision.base}." /> -->
<condition property="revision.correct">
<!-- Using contains because I can't figure out how to get rid of the
LF in revision.base. Please file a bug if you have a fix. -->
<contains string="${revision.base}" substring="${revision}"/>
</condition>
<!-- the revision.base property won't be set
if $revision wasn't found... -->
<fail unless="revision.correct"
message="Fix revision number in Base.java" />
</target>
<!-- - - - - - - - -->
<!-- Mac OS X -->
<!-- - - - - - - - -->
<target name="macosx-clean" depends="subprojects-clean" description="Clean Mac OS X build">
<delete dir="macosx/work" />
<delete>
<fileset dir="macosx" includes="processing-*zip" />
</delete>
</target>
<target name="macosx-check-os">
<if>
<equals arg1="${host-platform}" arg2="windows" />
<then>
<echo>
=======================================================
Processing for Mac can only be built on *nix systems.
Bye.
=======================================================
</echo>
<fail message="wrong platform (${os.name})" />
</then>
</if>
</target>
<target name="macosx-build" depends="revision-check, macosx-check-os, subprojects-build, jdk-download, jfx-download" description="Build Mac OS X version">
<mkdir dir="macosx/work" />
<!-- Extract JDK -->
<echo message="Target jdk: ${jdk.tgz.path}"/>
<exec executable="tar" dir="macosx">
<!-- Change directory -->
<!--
<arg value="-C" />
<arg value="linux/work" />
<arg value="-xzpf" />
-->
<arg value="xfz" />
<arg value="../${jdk.tgz.path}"/>
</exec>
<property name="jdk.dir" value="macosx/work/jdk-${jdk.esoteric}+${jdk.build}.jdk/" />
<!-- app bundler for OS X and Java -->
<taskdef name="bundleapp"
classname="com.oracle.appbundler.AppBundlerTask"
classpath="macosx/appbundler.jar" />
<bundleapp outputDirectory="macosx/work"
name="Processing"
displayName="Processing"
executableName="Processing"
identifier="org.processing.app"
signature="Pde3"
icon="macosx/processing.icns"
copyright="© The Processing Foundation"
shortVersion="${version}"
version="${revision}"
mainClassName="processing.app.BaseSplash"
minimumSystemVersion="10.13.6">
<!-- The appbundler task needs a couple files (the Info.plist and
anything else outside /jdk) from the full JDK, even though
it's primarily copying over the JRE folder. -->
<runtime dir="${jdk.path.macosx}/Contents/Home" />
<!-- Eventually we'll want to load the JRE directly from
the .tgz on the Oracle site, though it's in a folder called
jdk1.7.0_40.jdk, so we'll need to strip that out. -->
<!-- Same as runtime.jars, seen above; plus core.jar. -->
<classpath file="../app/pde.jar" />
<classpath file="../app/lib/antlr-4.7.2-complete.jar" />
<classpath file="../app/lib/jna.jar" />
<classpath file="../app/lib/jna-platform.jar" />
<classpath file="../app/lib/ant.jar" />
<classpath file="../app/lib/ant-launcher.jar" />
<classpath file="../app/lib/VAqua7.jar" />
<!-- plus core.jar... note that this is no longer shared -->
<classpath file="../core/library/core.jar" />
<arch name="x86_64"/>
<!-- no support for this with Java 7 from Oracle -->
<!--<arch name="i386"/>-->
<bundledocument extensions="pde,pyde"
icon="macosx/document.icns"
name="Processing Source Code"
role="Editor">
</bundledocument>
<!-- !@#*&$ the @2x splash screen implementation was removed by Oracle -->
<!-- tiffutil -cathidpicheck about.png about\@2x.png -out about.tiff -->
<!--<option value="-splash:$APP_ROOT/Contents/Java/lib/about.png" />-->
<!-- Sets dock icon when debugging (not launched via launch svcs) -->
<option value="-Xdock:icon=$APP_ROOT/Contents/Resources/processing.icns" />
<!-- Don't think these actually make any difference.
(The apple.awt.application.name property is used.)-->
<!--
<option value="-Xdock:name=Processing" />
-->
<!-- Probably no longer needed? [fry 130917]
<option value="-Xms128M" />
-->
<!-- returning 140606 per PDE X request -->
<option value="-Xmx512M" />
<option value="-Dapple.awt.application.name=Processing" />
<!-- avoid conflicts with JNA DLLs already in the path -->
<option value="-Djna.nosys=true" />
<!-- deal with jokers who install JOGL, ANTLR, etc system-wide -->
<!--<option value="-Djava.ext.dirs=$APP_ROOT/Contents/PlugIns/adoptopenjdk-11.0.1.jdk/Contents/Home/lib/ext" />-->
<option value="-Dapple.laf.useScreenMenuBar=true" />
<option value="-Dcom.apple.macos.use-file-dialog-packages=true" />
<option value="-Dcom.apple.macos.useScreenMenuBar=true" />
<option value="-Dcom.apple.smallTabs=true" />
<!--
the old options; most of these are probably no longer useful
<key>apple.laf.useScreenMenuBar</key>
<string>true</string>
<key>apple.awt.showGrowBox</key>
<string>true</string>
<key>com.apple.smallTabs</key>
<string>true</string>
<key>apple.awt.Antialiasing</key>
<string>false</string>
<key>apple.awt.TextAntialiasing</key>
<string>true</string>
<key>com.apple.hwaccel</key>
<string>true</string>
<key>apple.awt.use-file-dialog-packages</key>
<string>false</string>
<key>apple.awt.graphics.UseQuartz</key>
<string>true</string>
-->
</bundleapp>
<mkdir dir="macosx/work/Processing.app/Contents/Java/Classes" />
<!-- Temporary fix until new appbundler is included again after solving
https://github.com/processing/processing/issues/3359
https://github.com/processing/processing/issues/3360
The 'keytool' file is deleted by our appbundler. Add it back so that
Android signing works properly. (Not modifying our appbundler since
most of the time that appbundler is used, keytool isn't needed).
Also, because Ant's copy task does not retain file permissions on
Unix systems, we need to use <exec executable="cp" ... > instead -->
<exec executable="cp">
<arg value="-r"/>
<arg line="${jdk.path.macosx}/Contents/Home/bin macosx/work/Processing.app/Contents/PlugIns/${jdk.prefix}-${jdk.esoteric}+${jdk.build}/Contents/Home/bin"/>
</exec>
<exec executable="cp">
<arg value="-r"/>
<arg line="${jdk.path.macosx}/Contents/Home/jmods macosx/work/Processing.app/Contents/PlugIns/${jdk.prefix}-${jdk.esoteric}+${jdk.build}/Contents/Home/jmods"/>
</exec>
<exec executable="cp">
<arg value="-r"/>
<arg line="${jdk.path.macosx}/Contents/Home/legal macosx/work/Processing.app/Contents/PlugIns/${jdk.prefix}-${jdk.esoteric}+${jdk.build}/Contents/Home/legal"/>
</exec>
<exec executable="cp">
<arg value="-r"/>
<arg line="${jdk.path.macosx}/Contents/Home/conf macosx/work/Processing.app/Contents/PlugIns/${jdk.prefix}-${jdk.esoteric}+${jdk.build}/Contents/Home/conf"/>
</exec>
<property name="contents.dir"
location="macosx/work/Processing.app/Contents" />
<!-- Replace libjli.dylib symlink with actual file.
Deals with code signing issues on OS X 10.9.5+ -->
<!--
<property name="jli.path" value="${contents.dir}/PlugIns/${jdk.prefix}-${jdk.esoteric}+${jdk.build}/Contents/MacOS/libjli.dylib" />
<delete file="${jli.path}" />
<exec executable="cp">
<arg line="${jdk.path.macosx}/Contents/Home/lib/jli/libjli.dylib ${jli.path}"/>
</exec>
-->
<copy todir="${contents.dir}/Java" preservelastmodified="true">
<fileset dir=".." includes="core/library/**" /> <!-- why this? -->
<!--<fileset dir="shared" includes="launch4j/**" />-->
<fileset dir="shared" includes="lib/**" />
<fileset file="shared/changes.md" />
</copy>
<preparejfx />
<!-- Pull in OpenJFX (separated from mainline Java in JDK 11). -->
<if>
<equals arg1="${jfx.available}" arg2="true" />
<then>
<copy todir="macosx/work/Processing.app/Contents/Java/core/library" overwrite="true">
<fileset dir="${jfx.path.lib}" includes="*.jar"/>
<fileset dir="${jfx.path.lib}" includes="*.dylib"/>
</copy>
<mkdir dir="macosx/work/Processing.app/Contents/PlugIns/${jdk.prefix}-${jdk.esoteric}+${jdk.build}/Contents/Home/legal/openjfx" />
<copy todir="macosx/work/Processing.app/Contents/PlugIns/${jdk.prefix}-${jdk.esoteric}+${jdk.build}/Contents/Home/legal/openjfx" overwrite="true">
<fileset dir="${jfx.path.dist}/legal" includes="**"/>
</copy>
</then>
</if>
<!-- Use the Processing executable as the stub for exported apps.
This works b/c everything app-specific is in Info.plist. -->
<property name="app.stub" value="${contents.dir}/Java/modes/java/application/mac-app-stub" />
<!-- Grab a copy of the stub binary before it is signed.
(See processing.mode.java.JavaBuild for usage.)
Prevents signing errors with exported apps. -->
<copy file="${contents.dir}/MacOS/Processing" tofile="${app.stub}" />
<!-- The ant copy command does not preserve permissions. -->
<chmod file="${app.stub}" perm="ugo+x" />
<antcall target="assemble">
<param name="target.path" value="${contents.dir}/Java" />
</antcall>
<delete failonerror="true">
<fileset refid="jdk-optional-macosx" />
</delete>
<exec executable="macosx/language_gen.py" />
<property name="launch4j.dir" value="${contents.dir}/Java/modes/java/application/launch4j" />
<!-- rename the version we need -->
<move file="${launch4j.dir}/bin/windres-macosx"
tofile="${launch4j.dir}/bin/windres" />
<move file="${launch4j.dir}/bin/ld-macosx"
tofile="${launch4j.dir}/bin/ld" />
<!-- make executable (ant doesn't preserve) -->
<chmod perm="ugo+x" file="${launch4j.dir}/bin/windres" />
<chmod perm="ugo+x" file="${launch4j.dir}/bin/ld" />
<!-- remove the others -->
<delete failonerror="true">
<fileset dir="${launch4j.dir}/bin" includes="ld-*" />
<fileset dir="${launch4j.dir}/bin" includes="windres-*" />
</delete>
<!-- remove temporary files -->
<exec executable="rm">
<arg value="-r"/>
<arg line="${jdk.path.macosx}"/>
</exec>
<exec executable="rm">
<arg value="-r"/>
<arg line="${jfx.path.dist}"/>
</exec>
</target>
<target name="macosx-run" depends="macosx-build"
description="Run Mac OS X version">
<!-- Terminal.app has a new location in Catalina -->
<available file="/System/Applications/Utilities/Terminal.app" type="dir"
property="terminal.path"
value="/System/Applications/Utilities/Terminal.app" />
<available file="/Applications/Utilities/Terminal.app" type="dir"
property="terminal.path"
value="/Applications/Utilities/Terminal.app" />
<exec executable="open" dir="macosx/work" spawn="true">
<arg value="-a" />
<arg value="${terminal.path}" />
<arg value="Processing.app/Contents/MacOS/Processing" />
</exec>
</target>
<target name="macosx-run-app" depends="macosx-build"
description="Run Mac OS X version without console">
<exec executable="open" dir="macosx/work" spawn="true">
<arg value="Processing.app" />
</exec>
</target>
<target name="macosx-dist-sign" if="env.PROCESSING_APP_PASSWORD">
<echo>
Code signing will only work if you have a $99/yr Apple developer ID.
With a proper ID, if code signing fails, you may need to use:
export CODESIGN_ALLOCATE="/Applications/Xcode.app/Contents/Developer/usr/bin/codesign_allocate"
</echo>
<!-- Use "3rd Party Mac Developer Application" for the app store,
instead of "Developer ID Application" when just doing Gatekeeper. -->
<!--<arg value="3rd Party Mac Developer Application" />-->
<exec executable="/usr/bin/codesign" dir="macosx/work" failonerror="true">
<arg value="--force" />
<arg value="--sign" />
<arg value="Developer ID Application" />
<arg value="--entitlements" />
<arg value="../ffs.entitlements" />
<arg value="Processing.app/Contents/PlugIns/jdk-${jdk.esoteric}+${jdk.build}" />
</exec>
<!-- codesign can't work inside jars? so instead temporarily unpack the files
that contain dylib entries, just before doing our big signing event -->
<property name="unpack.jogl" value="macosx/work/Processing.app/Contents/Java/core/library/jogl-all-natives-macosx-universal" />
<property name="unpack.gluegen" value="macosx/work/Processing.app/Contents/Java/core/library/gluegen-rt-natives-macosx-universal" />
<property name="unpack.jssc" value="macosx/work/Processing.app/Contents/Java/modes/java/libraries/serial/library/jssc" />
<unzip src="${unpack.jogl}.jar" dest="${unpack.jogl}" />
<unzip src="${unpack.gluegen}.jar" dest="${unpack.gluegen}" />
<unzip src="${unpack.jssc}.jar" dest="${unpack.jssc}" />
<!-- Termporary; these appear to be in error
https://github.com/processing/processing4/issues/119 -->
<delete file="${unpack.jssc}/natives/windows_64/libjssc.dylib" />
<delete file="${unpack.jssc}/natives/windows_32/libjssc.dylib" />
<!-- <unzip src="macosx/work/Processing.app/Contents/Java/modes/java/libraries/serial/library/jssc.jar" dest="macosx/work/Processing.app/Contents/Java/modes/java/libraries/serial/library/jssc" /> -->
<apply executable="/usr/bin/codesign" dir="macosx/work" failonerror="true">
<arg value="--sign" />
<arg value="Developer ID Application" />
<!-- remove all other signatures -->
<arg value="--force" />
<arg value="--entitlements" />
<arg value="../ffs.entitlements" />
<!-- recursively sign everything -->
<arg value="--deep" />
<!-- enable the "hardened runtime" -->
<arg value="--options" />
<arg value="runtime" />
<fileset dir="macosx/work/Processing.app/Contents/Java">
<patternset>
<include name="**/*.dylib" />
<include name="**/*.jnilib" />
<!-- <include name="**/*.jar" /> -->
<!-- <include name="**/*.app" /> -->
<include name="modes/java/application/mac-app-stub" />
<!-- <include name="modes/java/application/template.app" /> -->
<include name="modes/java/application/template.app/Contents/MacOS/JavaApplicationStub" />
<include name="modes/java/application/launch4j/bin/windres" />
<include name="modes/java/application/launch4j/bin/ld" />
</patternset>
</fileset>
</apply>
<!-- re-package the jar files after signing their macOS contents -->
<zip destfile="${unpack.jogl}.jar" basedir="${unpack.jogl}" />
<zip destfile="${unpack.gluegen}.jar" basedir="${unpack.gluegen}" />
<zip destfile="${unpack.jssc}.jar" basedir="${unpack.jssc}" />
<!-- delete the temporary directories w/ the jar contents -->
<delete dir="${unpack.jogl}" />
<delete dir="${unpack.gluegen}" />
<delete dir="${unpack.jssc}" />
<!-- sign the outher application, now that we've finished all the contents -->
<exec executable="/usr/bin/codesign" dir="macosx/work" failonerror="true">
<arg value="--sign" />
<arg value="Developer ID Application" />
<!-- remove all other signatures -->
<arg value="--force" />
<!-- recursively sign everything -->
<arg value="--deep" />
<arg value="--entitlements" />
<arg value="../ffs.entitlements" />
<!-- enable the "hardened runtime" -->
<arg value="--options" />
<arg value="runtime" />
<arg value="Processing.app" />
</exec>
<!-- Verify that the signature will pass Gatekeeper checks
https://developer.apple.com/library/mac/technotes/tn2206 -->
<!--
<exec executable="/usr/bin/codesign" dir="macosx/work">
<arg value="- -verify" />
<arg value="- -deep" />
<arg value="- -verbose=2" />
<arg value="Processing.app" />
</exec>
-->
<!-- Disabling since it's a lot of gunk but not that useful. -->
</target>
<target name="macosx-dist-notarize" if="env.PROCESSING_APP_PASSWORD">
<!-- xcrun: error: unable to find utility "altool", not a developer tool or in PATH -->
<!-- fix with 'sudo xcode-select -r' -->
<!-- when it's time to sign/update documents or make an app password: -->
<!-- https://developer.apple.com/account/ -->
<exec executable="/usr/bin/xcrun" dir="macosx" failonerror="true">
<arg value="altool" />
<arg value="--notarize-app" />
<!-- spew a bunch of useless garbage that has nothing to do with success/failure -->
<!-- <arg value="- -verbose" /> -->
<arg value="--primary-bundle-id" />
<arg value="org.processing.app" />
<arg value="--username" />
<arg value="${env.PROCESSING_APPLE_ID}" />
<arg value="--password" />
<arg value="${env.PROCESSING_APP_PASSWORD}" />
<arg value="--file" />
<arg value="processing-${version}-macosx.zip" />
</exec>
<echo>
Check on notarization status with:
xcrun altool -u $PROCESSING_APPLE_ID -p $PROCESSING_APP_PASSWORD --notarization-info [the RequestUUID above]
</echo>
</target>
<target name="macosx-dist" if="macosx"
depends="macosx-build"
description="Create a downloadable .zip for the Mac OS X version">
<antcall target="macosx-dist-sign" />
<exec executable="ditto" dir="macosx/work">
<arg line="-c -k -rsrc . ../processing-${version}-macosx.zip" />
</exec>
<antcall target="macosx-dist-notarize" />
<echo>
=======================================================
Processing for Mac OS X was built. Grab it from
macosx/processing-${version}-macosx.zip
=======================================================
</echo>
</target>
<!-- - - - - - - - -->
<!-- Linux -->
<!-- - - - - - - - -->
<target name="linux-clean" depends="subprojects-clean" description="Clean linux version">
<delete dir="linux/work" />
<delete>
<fileset dir="linux" includes="processing-*tgz" />
</delete>
</target>
<target name="linux-check-os">
<if>
<equals arg1="${host-platform}" arg2="windows" />
<then>
<echo>
=======================================================
Processing for Linux can only be built on *nix systems.
Bye.
=======================================================
</echo>
<fail message="wrong platform (${os.name})" />
</then>
</if>
</target>
<target name="linux-build" depends="ignore-tools, check-linux-arm32, check-linux-arm64, revision-check, linux-check-os, jdk-download, jfx-download, subprojects-build, subprojects-build-linux-arm32, subprojects-build-linux-arm64" description="Build Linux version">
<mkdir dir="linux/work" />
<copy todir="linux/work" preservelastmodified="true">
<fileset dir=".." includes="core/library/**" />
<fileset dir="shared" includes="launch4j/**" />
<fileset dir="shared" includes="lib/**" />
<fileset dir="shared" includes="modes/**" />
<fileset file="shared/changes.md" />
</copy>
<antcall target="assemble">
<param name="target.path" value="linux/work" />
</antcall>
<property name="launch4j.dir"
value="linux/work/modes/java/application/launch4j" />
<!-- this might be already overwritten by check-linux-arm32 -->
<property name="launch4j.variant" value="linux" />
<!-- rename the version we need -->
<move file="${launch4j.dir}/bin/windres-${launch4j.variant}"
tofile="${launch4j.dir}/bin/windres" />
<move file="${launch4j.dir}/bin/ld-${launch4j.variant}"
tofile="${launch4j.dir}/bin/ld" />
<!-- make executable (ant doesn't preserve) -->
<chmod perm="ugo+x" file="${launch4j.dir}/bin/windres" />
<chmod perm="ugo+x" file="${launch4j.dir}/bin/ld" />
<!-- remove the others -->
<delete failonerror="true">
<fileset dir="${launch4j.dir}/bin" includes="ld-*" />
<fileset dir="${launch4j.dir}/bin" includes="windres-*" />
</delete>
<copy todir="linux/work/lib" flatten="true" preservelastmodified="true">
<fileset refid="runtime.jars" />
</copy>
<preparejfx />
<!-- Pull in OpenJFX (separated from mainline Java in JDK 11). -->
<if>
<equals arg1="${jfx.available}" arg2="true" />
<then>
<copy todir="linux/work/core/library" overwrite="true">
<fileset dir="${jfx.path.lib}" includes="*.jar"/>
<fileset dir="${jfx.path.lib}" includes="*.so"/>
</copy>
<mkdir dir="linux/work/core/java/legal/openjfx" />
<copy todir="linux/work/core/java/legal/openjfx" overwrite="true">
<fileset dir="${jfx.path.dist}/legal" includes="**"/>
</copy>
</then>
</if>
<copy file="linux/processing" todir="linux/work" />
<chmod perm="ugo+x" file="linux/work/processing" />
<!-- copy command line tool -->
<copy file="linux/processing" tofile="linux/work/processing-java" />
<chmod perm="ugo+x" file="linux/work/processing-java" />
<!-- This allows Linux users to add mime types to the PDE by simply
running the install script added to the Processing folder.
This adds the following features:
- the icons for the PDE in different resolutions
- icons for the files
- a desktop icon
- when double clicking the *.pde files, the PDE will be opened
from Sweden with <3
-->
<copy file="linux/install.sh" todir="linux/work" />
<chmod perm="ugo+x" file="linux/work/install.sh" />
<copy file="linux/uninstall.sh" todir="linux/work" />
<chmod perm="ugo+x" file="linux/work/uninstall.sh" />
<copy file="linux/processing-pde.xml" todir="linux/work/lib" />
<copy file="linux/appdata.xml" todir="linux/work/lib" />
<copy file="linux/desktop.template" todir="linux/work/lib" />
<!--
Cannot use ant version of tar because it doesn't preserve properties.
<untar compression="gzip"
dest="linux/work"
src="linux/jdk.tgz"
overwrite="false"/>
-->
<!--
http://www.gnu.org/software/tar/manual/html_section/transform.html
-->
<exec executable="tar" dir="linux">
<!-- Change directory -->
<!--
<arg value="-C" />
<arg value="linux/work" />
<arg value="-xzpf" />
-->
<arg value="xfz" />
<arg value="../${jdk.tgz.path}"/>
</exec>
<property name="jdk.dir" value="jdk-${jdk.esoteric}+${jdk.build}/" />
<exec executable="rsync" dir="linux">
<arg value="-a" />
<arg value="--delete" />
<arg value="${jdk.dir}" />
<arg value="work/java/" />
</exec>
<!-- Remove unused JRE bloat. -->
<delete failonerror="true">
<!--
<fileset refid="javafx-basics" />
<fileset refid="javafx-linux-${jdk.data.model}" />
-->
<fileset refid="jdk-optional-linux" />
</delete>
<exec executable="rm">
<arg value="-r"/>
<arg line="linux/jdk-${jdk.esoteric}+${jdk.build}"/>
</exec>
<exec executable="rm">
<arg value="-r"/>
<arg line="${jfx.path.dist}"/>
</exec>
</target>
<target name="linux-run" depends="linux-build"
description="Run Linux version">
<exec executable="./processing" dir="linux/work" spawn="true"/>
</target>
<target name="linux-dist" depends="linux-build"
description="Build .tar.gz of linux version">
<!--
<tar compression="gzip" destfile="linux/processing-${version}.tgz">
<tarfileset dir="linux/work" prefix="processing-${version}" />
</tar>
-->
<!-- rename the work folder temporarily -->
<move file="linux/work" tofile="linux/processing-${version}" />
<property name="linux.dist" value="linux/processing-${version}-linux${jdk.data.model}.tgz" />
<exec executable="tar">
<arg value="--directory=linux" />
<arg value="--file=${linux.dist}" />
<arg value="-cpz" />
<arg value="processing-${version}" />
</exec>
<!-- put... the candle... back -->
<!-- (rename the work processing-NNNN version to work) -->
<move file="linux/processing-${version}" tofile="linux/work" />
<echo>
=======================================================
Processing for Linux was built. Grab the archive from
${linux.dist}
=======================================================
</echo>
</target>
<target name="deb" depends="dist"
description="Build .deb of linux version">
<!-- start with a clean debian folder -->
<delete dir="linux/debian" quiet="true" />
<!-- setup the file structure -->
<mkdir dir="linux/debian/opt" />
<mkdir dir="linux/debian/usr/bin" />
<mkdir dir="linux/debian/usr/share/applications/" />
<mkdir dir="linux/debian/usr/share/mime/packages/" />
<!-- rename the work folder temporarily -->
<move file="linux/work" tofile="linux/debian/opt/processing" />
<symlink link="linux/debian/usr/bin/processing"
resource="../../opt/processing/processing" />
<symlink link="linux/debian/usr/bin/processing-java"
resource="../../opt/processing/processing-java" />
<!-- place .desktop and .sharedmimeinfo file -->
<copy file="linux/processing.desktop"
tofile="linux/debian/usr/share/applications/processing.desktop">
<filterchain>
<replacetokens>
<token key="version" value="${version}" />
</replacetokens>
</filterchain>
</copy>
<copy file="linux/processing.sharedmimeinfo"
tofile="linux/debian/usr/share/mime/packages/processing.xml" />
<!-- Set properties for DEBIAN/control file -->
<condition property="linux.deb" value="linux/processing-${version}-linux-armv6hf.deb">
<equals arg1="${linux-arm32}" arg2="linux-arm32" />
</condition>
<condition property="linux.deb" value="linux/processing-${version}-linux-arm64.deb">
<equals arg1="${linux-arm64}" arg2="linux-arm64" />
</condition>
<property name="linux.deb" value="linux/processing-${version}-linux${jdk.data.model}.deb" />
<!-- Raspbian seems to borrow armhf for armv6hf, so this works -->
<condition property="deb.arch" value="armhf">
<equals arg1="${linux-arm32}" arg2="linux-arm32" />
</condition>
<condition property="deb.arch" value="arm64">
<equals arg1="${linux-arm64}" arg2="linux-arm64" />
</condition>
<condition property="deb.arch" value="i386">
<equals arg1="${jdk.data.model}" arg2="32" />
</condition>
<condition property="deb.arch" value="amd64">
<equals arg1="${jdk.data.model}" arg2="64" />
</condition>
<length property="deb.bsize" >
<fileset dir="linux/debian" />
</length>
<script language="javascript">
<![CDATA[
var length_bytes = project.getProperty("deb.bsize");
var length_kbytes = Math.ceil(length_bytes / 1024);
project.setNewProperty("deb.kbsize", length_kbytes);
]]>
</script>
<!-- place DEBIAN/control file. -->
<mkdir dir="linux/debian/DEBIAN" />
<copy file="linux/control" tofile="linux/debian/DEBIAN/control" >
<filterchain>
<replacetokens >
<token key="version" value="${version}" />
<token key="size" value="${deb.kbsize}" />
<token key="arch" value="${deb.arch}" />
</replacetokens>
</filterchain >
</copy >
<copy file="linux/copyright" tofile="linux/debian/DEBIAN/copyright" />
<!-- Create .deb file -->
<exec executable="fakeroot" dir="linux" failonerror="true">
<arg value="dpkg-deb" />
<arg value="--build" />
<arg value="debian" />
<arg value="../${linux.deb}" />
</exec>
<!-- put... the candle... back -->
<!-- (rename the debian processing version to work) -->
<move file="linux/debian/opt/processing" tofile="linux/work" />
<!-- cleanup -->
<delete dir="linux/debian" />
<echo>
========================================================
Processing for Debian Linux was built. Grab the deb from
${linux.deb}
========================================================
</echo>
</target>
<!-- - - - - - - - -->
<!-- Windows -->
<!-- - - - - - - - -->
<target name="windows-clean" depends="subprojects-clean"
description="Clean windows version">
<delete dir="windows/work" />
<delete>
<fileset dir="windows" includes="processing-*zip" />
</delete>
</target>
<target name="windows-check-os" unless="windows">
<!-- Left for consistency. Windows can be built on mac, linux, or windows. -->
</target>
<target name="windows-build" depends="ignore-tools, revision-check, windows-check-os, jdk-download, jfx-download, subprojects-build" description="Build Windows version">
<mkdir dir="windows/work" />
<!-- assemble the pde -->
<mkdir dir="windows/work/lib" />
<copy todir="windows/work/lib" flatten="true" preservelastmodified="true">
<fileset refid="runtime.jars" />
</copy>
<!-- unpack the JNA DLLs for Windows to work around
https://github.com/processing/processing/issues/3624 -->
<condition property="jna.subfolder" value="win32-x86">
<equals arg1="${jdk.data.model}" arg2="32" />
</condition>
<condition property="jna.subfolder" value="win32-x86-64">
<equals arg1="${jdk.data.model}" arg2="64" />
</condition>
<unzip src="../app/lib/jna.jar" dest="windows/work/lib">
<patternset>
<include name="com/sun/jna/${jna.subfolder}/jnidispatch.dll" />
</patternset>
<mapper type="flatten"/>
</unzip>
<copy todir="windows/work" preservelastmodified="true">
<fileset dir=".." includes="core/library/**" />
<fileset dir="shared" includes="launch4j/**" />
<fileset dir="shared" includes="lib/**" />
<fileset dir="shared" includes="modes/**" />
<fileset file="shared/changes.md" />
</copy>
<preparejfx />
<!-- Pull in OpenJFX (separated from mainline Java in JDK 11). -->
<if>
<equals arg1="${jfx.available}" arg2="true" />
<then>
<!-- Use native copy command due to binary file corruption. See
https://ant.apache.org/manual/Tasks/copy.html#encoding. Extraneous
files removed later. -->
<nativecopy
src="${jfx.path.lib}/*.jar"
dest="windows/work/core/library" />
<nativecopy
src="${jfx.path.dist}/bin/*.dll"
dest="windows/work/core/library" />
<mkdir dir="windows/work/java/legal/openjfx" />
<copy todir="windows/work/java/legal/openjfx" overwrite="true">
<fileset dir="${jfx.path.dist}/legal" includes="**"/>
</copy>
<delete failonerror="false" dir="${jfx.path.dist}" />
</then>
</if>
<fixcrlf file="windows/work/changes.md" eol="crlf" encoding="UTF-8" />
<antcall target="assemble">
<param name="target.path" value="windows/work" />
</antcall>
<property name="launch4j.dir" value="windows/work/modes/java/application/launch4j" />
<!-- rename the version we need -->
<move file="${launch4j.dir}/bin/windres-windows.exe"
tofile="${launch4j.dir}/bin/windres.exe" />
<move file="${launch4j.dir}/bin/ld-windows.exe"
tofile="${launch4j.dir}/bin/ld.exe" />
<!-- check for cross-build -->
<if>
<not><equals arg1="${host-platform}" arg2="windows" /></not>
<then>
<move file="${launch4j.dir}/bin/windres-${host-platform}"
tofile="${launch4j.dir}/bin/windres" />
<move file="${launch4j.dir}/bin/ld-${host-platform}"
tofile="${launch4j.dir}/bin/ld" />
<exec executable="chmod">
<arg value="+x"/>
<arg line="${launch4j.dir}/bin/windres"/>
</exec>
<exec executable="chmod">
<arg value="+x"/>
<arg line="${launch4j.dir}/bin/ld"/>
</exec>
</then>
</if>
<!-- Execute launch4j task -->
<taskdef name="launch4j"
classname="net.sf.launch4j.ant.Launch4jTask"
classpath="${launch4j.dir}/launch4j.jar; ${launch4j.dir}/lib/xstream.jar" />
<!-- not all launch4j options are available when embedded inside this
file (i.e. the icon param doesn't work), so use a config file -->
<launch4j configFile="windows/config.xml" />
<launch4j configFile="windows/config-cmd.xml" />
<!-- remove the other launch4j executables -->
<delete failonerror="true">
<fileset dir="${launch4j.dir}/bin" includes="ld-*" />
<fileset dir="${launch4j.dir}/bin" includes="windres-*" />
<fileset dir="${launch4j.dir}/bin" includes="windres" />
<fileset dir="${launch4j.dir}/bin" includes="ld" />
</delete>
<!-- cygwin requires html, dll, and exe to have the +x flag -->
<chmod perm="ugo+x">
<fileset dir="windows/work" includes="**/*.html, **/*.dll, **/*.exe" />
</chmod>
<!-- starting with 2.0a7, require the local JRE + tools.jar -->
<!--
<get src="http://download.processing.org/java/${jdk.file}"
dest="windows/jdk.tgz"
usetimestamp="true" />
-->
<!--
<unzip dest="windows/work" src="windows/jdk.zip" overwrite="false"/>
-->
<!-- Hopefully this is OK with the permissions (unlike Linux),
since those shouldn't matter on Windows. -->
<unzip dest="windows/work"
src="${jdk.tgz.path}"
overwrite="false" />
<property name="jdk.dir" value="windows/work/jdk-${jdk.esoteric}+${jdk.build}/" />
<move file="${jdk.dir}" tofile="windows/work/java" />
<!-- Remove unused JRE bloat. -->
<delete failonerror="true">
<!--
<fileset refid="javafx-basics" />
<fileset refid="javafx-windows" />
-->
<fileset refid="jdk-optional-windows" />
</delete>
</target>
<target name="windows-run" depends="windows-build"
description="Run windows version">
<exec executable="windows/work/processing.exe"
dir="windows/work" spawn="true"/>
</target>
<target name="windows-dist" depends="windows-build"
description="Create .zip files of windows version">
<!--
<zip basedir="windows/work"
prefix="processing-${version}"
destfile="windows/processing-${version}.zip" />
<zip basedir="windows/work"
prefix="processing-${version}"
destfile="windows/processing-${version}-expert.zip"
excludes="java/**" />
-->
<property name="windows.dist" value="windows/processing-${version}-windows${jdk.data.model}.zip" />
<zip destfile="${windows.dist}">
<zipfileset dir="windows/work"
prefix="processing-${version}" />
</zip>
<!-- Expert is too much of a headache. Just nix it for 2.0. -->
<!--
<zip destfile="windows/processing-${version}-windows-expert.zip">
<zipfileset dir="windows/work"
prefix="processing-${version}"
excludes="java/**" />
</zip>
-->
<echo>
=======================================================
Processing for Windows was built. Grab the archive from
${windows.dist}
=======================================================
</echo>
</target>
<!-- bundle a bunch of PNGs into an OS X iconset -->
<target name="iconset">
<mkdir dir="${icon.set}" />
<!--<echo message="root = ${icon.root} / set = ${icon.set}" />-->
<copy file="${icon.root}-16.png"
tofile="${icon.set}/icon_16x16.png" />
<copy file="${icon.root}-32.png"
tofile="${icon.set}/icon_16x16@2x.png" />
<copy file="${icon.root}-32.png"
tofile="${icon.set}/icon_32x32.png" />
<copy file="${icon.root}-64.png"
tofile="${icon.set}/icon_32x32@2x.png" />
<copy file="${icon.root}-128.png"
tofile="${icon.set}/icon_128x128.png" />
<copy file="${icon.root}-256.png"
tofile="${icon.set}/icon_128x128@2x.png" />
<copy file="${icon.root}-256.png"
tofile="${icon.set}/icon_256x256.png" />
<copy file="${icon.root}-512.png"
tofile="${icon.set}/icon_256x256@2x.png" />
<copy file="${icon.root}-512.png"
tofile="${icon.set}/icon_512x512.png" />
<copy file="${icon.root}-1024.png"
tofile="${icon.set}/icon_512x512@2x.png" />
<exec executable="iconutil" logError="true">
<arg line="-c icns -o ${icon.icns} ${icon.set}" />
</exec>
<delete dir="${icon.set}" />
</target>
<!-- Target to create the icons... putting this in here rather than docs.
For OS X (though Linux might work), not intended for general use,
because it requires things like iconutil (on OS X) or ImageMagick's
convert tool (primarily in *nix environments). -->
<target name="icons">
<property name="icon.set" value="/tmp/pde.iconset" />
<!-- create iconset for the PDE application for Mac OS X -->
<antcall target="iconset">
<param name="icon.root" value="shared/lib/icons/pde" />
<param name="icon.icns" value="macosx/processing.icns" />
</antcall>
<!-- create iconset for exported sketch on Mac OS X -->
<antcall target="iconset">
<param name="icon.root" value="../core/src/icon/icon" />
<param name="icon.icns" value="../java/application/sketch.icns" />
</antcall>
<!-- Create .ico for the PDE itself
https://msdn.microsoft.com/en-us/library/dn742485.aspx
"Application icons and Control Panel items: The full set includes
16x16, 32x32, 48x48, and 256x256 (code scales between 32 and 256).
The .ico file format is required. For Classic Mode, the full set
is 16x16, 24x24, 32x32, 48x48 and 64x64."
We're missing size 24x24, but, eh... -->
<exec executable="convert" dir="shared/lib/icons">
<arg line="pde-16.png pde-32.png pde-48.png pde-64.png pde-256.png ../../../windows/application.ico" />
</exec>
<!-- Create .ico for exported Java applications -->
<exec executable="convert" dir="../core/src/icon">
<arg line="icon-16.png icon-32.png icon-48.png icon-64.png icon-256.png ../../../java/application/sketch.ico" />
</exec>
</target>
<!-- - - - - - - - - - - - - - - - - - -->
<!-- Package source 'n tag the release -->
<!-- - - - - - - - - - - - - - - - - - -->
<!--
not ready to automate this yet, since we often have to reset the tag
<target name="dist-src" depends="dist">
<exec executable="git">
remove the spaces for depth since it should be double dash, but screws up comments
<arg line="clone - -depth 1 git@github.com:processing/processing.git /tmp/processing-${version}-src" />
</exec>
</target>
-->
<!-- - - - - - - - - -->
<!-- Developer Docs -->
<!-- - - - - - - - - -->
<target name="doc">
<mkdir dir="javadoc" />
<!-- Core is in the classpath, so we must build it. -->
<subant buildpath="../core" target="build" failonerror="false" />
<!-- build doc for core -->
<exec executable="find" dir="javadoc" errorproperty="ignored">
<arg line="core -type f -exec rm -rf {} ';'" />
</exec>
<javadoc access="public" author="false" classpath="../core/library/jogl-all.jar:../core/bin:../core/library/gluegen-rt.jar" destdir="javadoc/core" nodeprecated="false" nodeprecatedlist="false" noindex="false" nonavbar="false" notree="false" source="1.8" splitindex="false" use="false" version="false">
<!-- provide links for java.* classes.
also suppresses the java.lang prefix in the text. -->
<link href="http://docs.oracle.com/javase/7/docs/api/" />
<!-- prevent files from always appearing to have changed -->
<arg value="-notimestamp" />
<arg value="-quiet" />
<!-- Suppress errors and display some information. -->
<tag name="webref" enabled="false" />
<tag name="nowebref" enabled="false" />
<tag name="generate" enabled="false" />
<tag name="instanceName" enabled="false" />
<tag name="see_external" enabled="false" />
<tag name="brief" description="In brief:" />
<tag name="usage" />
<arg value="-Xdoclint:reference,accessibility" />
<packageset dir="../core/src">
<include name="processing/**" />
</packageset>
</javadoc>
<!--
<copy file="javadoc/stylesheet.css"
tofile="javadoc/core/stylesheet.css" />
<copy file="javadoc/index.html"
tofile="javadoc/core/index.html" />
-->
<!-- build everything else -->
<exec executable="find" dir="javadoc" errorproperty="ignored">
<arg line="everything -type f -exec rm -rf {} ';'" />
</exec>
<javadoc access="public" author="false" classpath="../app/lib/ant.jar:../app/lib/ant-launcher.jar:../app/lib/antlr-4.7.2-complete.jar:../app/lib/apple.jar:../app/lib/jna.jar:../app/lib/jna-platform.jar:../core/bin:../core/library/gluegen-rt.jar:../core/library/jogl-all.jar:../java/libraries/svg:../java/libraries/pdf/library/itext.jar:../java/libraries/dxf:../java/libraries/serial/library:${java.home}/lib/tools.jar" destdir="javadoc/everything" nodeprecated="false" nodeprecatedlist="false" noindex="false" nonavbar="false" notree="false" source="1.8" splitindex="false" use="false" version="false" noqualifier="all">
<arg value="-notimestamp" />
<arg value="-quiet" />
<link href="http://docs.oracle.com/javase/7/docs/api/" />
<packageset dir="../app/src">
<include name="antlr/**" />
<include name="processing/**" />
</packageset>
<tag name="webref" enabled="false" />
<tag name="nowebref" enabled="false" />
<tag name="generate" enabled="false" />
<tag name="instanceName" enabled="false" />
<tag name="see_external" enabled="false" />
<tag name="brief" description="In brief:" />
<tag name="usage" />
<arg value="-Xdoclint:reference,accessibility" />
<!--<packageset dir="../app/generated">
<include name="processing/**" />
</packageset>-->
<packageset dir="../core/src">
<include name="processing/**" />
<!--
<include name="japplemenubar/**" />
-->
</packageset>
</javadoc>
<!-- do libraries -->
<exec executable="find" dir="javadoc" errorproperty="ignored">
<arg line="libraries -type f -exec rm -rf {} ';'" />
</exec>
<javadoc access="public" author="false" classpath="../app/lib/ant.jar:../app/lib/ant-launcher.jar:../app/lib/antlr-4.7.2-complete.jar:../app/lib/apple.jar:../app/lib/jna.jar:../app/lib/jna-platform.jar:../core/bin:../core/library/gluegen-rt.jar:../core/library/jogl-all.jar:../java/libraries/svg/library/batik-dom-1.8.jar:../java/libraries/svg/library/batik-svggen-1.8.jar:../java/libraries/pdf/library/itext.jar:../java/libraries/dxf:../java/libraries/serial/library/jssc.jar:${java.home}/lib/tools.jar" destdir="javadoc/libraries" nodeprecated="false" nodeprecatedlist="false" noindex="false" nonavbar="false" notree="false" source="1.8" splitindex="false" use="false" version="false" noqualifier="all">
<arg value="-notimestamp" />
<arg value="-quiet" />
<link href="http://docs.oracle.com/javase/7/docs/api/" />
<link href="../../javadoc/core/" />
<tag name="webref" enabled="false" />
<tag name="nowebref" enabled="false" />
<tag name="generate" enabled="false" />
<tag name="instanceName" enabled="false" />
<tag name="see_external" enabled="false" />
<tag name="brief" description="In brief:" />
<tag name="usage" />
<arg value="-Xdoclint:reference,accessibility" />
<packageset dir="../java/libraries/dxf/src">
<include name="antlr/**" />
<include name="processing/**" />
</packageset>
<packageset dir="../java/libraries/io/src">
<include name="antlr/**" />
<include name="processing/**" />
</packageset>
<packageset dir="../java/libraries/net/src">
<include name="antlr/**" />
<include name="processing/**" />
</packageset>
<packageset dir="../java/libraries/pdf/src">
<include name="antlr/**" />
<include name="processing/**" />
</packageset>
<packageset dir="../java/libraries/serial/src">
<include name="antlr/**" />
<include name="processing/**" />
</packageset>
<packageset dir="../java/libraries/svg/src">
<include name="antlr/**" />
<include name="processing/**" />
</packageset>
</javadoc>
<!--
<copy file="javadoc/stylesheet.css"
tofile="javadoc/everything/stylesheet.css" />
<copy file="javadoc/index.html"
tofile="javadoc/everything/index.html" />
-->
<!-- set the MIME type so that Google Code shows the files properly -->
<!--
<exec executable="find" dir=".">
<arg line="javadoc -name '*.html' -exec svn propset svn:mime-type text/html {} ';'" />
</exec>
-->
</target>
<!-- no longer necessary because it comes straight from Google Code -->
<!--
<target name="doc-upload">
<exec executable="rsync" dir="javadoc" spawn="true">
<arg value="-avz" />
<arg value="- -delete" />
<arg value="core/" />
<arg value="fry@processing.org:dev/reference/core/javadoc/" />
</exec>
<exec executable="rsync" dir="javadoc" spawn="true">
<arg value="-avz" />
<arg value="- -delete" />
<arg value="everything/" />
<arg value="fry@processing.org:dev/reference/core/everything/" />
</exec>
rsync -avz - -delete core/ fry@processing.org:dev/reference/core/javadoc/
rsync -avz - -delete everything/ fry@processing.org:dev/reference/everything/javadoc/
</target>
-->
<!-- - - - - - - - -->
<!-- Run It! -->
<!-- - - - - - - - -->
<target name="clean" description="Perform a spring cleaning"
depends="linux-clean, windows-clean, macosx-clean, subprojects-clean">
</target>
</project>