mirror of
https://github.com/processing/processing4.git
synced 2026-02-03 05:39:18 +01:00
748 lines
24 KiB
XML
748 lines
24 KiB
XML
<?xml version="1.0"?>
|
|
<project name="Processing" default="build">
|
|
|
|
<!-- Sets properties for macosx/windows/linux depending on current system -->
|
|
<condition property="macosx"><os family="mac" /></condition>
|
|
<condition property="windows"><os family="windows" /></condition>
|
|
<condition property="linux"><os family="unix" /></condition>
|
|
|
|
<condition property="platform"
|
|
value="macosx"><os family="mac" /> </condition>
|
|
<condition property="platform"
|
|
value="windows"><os family="windows" /> </condition>
|
|
<condition property="platform"
|
|
value="linux"><os family="unix" /> </condition>
|
|
|
|
<!-- <echo message="" />-->
|
|
|
|
<property environment="env" />
|
|
<condition property="codesign">
|
|
<equals arg1="${env.USER}" arg2="fry" />
|
|
</condition>
|
|
|
|
<condition property="target.path"
|
|
value="macosx/work/Processing.app/Contents/Resources/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 -->
|
|
<fileset dir=".." id="runtime.jars">
|
|
<!--<include name="core/library/core.jar" />-->
|
|
<include name="app/pde.jar" />
|
|
<include name="app/lib/antlr.jar" />
|
|
<include name="app/lib/ecj.jar" />
|
|
<include name="app/lib/jna.jar" />
|
|
<include name="app/lib/ant.jar" />
|
|
<include name="app/lib/ant-launcher.jar" />
|
|
</fileset>
|
|
|
|
<target name="build" description="Build Processing.">
|
|
<antcall target="${platform}-build" />
|
|
</target>
|
|
|
|
<target name="run" description="Run Processing.">
|
|
<antcall target="${platform}-run" />
|
|
</target>
|
|
|
|
<target name="dist" depends="revision-check"
|
|
description="Build Processing for distribution.">
|
|
<input message="Enter version number:"
|
|
addproperty="version"
|
|
defaultvalue="${revision}" />
|
|
<antcall target="${platform}-dist" />
|
|
</target>
|
|
|
|
<target name="android-dist-check">
|
|
<!-- ensure that the android-core.zip file has been built -->
|
|
<available file="${target.path}/modes/android/android-core.zip"
|
|
property="android-core-present" />
|
|
<!--<echo message="${target.path}/modes/android/android-core.zip" />-->
|
|
<fail unless="android-core-present"
|
|
message="android-core.zip was not built, but is required for dist. Install the Android tools, set ANDROID_SDK, and try again." />
|
|
</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/net" target="clean"/>
|
|
<subant buildpath="../java/libraries/pdf" target="clean"/>
|
|
<subant buildpath="../java/libraries/serial" target="clean"/>
|
|
<subant buildpath="../java/libraries/video" target="clean"/>
|
|
<subant buildpath="../android/core" target="clean"/>
|
|
<subant buildpath="shared/tools/MovieMaker" target="clean"/>
|
|
</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/video" target="build"/>
|
|
<subant buildpath="../android/core" target="build"/>
|
|
<subant buildpath="shared/tools/MovieMaker" 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">
|
|
<fileset dir="shared/tools" />
|
|
</copy>
|
|
|
|
<copy todir="${target.path}/modes/java">
|
|
<fileset dir="../java">
|
|
<!--
|
|
<exclude name="**/bin/*" />
|
|
<exclude name="**/src/*" />
|
|
<exclude name="examples" />
|
|
-->
|
|
<exclude name="**/cmd/**" />
|
|
<exclude name="reference.zip" />
|
|
<exclude name="**/._*" />
|
|
|
|
<exclude name="examples/**/applet/**" />
|
|
</fileset>
|
|
</copy>
|
|
|
|
<!-- decided against this.
|
|
see: http://code.google.com/p/processing/issues/detail?id=650 -->
|
|
<!--
|
|
<get src="http://www.java.com/js/deployJava.js"
|
|
dest="${target.path}/modes/java/applet/deployJava.js"
|
|
usetimestamp="true" />
|
|
-->
|
|
|
|
<delete dir="${target.path}/modes/java/examples">
|
|
<include name="**/applet/**" />
|
|
</delete>
|
|
<!--
|
|
<delete>
|
|
<fileset dir="${target.path}/modes/java/examples"
|
|
includes="**/applet/**" />
|
|
</delete>
|
|
-->
|
|
|
|
<!--
|
|
not happy on windows, since cygwin may not be installed
|
|
<exec executable="find" dir="${target.path}/modes/java/examples"
|
|
errorproperty="ignored">
|
|
<arg line=". -name applet -exec rm -rf {} ';'" />
|
|
</exec>
|
|
-->
|
|
|
|
<!--
|
|
<copy todir="${target.path}/modes/java/examples">
|
|
<fileset dir="../java/examples">
|
|
<exclude name="**/applet/**" />
|
|
</fileset>
|
|
</copy>
|
|
-->
|
|
|
|
<copy todir="${target.path}/modes/javascript">
|
|
<fileset dir="../javascript">
|
|
<exclude name="**/._*" />
|
|
</fileset>
|
|
</copy>
|
|
|
|
<copy todir="${target.path}/modes/android">
|
|
<fileset dir="../android">
|
|
<include name="android-core.zip" />
|
|
<include name="examples/**" />
|
|
<include name="icons/**" />
|
|
<include name="theme/**" />
|
|
<include name="keywords.txt" />
|
|
<!--
|
|
<exclude name="**/bin/**" />
|
|
<exclude name="**/src/**" />
|
|
<exclude name="cmd" />
|
|
<exclude name="reference.zip" />
|
|
-->
|
|
<exclude name="**/._*" />
|
|
</fileset>
|
|
</copy>
|
|
|
|
<!-- copy libraries -->
|
|
<!--
|
|
<copy todir="${target.path}/modes/java/libraries">
|
|
<fileset dir="../java/libraries">
|
|
<include name="**/library/**" />
|
|
<include name="**/src/**" />
|
|
</fileset>
|
|
</copy>
|
|
-->
|
|
|
|
<!-- copy shared library folder -->
|
|
<!--
|
|
<copy todir="${target.path}/modes/java/libraries">
|
|
<fileset dir="shared/modes/java/libraries" />
|
|
</copy>
|
|
-->
|
|
|
|
<!-- copy libraries for dxf, pdf, etc. -->
|
|
<!--
|
|
<copy todir="${target.path}/modes/java/libraries/dxf">
|
|
<fileset dir="../dxf" includes="library/**,src/**" />
|
|
</copy>
|
|
<copy todir="${target.path}/modes/java/libraries/net">
|
|
<fileset dir="../net" includes="library/**,src/**" />
|
|
</copy>
|
|
<copy todir="${target.path}/modes/java/libraries/pdf">
|
|
<fileset dir="../pdf" includes="library/**,src/**" />
|
|
</copy>
|
|
<copy todir="${target.path}/modes/java/libraries/serial">
|
|
<fileset dir="../serial" includes="library/**,src/**" />
|
|
</copy>
|
|
<copy todir="${target.path}/modes/java/libraries/video">
|
|
<fileset dir="../video" includes="library/**,src/**" />
|
|
</copy>
|
|
-->
|
|
|
|
<!-- Unzip documentation + examples -->
|
|
<!--
|
|
<unzip dest="${target.path}/modes/java"
|
|
src="shared/modes/java/examples.zip"
|
|
overwrite="false">
|
|
<patternset>
|
|
<exclude name="__MACOSX/**" />
|
|
<exclude name="**/._*" />
|
|
</patternset>
|
|
</unzip>
|
|
-->
|
|
<unzip dest="${target.path}/modes/java"
|
|
src="../java/reference.zip"
|
|
overwrite="false">
|
|
<patternset>
|
|
<exclude name="__MACOSX/**" />
|
|
<exclude name="**/._*" />
|
|
</patternset>
|
|
</unzip>
|
|
|
|
<!-- Write the revision file -->
|
|
<!-- is there a good way to do this? -->
|
|
<!--
|
|
<echo file="${target.path}/lib/version.txt"
|
|
message="${version}"
|
|
if="${version}" />
|
|
<delete file="${target.path}/lib/version.txt"
|
|
unless="${version}" />
|
|
-->
|
|
</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 dir="macosx/working_dir" />
|
|
<delete dir="macosx/working.dmg" />
|
|
<delete file="macosx/processing-*.dmg" />
|
|
</target>
|
|
|
|
<target name="macosx-checkos" unless="macosx">
|
|
<echo>
|
|
=======================================================
|
|
Processing for Mac OS X can only be built on Mac OS X.
|
|
|
|
Bye.
|
|
=======================================================
|
|
</echo>
|
|
<fail message="wrong platform (${os.name})" />
|
|
</target>
|
|
|
|
<target name="macosx-build" if="macosx" depends="revision-check, macosx-checkos, subprojects-build" description="Build Mac OS X version">
|
|
<mkdir dir="macosx/work" />
|
|
|
|
<!-- assemble the pde -->
|
|
<copy todir="macosx/work">
|
|
<fileset dir="macosx/" includes="template.app/**"/>
|
|
</copy>
|
|
|
|
<!-- <rename src="macosx/work/template.app"
|
|
dest="macosx/work/Processing.app" />-->
|
|
<move file="macosx/work/template.app"
|
|
tofile="macosx/work/Processing.app" />
|
|
|
|
<chmod file="macosx/work/Processing.app/Contents/MacOS/JavaApplicationStub" perm="ugo+x" />
|
|
|
|
<copy todir="macosx/work/Processing.app/Contents/Resources/Java" flatten="true">
|
|
<fileset refid="runtime.jars"/>
|
|
</copy>
|
|
|
|
<copy todir="macosx/work/Processing.app/Contents/Resources/Java">
|
|
<fileset dir=".." includes="core/library/**" />
|
|
<fileset dir="shared" includes="launch4j/**" />
|
|
<fileset dir="shared" includes="lib/**" />
|
|
<fileset dir="shared" includes="modes/**" />
|
|
<fileset file="shared/revisions.txt" />
|
|
</copy>
|
|
|
|
<property name="launch4j.dir" value="macosx/work/Processing.app/Contents/Resources/Java/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>
|
|
<fileset dir="${launch4j.dir}/bin" includes="ld-*" />
|
|
<fileset dir="${launch4j.dir}/bin" includes="windres-*" />
|
|
</delete>
|
|
|
|
<antcall target="assemble">
|
|
<param name="target.path" value="macosx/work/Processing.app/Contents/Resources/Java" />
|
|
</antcall>
|
|
</target>
|
|
|
|
<target name="macosx-run" depends="macosx-build" description="Run Mac OS X version">
|
|
<exec executable="macosx/work/Processing.app/Contents/MacOS/JavaApplicationStub" spawn="true"/>
|
|
</target>
|
|
|
|
<target name="macosx-dist-sign" if="codesign">
|
|
<echo>
|
|
It code signing fails, may need to use:
|
|
export CODESIGN_ALLOCATE="/Applications/Xcode.app/Contents/Developer/usr/bin/codesign_allocate"
|
|
</echo>
|
|
<exec executable="codesign" dir="macosx/work">
|
|
<arg value="--force" />
|
|
<arg value="--sign" />
|
|
<arg value="Developer ID Application" />
|
|
<arg value="Processing.app" />
|
|
</exec>
|
|
</target>
|
|
|
|
<target name="macosx-dist" if="macosx"
|
|
depends="macosx-build,android-dist-check"
|
|
description="Create a downloadable .zip for the Mac OS X version">
|
|
|
|
<!-- The ant copy command does not preserve permissions. -->
|
|
<chmod file="macosx/work/Processing.app/Contents/MacOS/JavaApplicationStub" perm="ugo+x" />
|
|
|
|
<replace file="macosx/work/Processing.app/Contents/Info.plist"
|
|
token="VERSION" value="${version}" />
|
|
<replace file="macosx/work/Processing.app/Contents/Info.plist"
|
|
token="REVISION" value="${revision}" />
|
|
|
|
<antcall target="macosx-dist-sign" />
|
|
|
|
<exec executable="ditto" dir="macosx/work">
|
|
<arg line="-c -k -rsrc . ../processing-${version}-macosx.zip" />
|
|
</exec>
|
|
|
|
<echo>
|
|
=======================================================
|
|
Processing for Mac OS X was built. Grab it from
|
|
|
|
macosx/processing-${version}-macosx.zip
|
|
=======================================================
|
|
</echo>
|
|
</target>
|
|
|
|
<target name="macosx-dist-old" if="macosx" depends="macosx-build" description="Create a .dmg of the Mac OS X version">
|
|
<!-- now build the dmg -->
|
|
<gunzip src="macosx/template.dmg.gz" dest="macosx/working.dmg" />
|
|
|
|
<mkdir dir="macosx/working_dir" />
|
|
<exec executable="hdiutil">
|
|
<arg line="attach macosx/working.dmg -noautoopen -mountpoint macosx/working_dir" />
|
|
<!--<arg line="attach macosx/working.dmg -noautoopen -quiet -mountpoint macosx/working_dir" />-->
|
|
</exec>
|
|
|
|
<copy todir="macosx/working_dir">
|
|
<fileset dir="macosx/work" />
|
|
</copy>
|
|
|
|
<!-- The ant copy command does not preserve permissions. -->
|
|
<chmod file="macosx/working_dir/Processing.app/Contents/MacOS/JavaApplicationStub" perm="ugo+x" />
|
|
|
|
<!-- Pause briefly for the OS to catch up with the DMG changes.
|
|
This prevents "hdiutil: couldn't eject "disk3" - Resource busy"
|
|
errors when ejecting the disk in the next step.
|
|
You may need to set this value higher for your system. -->
|
|
<!-- <sleep seconds="5" />-->
|
|
|
|
<!-- while building 0182, had a lot of trouble with the disk eject -->
|
|
<input message="Manually eject the Processing volume and hit return." />
|
|
|
|
<!-- used -quiet -force in the dist.sh version -->
|
|
<!--
|
|
<exec executable="hdiutil">
|
|
<arg line="detach macosx/working_dir" />
|
|
</exec>
|
|
-->
|
|
|
|
<delete file="macosx/processing-*.dmg" />
|
|
<exec executable="hdiutil">
|
|
<arg line="convert macosx/working.dmg -format UDZO -imagekey zlib-level=9 -o macosx/processing-${version}.dmg" />
|
|
</exec>
|
|
|
|
<!-- Clean up the interim files. -->
|
|
<delete file="macosx/working.dmg" />
|
|
<delete dir="macosx/working_dir" />
|
|
|
|
<echo>
|
|
=======================================================
|
|
Processing for Mac OS X was built. Grab the image from
|
|
|
|
macosx/processing-${version}.dmg
|
|
=======================================================
|
|
</echo>
|
|
</target>
|
|
|
|
|
|
<!-- - - - - - - - -->
|
|
<!-- Linux -->
|
|
<!-- - - - - - - - -->
|
|
|
|
<target name="linux-clean" depends="subprojects-clean" description="Clean linux version">
|
|
<delete dir="linux/work" />
|
|
</target>
|
|
|
|
<target name="linux-checkos" unless="linux">
|
|
<echo>
|
|
=======================================================
|
|
Processing for Linux can only be built on on unix systems.
|
|
|
|
Bye.
|
|
=======================================================
|
|
</echo>
|
|
|
|
<fail message="wrong platform (${os.name})" />
|
|
</target>
|
|
|
|
<target name="linux-build" depends="revision-check, linux-checkos, subprojects-build" description="Build linux version">
|
|
<mkdir dir="linux/work" />
|
|
|
|
<copy todir="linux/work">
|
|
<fileset dir=".." includes="core/library/**" />
|
|
<fileset dir="shared" includes="launch4j/**" />
|
|
<fileset dir="shared" includes="lib/**" />
|
|
<fileset dir="shared" includes="modes/**" />
|
|
<fileset file="shared/revisions.txt" />
|
|
</copy>
|
|
|
|
<property name="launch4j.dir" value="linux/work/launch4j" />
|
|
|
|
<!-- rename the version we need -->
|
|
<move file="${launch4j.dir}/bin/windres-linux${sun.arch.data.model}"
|
|
tofile="${launch4j.dir}/bin/windres" />
|
|
<move file="${launch4j.dir}/bin/ld-linux${sun.arch.data.model}"
|
|
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>
|
|
<fileset dir="${launch4j.dir}/bin" includes="ld-*" />
|
|
<fileset dir="${launch4j.dir}/bin" includes="windres-*" />
|
|
</delete>
|
|
|
|
<copy todir="linux/work/lib" flatten="true">
|
|
<fileset refid="runtime.jars" />
|
|
</copy>
|
|
|
|
<antcall target="assemble">
|
|
<param name="target.path" value="linux/work" />
|
|
</antcall>
|
|
|
|
<copy todir="linux/work" file="linux/processing" />
|
|
<chmod perm="ugo+x" file="linux/work/processing" />
|
|
|
|
<property name="jre.file"
|
|
value="jre-tools-6u33-linux${sun.arch.data.model}.tgz" />
|
|
|
|
<get src="http://processing.googlecode.com/files/${jre.file}"
|
|
dest="linux/jre.tgz"
|
|
usetimestamp="true" />
|
|
|
|
<!--
|
|
Cannot use ant version of tar because it doesn't preserve properties.
|
|
<untar compression="gzip"
|
|
dest="linux/work"
|
|
src="linux/jre.tgz"
|
|
overwrite="false"/>
|
|
-->
|
|
|
|
<!--
|
|
http://www.gnu.org/software/tar/manual/html_section/transform.html
|
|
-->
|
|
<exec executable="tar">
|
|
<arg value="-C" /> <!-- Change directory -->
|
|
<arg value="linux/work" />
|
|
<arg value="-xzpf" />
|
|
<arg value="linux/jre.tgz"/>
|
|
</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,android-dist-check"
|
|
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${sun.arch.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>
|
|
|
|
|
|
<!-- - - - - - - - -->
|
|
<!-- Windows -->
|
|
<!-- - - - - - - - -->
|
|
|
|
<target name="windows-clean" depends="subprojects-clean"
|
|
description="Clean windows version">
|
|
<delete dir="windows/work" />
|
|
</target>
|
|
|
|
<target name="windows-checkos" unless="windows">
|
|
<echo>
|
|
=======================================================
|
|
Processing for Windows can only be built on windows.
|
|
|
|
Bye.
|
|
=======================================================
|
|
</echo>
|
|
|
|
<fail message="wrong platform (${os.name})" />
|
|
</target>
|
|
|
|
<target name="windows-build"
|
|
depends="revision-check, windows-checkos, 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">
|
|
<fileset refid="runtime.jars" />
|
|
</copy>
|
|
|
|
<copy todir="windows/work">
|
|
<fileset dir=".." includes="core/library/**" />
|
|
<fileset dir="shared" includes="launch4j/**" />
|
|
<fileset dir="shared" includes="lib/**" />
|
|
<fileset dir="shared" includes="modes/**" />
|
|
<fileset file="shared/revisions.txt" />
|
|
</copy>
|
|
|
|
<fixcrlf srcdir="shared" eol="crlf" includes="revisions.txt" />
|
|
|
|
<property name="launch4j.dir" value="windows/work/launch4j" />
|
|
|
|
<!-- rename the version we need -->
|
|
<move file="${launch4j.dir}/bin/windres-windows32.exe"
|
|
tofile="${launch4j.dir}/bin/windres.exe" />
|
|
<move file="${launch4j.dir}/bin/ld-windows32.exe"
|
|
tofile="${launch4j.dir}/bin/ld.exe" />
|
|
|
|
<!-- remove the others -->
|
|
<delete>
|
|
<fileset dir="${launch4j.dir}/bin" includes="ld-*" />
|
|
<fileset dir="${launch4j.dir}/bin" includes="windres-*" />
|
|
</delete>
|
|
|
|
<antcall target="assemble">
|
|
<param name="target.path" value="windows/work" />
|
|
</antcall>
|
|
|
|
<taskdef name="launch4j"
|
|
classname="net.sf.launch4j.ant.Launch4jTask"
|
|
classpath="${launch4j.dir}/launch4j.jar; ${launch4j.dir}/lib/xstream.jar" />
|
|
|
|
<copy todir="windows/work">
|
|
<fileset dir="windows/launcher"
|
|
includes="about.bmp, application.ico, config.xml"/>
|
|
</copy>
|
|
<launch4j configFile="windows/work/config.xml" />
|
|
<delete dir="windows/work"
|
|
includes="about.bmp, application.ico, config.xml" />
|
|
|
|
<!-- 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 -->
|
|
<property name="jre.file"
|
|
value="jre-tools-6u33-windows${sun.arch.data.model}.zip" />
|
|
|
|
<get src="http://processing.googlecode.com/files/${jre.file}"
|
|
dest="windows/jre.zip"
|
|
usetimestamp="true" />
|
|
|
|
<unzip dest="windows/work" src="windows/jre.zip" overwrite="false"/>
|
|
</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,android-dist-check"
|
|
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${sun.arch.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>
|
|
|
|
|
|
<!-- - - - - - - - -->
|
|
<!-- Run It! -->
|
|
<!-- - - - - - - - -->
|
|
|
|
<target name="clean" description="Perform a spring cleaning"
|
|
depends="linux-clean, windows-clean, macosx-clean, subprojects-clean">
|
|
</target>
|
|
|
|
</project>
|