2010-05-08 23:47:19 +02:00
<?xml version="1.0"?>
<project name= "Arduino" default= "build" >
2011-02-17 02:21:43 +01:00
<!-- echo message="os.name = ${os.name}" / -->
<!-- echo message="os.arch = ${os.arch}" / -->
<!-- echo message="os.version = ${os.version}" / -->
2010-05-08 23:47:19 +02:00
<!-- 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>
2012-02-29 21:30:03 +01:00
<condition property= "linux32" > <os family= "unix" arch= "i386" /> </condition>
2011-02-17 02:21:43 +01:00
<condition property= "linux64" > <os family= "unix" arch= "amd64" /> </condition>
2010-05-08 23:47:19 +02:00
<condition property= "platform"
value="macosx"><os family= "mac" /> </condition>
<condition property= "platform"
value="windows"><os family= "windows" /> </condition>
<condition property= "platform"
2012-02-29 21:30:03 +01:00
value="linux32"><os family= "unix" arch= "i386" /> </condition>
2011-02-17 02:21:43 +01:00
<condition property= "platform"
value="linux64"><os family= "unix" arch= "amd64" /> </condition>
2010-05-08 23:47:19 +02:00
<!-- Libraries required for running arduino -->
<fileset dir= ".." id= "runtime.jars" >
<include name= "core/core.jar" />
<include name= "app/pde.jar" />
<include name= "app/lib/ecj.jar" />
<include name= "app/lib/jna.jar" />
<include name= "app/lib/RXTXcomm.jar" />
<include name= "app/lib/ant.jar" />
<include name= "app/lib/ant-launcher.jar" />
</fileset>
<target name= "build" description= "Build Arduino." >
<antcall target= "${platform}-build" />
</target>
<target name= "run" description= "Run Arduino." >
<antcall target= "${platform}-run" />
</target>
<target name= "dist" depends= "revision-check"
description="Build Arduino for distribution.">
<input message= "Enter version number:"
addproperty="version"
defaultvalue="${revision}" />
<antcall 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" />
</target>
<target name= "subprojects-build" >
<subant buildpath= "../core" target= "build" />
<subant buildpath= "../app" target= "build" />
</target>
<!-- - - - - - - - - -->
<!-- Basic Assembly -->
<!-- - - - - - - - - -->
<target name= "assemble" >
<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>
2012-01-09 18:20:55 +01:00
<!-- copy library folder -->
<copy todir= "${target.path}/libraries" >
<fileset dir= "../libraries" />
</copy>
2010-05-08 23:47:19 +02:00
<!-- copy hardware folder -->
<copy todir= "${target.path}/hardware" >
<fileset dir= "../hardware" />
</copy>
<!-- copy shared examples folder -->
<copy todir= "${target.path}/examples" >
<fileset dir= "shared/examples" />
</copy>
<!-- Unzip documentation -->
<unzip dest= "${target.path}" src= "shared/reference.zip" overwrite= "false" />
<!-- Write the revision file! -->
<echo file= "${target.path}/lib/version.txt" message= "${version}" />
</target>
<!-- - - - - - - - - -->
<!-- Revision check -->
<!-- - - - - - - - - -->
<target name= "revision-check" >
<!-- figure out the revision number -->
2013-01-24 14:42:51 +01:00
<loadfile srcfile= "shared/revisions.txt" property= "revision" >
2010-05-08 23:47:19 +02:00
<filterchain >
2013-01-24 14:42:51 +01:00
<ignoreblank />
<headfilter lines= "1" />
<tokenfilter >
<linetokenizer includeDelims= "false" />
<!-- grab the thing from the first line that's 4 digits -->
<containsregex pattern= "ARDUINO (.*) " />
<replaceregex pattern= "ARDUINO ([^ ]*).*" replace= "\1" />
</tokenfilter>
<tokenfilter >
<stringtokenizer suppressdelims= "true" />
</tokenfilter>
2010-05-08 23:47:19 +02:00
</filterchain>
</loadfile>
2013-01-24 14:42:51 +01:00
<echo message= "Latest revision detected in shared/revision.txt is: ${revision}" />
2010-05-08 23:47:19 +02:00
<!-- figure out the revision number in base.java -->
<loadfile srcfile= "../app/src/processing/app/Base.java"
property="revision.base">
<filterchain >
2013-01-24 14:42:51 +01:00
<tokenfilter >
<linetokenizer />
<containsregex pattern= "String VERSION_NAME = " />
<replaceregex pattern= "[^0-9]*" flags= "g" replace= "" />
</tokenfilter>
2010-05-08 23:47:19 +02:00
</filterchain>
</loadfile>
2013-01-24 14:42:51 +01:00
<echo message= "Revision in Base.java is: ${revision.base}" />
2010-05-08 23:47:19 +02:00
</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/arduino-*.dmg" />
</target>
<target name= "macosx-checkos" unless= "macosx" >
<echo >
=======================================================
Arduino for Mac OS X can only be built on Mac OS X.
Bye.
=======================================================
</echo>
<fail message= "wrong platform (${os.name})" />
</target>
2012-05-16 13:44:51 +02:00
<target name= "macosx-build" if= "macosx" depends= "revision-check, macosx-checkos, subprojects-build, macosx-check-arm-toolchain" description= "Build Mac OS X version" >
2010-05-08 23:47:19 +02:00
<mkdir dir= "macosx/work" />
<!-- assemble the pde -->
2011-10-10 17:49:08 +02:00
<copy todir= "macosx/work/Arduino.app" >
<fileset dir= "macosx/template.app" includes= "**" />
2010-05-08 23:47:19 +02:00
</copy>
<!-- <rename src="macosx/work/template.app"
2011-10-10 17:49:08 +02:00
dest="macosx/work/Arduino.app" />
2010-05-08 23:47:19 +02:00
<move file= "macosx/work/template.app"
2011-10-10 17:49:08 +02:00
tofile="macosx/work/Arduino.app" />-->
2010-05-08 23:47:19 +02:00
<chmod file= "macosx/work/Arduino.app/Contents/MacOS/JavaApplicationStub" perm= "755" />
<copy todir= "macosx/work/Arduino.app/Contents/Resources/Java" flatten= "true" >
<fileset refid= "runtime.jars" />
</copy>
<copy todir= "macosx/work/Arduino.app/Contents/Resources/Java" >
<fileset dir= "shared" includes= "lib/**" />
<fileset file= "shared/revisions.txt" />
</copy>
<!-- Unzip AVR tools -->
<!-- <unzip dest="macosx/work/Arduino.app/Contents/Resources/Java/hardware" src="macosx/dist/tools - universal.zip" overwrite="false"/> -->
2010-05-09 00:07:30 +02:00
2010-05-08 23:47:19 +02:00
<exec executable= "unzip" >
<arg value= "-q" />
2010-05-10 03:18:33 +02:00
<arg value= "-n" />
2010-05-08 23:47:19 +02:00
<arg value= "-d" />
<arg value= "macosx/work/Arduino.app/Contents/Resources/Java/hardware" />
<arg value= "macosx/dist/tools-universal.zip" />
</exec>
2010-05-09 00:07:30 +02:00
2012-05-11 22:29:42 +02:00
<copy todir= "macosx/work/Arduino.app/Contents/Resources/Java/hardware/tools/" >
<fileset file= "macosx/dist/bossac" />
</copy>
<chmod file= "macosx/work/Arduino.app/Contents/Resources/Java/hardware/tools/bossac" perm= "+x" />
2010-12-24 01:00:01 +01:00
<copy todir= "macosx/work/Arduino.app/Contents/Resources/Java/hardware/tools/avr/avr/include/avr" >
<fileset file= "macosx/dist/eeprom.h" />
</copy>
2010-05-08 23:47:19 +02:00
<antcall target= "assemble" >
<param name= "target.path" value= "macosx/work/Arduino.app/Contents/Resources/Java" />
</antcall>
2012-05-16 13:44:51 +02:00
2012-05-17 22:46:56 +02:00
<antcall target= "macosx-unzip-arm-toolchain" />
2010-05-08 23:47:19 +02:00
</target>
2010-05-09 00:07:30 +02:00
2010-05-08 23:47:19 +02:00
<target name= "macosx-run" depends= "macosx-build" description= "Run Mac OS X version" >
<exec executable= "macosx/work/Arduino.app/Contents/MacOS/JavaApplicationStub" spawn= "true" />
</target>
2011-06-07 03:48:12 +02:00
<target name= "macosx-debug" depends= "macosx-build" description= "Run Mac OS X version" >
<exec executable= "macosx/work/Arduino.app/Contents/MacOS/JavaApplicationStub" spawn= "false" />
</target>
2012-05-16 17:35:54 +02:00
<target name= "macosx-check-arm-toolchain-distfile" >
2012-05-17 22:56:28 +02:00
<available file= "macosx/dist/gcc-arm-none-eabi-4.4.1-2010q1-188-macos.tar.gz" property= "arm_distfile_available" />
2012-05-16 17:35:54 +02:00
</target>
<target name= "macosx-get-arm-toolchain" depends= "macosx-check-arm-toolchain-distfile" unless= "arm_distfile_available" >
<!-- Retrieve ARM toolchain -->
<get
src="http://arduino.googlecode.com/files/gcc-arm-none-eabi-4.4.1-2010q1-188-macos.tar.gz"
dest="macosx/dist/gcc-arm-none-eabi-4.4.1-2010q1-188-macos.tar.gz" verbose="true" />
</target>
2012-05-16 13:44:51 +02:00
<target name= "macosx-check-arm-toolchain" >
<available file= "macosx/work/Arduino.app/Contents/Resources/Java/hardware/tools/g++_arm_none_eabi"
property="arm_available" />
</target>
2012-05-16 17:35:54 +02:00
<target name= "macosx-unzip-arm-toolchain" depends= "macosx-get-arm-toolchain, macosx-check-arm-toolchain" unless= "arm_available" >
2012-05-16 13:44:51 +02:00
<checksum file= "macosx/dist/gcc-arm-none-eabi-4.4.1-2010q1-188-macos.tar.gz" algorithm= "sha"
fileext=".sha" verifyproperty="checksum.matches"/>
<condition property= "checksum.matches.fail" >
<equals arg1= "${checksum.matches}" arg2= "false" />
</condition>
2012-05-16 17:35:54 +02:00
<fail if= "checksum.matches.fail" > Checksum failed.
2012-05-16 13:44:51 +02:00
File gcc-arm-none-eabi-4.4.1-2010q1-188-macos.tar.gz failed checksum.
Please remove "macosx/dist/gcc-arm-none-eabi-4.4.1-2010q1-188-macos.tar.gz" to download it again.
</fail>
<!-- ...and unzip on the destination folder -->
<exec executable= "tar" output= "/dev/null" >
<arg value= "xfz" />
<arg value= "macosx/dist/gcc-arm-none-eabi-4.4.1-2010q1-188-macos.tar.gz" />
<arg value= "--directory=macosx/work/Arduino.app/Contents/Resources/Java/hardware/tools/" />
</exec>
</target>
2011-11-28 23:36:03 +01:00
<target name= "macosx-dist" if= "macosx" depends= "macosx-build" description= "Create a downloadable .zip for the Mac OS X version" >
<!-- The ant copy command does not preserve permissions. -->
<chmod file= "macosx/work/Arduino.app/Contents/MacOS/JavaApplicationStub" perm= "+x" />
<chmod perm= "+x" >
<fileset dir= "macosx/work/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin" includes= "**/*" />
<fileset dir= "macosx/work/Arduino.app/Contents/Resources/Java/hardware/tools/avr/avr/bin" includes= "**/*" />
<fileset dir= "macosx/work/Arduino.app/Contents/Resources/Java/hardware/tools/avr/avr-3/bin" includes= "**/*" />
<fileset dir= "macosx/work/Arduino.app/Contents/Resources/Java/hardware/tools/avr/avr-4/bin" includes= "**/*" />
<fileset dir= "macosx/work/Arduino.app/Contents/Resources/Java/hardware/tools/avr/libexec/gcc/avr/3.4.6/" includes= "**/cc1*" />
<fileset dir= "macosx/work/Arduino.app/Contents/Resources/Java/hardware/tools/avr/libexec/gcc/avr/4.3.2/" includes= "**/cc1*" />
</chmod>
<replace file= "macosx/work/Arduino.app/Contents/Info.plist"
token="VERSION" value="${version}" />
<replace file= "macosx/work/Arduino.app/Contents/Info.plist"
token="REVISION" value="${revision}" />
2012-05-26 19:07:31 +02:00
<exec executable= "zip" dir= "macosx/work" >
<arg line= "-q -r ../arduino-${version}-macosx.zip ." />
2011-11-28 23:36:03 +01:00
</exec>
2012-05-26 19:07:31 +02:00
<!-- <exec executable="ditto" dir="macosx/work">
<arg line= "-c -k -rsrc . ../arduino-${version}-macosx.zip" />
</exec> -->
2011-11-28 23:36:03 +01:00
<echo >
=======================================================
Arduino for Mac OS X was built. Grab the image from
macosx/arduino-${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" >
2010-05-08 23:47:19 +02:00
<!-- 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" >
2011-09-02 16:02:55 +02:00
<fileset dir= "macosx/work" />
2010-05-08 23:47:19 +02:00
</copy>
<!-- The ant copy command does not preserve permissions. -->
<chmod file= "macosx/working_dir/Arduino.app/Contents/MacOS/JavaApplicationStub" perm= "+x" />
2010-08-13 00:29:15 +02:00
<chmod perm= "+x" >
<fileset dir= "macosx/working_dir/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin" includes= "**/*" />
<fileset dir= "macosx/working_dir/Arduino.app/Contents/Resources/Java/hardware/tools/avr/avr/bin" includes= "**/*" />
<fileset dir= "macosx/working_dir/Arduino.app/Contents/Resources/Java/hardware/tools/avr/avr-3/bin" includes= "**/*" />
<fileset dir= "macosx/working_dir/Arduino.app/Contents/Resources/Java/hardware/tools/avr/avr-4/bin" includes= "**/*" />
<fileset dir= "macosx/working_dir/Arduino.app/Contents/Resources/Java/hardware/tools/avr/libexec/gcc/avr/3.4.6/" includes= "**/cc1*" />
<fileset dir= "macosx/working_dir/Arduino.app/Contents/Resources/Java/hardware/tools/avr/libexec/gcc/avr/4.3.2/" includes= "**/cc1*" />
</chmod>
2010-05-08 23:47:19 +02:00
<!-- 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= "3" />
<exec executable= "hdiutil" >
<!-- <arg line="detach macosx/working_dir - quiet - force" /> -->
<arg line= "detach macosx/working_dir" />
</exec>
<delete file= "macosx/arduino-*.dmg" />
<exec executable= "hdiutil" >
<arg line= "convert macosx/working.dmg -quiet -format UDZO -imagekey zlib-level=9 -o macosx/arduino-${version}.dmg" />
</exec>
<!-- Clean up the interim files. -->
<delete file= "macosx/working.dmg" />
<delete dir= "macosx/working_dir" />
<echo >
=======================================================
Arduino for Mac OS X was built. Grab the image from
macosx/arduino-${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 >
=======================================================
Arduino for Linux can only be built on on unix systems.
Bye.
=======================================================
</echo>
<fail message= "wrong platform (${os.name})" />
</target>
2012-05-15 19:58:03 +02:00
<target name= "linux-build" depends= "revision-check, linux-checkos, subprojects-build, linux-check-arm-toolchain" description= "Build linux version" >
2010-05-08 23:47:19 +02:00
<mkdir dir= "linux/work" />
<copy todir= "linux/work" >
<fileset dir= "shared" includes= "lib/**" />
<fileset file= "shared/revisions.txt" />
</copy>
2010-05-09 01:43:20 +02:00
<copy todir= "linux/work" >
<fileset dir= "linux/dist" includes= "lib/**" />
</copy>
2010-05-08 23:47:19 +02:00
<copy todir= "linux/work/lib" flatten= "true" >
<fileset refid= "runtime.jars" />
</copy>
<antcall target= "assemble" >
<param name= "target.path" value= "linux/work" />
</antcall>
2012-02-29 22:16:37 +01:00
<copy todir= "linux/work" file= "linux/dist/arduino" />
<chmod perm= "755" file= "linux/work/arduino" />
2010-05-09 01:43:20 +02:00
<copy todir= "linux/work/hardware" >
<fileset dir= "linux/dist" includes= "tools/**" />
</copy>
<chmod perm= "755" file= "linux/work/hardware/tools/avrdude" />
2012-05-11 11:23:39 +02:00
<chmod perm= "755" file= "linux/work/hardware/tools/bossac" />
<chmod perm= "755" file= "linux/work/hardware/tools/bossac64" />
2012-05-29 23:33:32 +02:00
<chmod perm= "755" file= "linux/work/hardware/tools/adk2tool" />
<chmod perm= "755" file= "linux/work/hardware/tools/adk2install" />
2010-05-09 01:43:20 +02:00
2012-05-16 13:44:51 +02:00
<copy todir= "linux/work" file= "linux/dist/arduino" />
<chmod perm= "755" file= "linux/work/arduino" />
2012-05-17 22:46:56 +02:00
<antcall target= "linux-unzip-arm-toolchain" />
2010-05-08 23:47:19 +02:00
</target>
2011-02-17 02:21:43 +01:00
2012-02-29 22:16:37 +01:00
<target name= "linux32-build" depends= "linux-build" description= "Build linux (32-bit) version" >
2012-02-28 20:50:28 +01:00
<!-- Unzip AVR tools -->
<exec executable= "tar" dir= "linux/work/hardware" >
2012-03-11 20:33:16 +01:00
<arg value= "-xjf" />
<arg value= "../../avr_tools_linux32.tar.bz2" />
2012-02-28 20:50:28 +01:00
</exec>
2010-05-08 23:47:19 +02:00
</target>
2011-02-17 02:21:43 +01:00
<target name= "linux64-build" depends= "linux-build" description= "Build linux (64-bit) version" >
<copy tofile= "linux/work/hardware/tools/avrdude" file= "linux/dist/tools/avrdude64" overwrite= "true" />
<copy tofile= "linux/work/lib/librxtxSerial.so" file= "linux/dist/lib/librxtxSerial64.so" overwrite= "true" />
2012-02-29 22:16:37 +01:00
<chmod perm= "755" file= "linux/work/hardware/tools/avrdude" />
2012-02-28 21:24:03 +01:00
<!-- Unzip AVR tools -->
<exec executable= "tar" dir= "linux/work/hardware" >
2012-02-29 22:43:01 +01:00
<arg value= "-xjf" />
<arg value= "../../avr_tools_linux64.tar.bz2" />
2012-02-28 21:24:03 +01:00
</exec>
2011-02-17 02:21:43 +01:00
</target>
2010-05-08 23:47:19 +02:00
2012-02-29 21:30:03 +01:00
<target name= "linux32-run" depends= "linux32-build"
2011-02-17 02:21:43 +01:00
description="Run Linux (32-bit) version">
2010-11-27 19:50:33 +01:00
<exec executable= "./linux/work/arduino" spawn= "false" />
2010-05-08 23:47:19 +02:00
</target>
2011-02-17 02:21:43 +01:00
<target name= "linux64-run" depends= "linux64-build"
description="Run Linux (64-bit) version">
<exec executable= "./linux/work/arduino" spawn= "false" />
</target>
2012-05-16 17:35:54 +02:00
<target name= "linux-check-arm-toolchain-distfile" >
<available file= "linux/dist/gcc-arm-none-eabi-4.4.1-2010q1-188-linux32.tar.gz" property= "arm_distfile_available" />
2012-05-15 19:58:03 +02:00
</target>
2012-05-16 17:35:54 +02:00
<target name= "linux-get-arm-toolchain" depends= "linux-check-arm-toolchain-distfile" unless= "arm_distfile_available" >
<!-- Retrieve ARM toolchain -->
2012-05-15 19:58:03 +02:00
<get
2012-05-16 11:43:56 +02:00
src="http://arduino.googlecode.com/files/gcc-arm-none-eabi-4.4.1-2010q1-188-linux32.tar.gz"
dest="linux/dist/gcc-arm-none-eabi-4.4.1-2010q1-188-linux32.tar.gz"
2012-05-16 17:35:54 +02:00
verbose="true" />
</target>
<target name= "linux-check-arm-toolchain" >
<available file= "linux/work/hardware/tools/g++_arm_none_eabi" property= "arm_available" />
</target>
<target name= "linux-unzip-arm-toolchain" depends= "linux-get-arm-toolchain, linux-check-arm-toolchain" unless= "arm_available" >
2012-05-16 11:43:56 +02:00
<checksum file= "linux/dist/gcc-arm-none-eabi-4.4.1-2010q1-188-linux32.tar.gz" algorithm= "sha"
2012-05-15 19:58:03 +02:00
fileext=".sha" verifyproperty="checksum.matches"/>
<condition property= "checksum.matches.fail" >
<equals arg1= "${checksum.matches}" arg2= "false" />
</condition>
2012-05-16 17:35:54 +02:00
<fail if= "checksum.matches.fail" > Checksum failed.
2012-05-16 11:43:56 +02:00
File gcc-arm-none-eabi-4.4.1-2010q1-188-linux32.tar.gz failed checksum.
2012-05-16 17:35:54 +02:00
Please remove "linux/dist/gcc-arm-none-eabi-4.4.1-2010q1-188-linux32.tar.gz" to download it again.
2012-05-15 19:58:03 +02:00
</fail>
2012-05-16 17:35:54 +02:00
<!-- Unzip toolchain to the destination folder -->
2012-05-15 19:58:03 +02:00
<exec executable= "tar" output= "/dev/null" os= "Linux" >
<arg value= "xfz" />
2012-05-16 11:43:56 +02:00
<arg value= "linux/dist/gcc-arm-none-eabi-4.4.1-2010q1-188-linux32.tar.gz" />
2012-05-15 19:58:03 +02:00
<arg value= "--directory=linux/work/hardware/tools" />
</exec>
</target>
2012-05-16 17:35:54 +02:00
<target name= "linux64-get-arm-toolchain" depends= "linux-check-arm-toolchain-distfile" unless= "arm_distfile_available" >
2012-05-16 16:21:27 +02:00
<antcall target= "linux-get-arm-toolchain" />
</target>
2012-05-16 17:35:54 +02:00
<target name= "linux64-unzip-arm-toolchain" depends= "linux-get-arm-toolchain" unless= "arm_available" >
<antcall target= "linux-unzip-arm-toolchain" />
</target>
2011-02-17 02:21:43 +01:00
<target name= "linux-dist" depends= "build"
2010-05-08 23:47:19 +02:00
description="Build .tar.gz of linux version">
2010-08-31 00:54:08 +02:00
<!-- get src="http://dev.processing.org/build/jre - tools - 6u18 - linux - i586.tgz"
2010-05-08 23:47:19 +02:00
dest="linux/jre.tgz"
usetimestamp="true" />
<untar compression= "gzip"
dest="linux/work"
src="linux/jre.tgz"
2010-08-31 00:54:08 +02:00
overwrite="false"/-->
2010-05-08 23:47:19 +02:00
<!--
<tar compression= "gzip" basedir= "linux/work"
destfile="linux/arduino-${version}.tgz" />
2012-02-29 21:30:03 +01:00
2011-11-28 23:36:03 +01:00
<tar compression= "gzip" destfile= "linux/arduino-${version}-linux.tgz" >
2010-08-31 00:54:08 +02:00
<tarfileset dir= "linux/work"
prefix="arduino-${version}"
excludes="arduino,
hardware/tools/avrdude,
java/**"
/>
<tarfileset file= "linux/work/arduino" filemode= "755" prefix= "arduino-${version}" />
<tarfileset file= "linux/work/hardware/tools/avrdude" filemode= "755"
prefix="arduino-${version}/hardware/tools" />
2010-05-08 23:47:19 +02:00
</tar>
2012-02-29 21:30:03 +01:00
-->
<move file= "linux/work" tofile= "linux/arduino-${version}" />
<exec executable= "tar" dir= "linux" >
<arg value= "-z" />
<arg value= "-c" />
<arg value= "-f" />
<arg value= "arduino-${version}-linux.tgz" />
<arg value= "arduino-${version}" />
</exec>
<move file= "linux/arduino-${version}" tofile= "linux/work" />
2010-05-08 23:47:19 +02:00
<echo >
=======================================================
Arduino for Linux was built. Grab the archive from
2011-11-28 23:36:03 +01:00
build/linux/arduino-${version}-linux.tgz
2010-05-08 23:47:19 +02:00
=======================================================
</echo>
</target>
2011-02-17 02:21:43 +01:00
2012-02-29 21:30:03 +01:00
<target name= "linux32-dist" depends= "linux-dist"
description="Build .tar.gz of linux version" />
2010-05-08 23:47:19 +02:00
2011-02-17 02:21:43 +01:00
<target name= "linux64-dist" depends= "linux-dist"
description="Build .tar.gz of linux version" />
2010-05-08 23:47:19 +02:00
<!-- - - - - - - - -->
<!-- Windows -->
<!-- - - - - - - - -->
<target name= "windows-clean" depends= "subprojects-clean"
description="Clean windows version">
<delete dir= "windows/work" />
</target>
<target name= "windows-checkos" unless= "windows" >
<echo >
=======================================================
2010-05-09 01:20:52 +02:00
Arduino for Windows can only be built on windows.
2010-05-08 23:47:19 +02:00
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= "shared" includes= "lib/**" />
<fileset file= "shared/revisions.txt" />
</copy>
2010-05-09 01:20:52 +02:00
<copy todir= "windows/work" >
<fileset dir= "windows/dist" includes= "*.dll" />
</copy>
<copy todir= "windows/work" >
<fileset dir= "windows/dist" includes= "drivers/**" />
</copy>
<!-- Unzip AVR tools -->
<unzip dest= "windows/work/hardware" src= "windows/avr_tools.zip" overwrite= "false" />
2010-12-24 01:14:59 +01:00
<copy todir= "windows/work/hardware/tools/avr/avr/include/avr" >
<fileset file= "windows/eeprom.h" />
</copy>
2012-04-02 18:30:53 +02:00
<!-- Copy bossac.exe tool -->
<copy todir= "windows/work/hardware/tools" >
<fileset file= "windows/bossac.exe" />
</copy>
<chmod perm= "755" >
<fileset file= "windows/work/hardware/tools/bossac.exe" />
</chmod>
2010-05-08 23:47:19 +02:00
<antcall target= "assemble" >
<param name= "target.path" value= "windows/work" />
</antcall>
<property name= "launch4j.dir" value= "windows/launcher/launch4j/" />
<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= "755" >
<fileset dir= "windows/work" includes= "**/*.html, **/*.dll, **/*.exe" />
</chmod>
2012-05-17 05:43:25 +02:00
2012-05-17 22:46:56 +02:00
<antcall target= "windows-unzip-arm-toolchain" />
2010-05-08 23:47:19 +02:00
</target>
<target name= "windows-run" depends= "windows-build"
description="Run windows version">
2010-05-09 01:20:52 +02:00
<exec executable= "windows/work/arduino.exe"
2010-05-08 23:47:19 +02:00
dir="windows/work" spawn="true"/>
</target>
2012-05-17 05:43:25 +02:00
<target name= "windows-check-arm-toolchain-distfile" >
<available file= "windows/dist/gcc-arm-none-eabi-4.4.1-2010q1-188-win32.tar.gz" property= "arm_distfile_available" />
</target>
<target name= "windows-get-arm-toolchain" depends= "windows-check-arm-toolchain-distfile" unless= "arm_distfile_available" >
<!-- Retrieve ARM toolchain -->
<get
src="http://arduino.googlecode.com/files/gcc-arm-none-eabi-4.4.1-2010q1-188-win32.tar.gz"
dest="windows/dist/gcc-arm-none-eabi-4.4.1-2010q1-188-win32.tar.gz"
verbose="true" />
</target>
<target name= "windows-check-arm-toolchain" >
<available file= "windows/work/hardware/tools/g++_arm_none_eabi" property= "arm_available" />
</target>
<target name= "windows-unzip-arm-toolchain" depends= "windows-get-arm-toolchain, windows-check-arm-toolchain" unless= "arm_available" >
<checksum file= "windows/dist/gcc-arm-none-eabi-4.4.1-2010q1-188-win32.tar.gz" algorithm= "sha"
fileext=".sha" verifyproperty="checksum.matches"/>
<condition property= "checksum.matches.fail" >
<equals arg1= "${checksum.matches}" arg2= "false" />
</condition>
<fail if= "checksum.matches.fail" > Checksum failed.
File gcc-arm-none-eabi-4.4.1-2010q1-188-win32.tar.gz failed checksum.
Please remove "windows/dist/gcc-arm-none-eabi-4.4.1-2010q1-188-win32.tar.gz" to download it again.
</fail>
<!-- Unzip toolchain to the destination folder -->
<exec executable= "tar" >
<arg value= "xfz" />
<arg value= "windows/dist/gcc-arm-none-eabi-4.4.1-2010q1-188-win32.tar.gz" />
<arg value= "--directory=windows/work/hardware/tools" />
</exec>
</target>
2010-05-08 23:47:19 +02:00
<target name= "windows-dist" depends= "windows-build"
description="Create .zip files of windows version">
2010-08-30 02:23:47 +02:00
<!-- get src="http://dev.processing.org/build/jre - tools - 6u18 - windows - i586.zip"
2010-05-08 23:47:19 +02:00
dest="windows/jre.zip"
2010-08-30 02:23:47 +02:00
usetimestamp="true" /-->
2010-05-08 23:47:19 +02:00
<unzip dest= "windows/work" src= "windows/jre.zip" overwrite= "false" />
<!--
<zip basedir= "windows/work"
2010-05-09 01:20:52 +02:00
prefix="arduino-${version}"
destfile="windows/arduino-${version}.zip" />
2010-05-08 23:47:19 +02:00
<zip basedir= "windows/work"
2010-05-09 01:20:52 +02:00
prefix="arduino-${version}"
destfile="windows/arduino-${version}-expert.zip"
2010-05-08 23:47:19 +02:00
excludes="java/**" />
-->
2011-11-28 23:36:03 +01:00
<zip destfile= "windows/arduino-${version}-windows.zip" >
2010-05-08 23:47:19 +02:00
<zipfileset dir= "windows/work"
2010-05-09 01:20:52 +02:00
prefix="arduino-${version}" />
2010-05-08 23:47:19 +02:00
</zip>
2011-11-28 23:36:03 +01:00
<zip destfile= "windows/arduino-${version}-windows-expert.zip" >
2010-05-08 23:47:19 +02:00
<zipfileset dir= "windows/work"
2010-05-09 01:20:52 +02:00
prefix="arduino-${version}"
2010-05-08 23:47:19 +02:00
excludes="java/**" />
</zip>
<echo >
=======================================================
2010-05-09 01:20:52 +02:00
Arduino for Windows was built. Grab the archive from
2010-05-08 23:47:19 +02:00
2011-11-28 23:36:03 +01:00
windows/arduino-${version}-windows.zip
windows/arduino-${version}-windows-expert.zip
2010-05-08 23:47:19 +02:00
=======================================================
</echo>
</target>
2010-10-04 03:21:27 +02:00
<!-- - - - - - - - -->
<!-- Source -->
<!-- - - - - - - - -->
<target name= "source-dist" depends= "revision-check"
description="Build .tar.gz of source code">
<input message= "Enter version number:"
addproperty="version"
defaultvalue="${revision}" />
<tar compression= "gzip" destfile= "arduino-${version}-src.tar.gz" >
<tarfileset dir= "../"
prefix="arduino-${version}"
excludes="**/*.tgz,
2012-04-09 01:17:03 +02:00
**/*.bz2,
2012-08-23 17:16:26 +02:00
**/build/macosx/,
**/build/windows/,
2010-10-04 03:21:27 +02:00
**/work/,
**/.git/,
**/*.class"
/>
</tar>
<echo >
=======================================================
Arduino source distribution was built. Grab the archive from
arduino-${version}-src.tar.gz
=======================================================
</echo>
</target>
2010-05-08 23:47:19 +02:00
2010-10-04 03:21:27 +02:00
2010-05-08 23:47:19 +02:00
<!-- - - - - - - - -->
<!-- Run It! -->
<!-- - - - - - - - -->
<target name= "clean" description= "Perform a spring cleaning"
depends="linux-clean, windows-clean, macosx-clean, subprojects-clean">
</target>
</project>