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}" /-->
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2010-05-08 23:47:19 +02:00
|
|
|
<!-- Sets properties for macosx/windows/linux depending on current system -->
|
2013-07-28 14:14:04 +02:00
|
|
|
<condition property="platform" value="macosx"><os family="mac" /></condition>
|
|
|
|
<condition property="platform" value="windows"><os family="windows" /></condition>
|
|
|
|
<condition property="platform" value="linux32"><os family="unix" arch="i386" /></condition>
|
|
|
|
<condition property="platform" value="linux64"><os family="unix" arch="amd64" /></condition>
|
2010-05-08 23:47:19 +02:00
|
|
|
|
2013-08-08 14:52:49 +02:00
|
|
|
<condition property="macosx"><equals arg1="${platform}" arg2="macosx" /></condition>
|
|
|
|
<condition property="windows"><equals arg1="${platform}" arg2="windows" /></condition>
|
|
|
|
<condition property="linux32"><equals arg1="${platform}" arg2="linux32" /></condition>
|
|
|
|
<condition property="linux64"><equals arg1="${platform}" arg2="linux64" /></condition>
|
|
|
|
<condition property="linux"><equals arg1="${platform}" arg2="linux32" /></condition>
|
|
|
|
<condition property="linux"><equals arg1="${platform}" arg2="linux64" /></condition>
|
|
|
|
|
|
|
|
<condition property="staging_folder" value="macosx"><equals arg1="${platform}" arg2="macosx" /></condition>
|
|
|
|
<condition property="staging_folder" value="windows"><equals arg1="${platform}" arg2="windows" /></condition>
|
|
|
|
<condition property="staging_folder" value="linux"><equals arg1="${platform}" arg2="linux32" /></condition>
|
|
|
|
<condition property="staging_folder" value="linux"><equals arg1="${platform}" arg2="linux64" /></condition>
|
|
|
|
|
2014-07-04 14:06:57 +02:00
|
|
|
<condition property="staging_hardware_folder" value="Arduino.app/Contents/Resources/Java/hardware"><equals arg1="${platform}" arg2="macosx" /></condition>
|
2013-08-08 14:52:49 +02:00
|
|
|
<condition property="staging_hardware_folder" value="hardware"><equals arg1="${platform}" arg2="windows" /></condition>
|
|
|
|
<condition property="staging_hardware_folder" value="hardware"><equals arg1="${platform}" arg2="linux32" /></condition>
|
|
|
|
<condition property="staging_hardware_folder" value="hardware"><equals arg1="${platform}" arg2="linux64" /></condition>
|
2010-05-08 23:47:19 +02:00
|
|
|
|
2014-02-20 12:25:53 +01:00
|
|
|
<condition property="launch4j-download-unpack-target-name" value="launch4j-windows"><os family="windows" /></condition>
|
|
|
|
<property name="launch4j-download-unpack-target-name" value="launch4j-linux"/>
|
|
|
|
|
2013-07-29 10:57:28 +02:00
|
|
|
<condition property="arch-bits" value="32">
|
|
|
|
<equals arg1="${platform}" arg2="linux32"/>
|
|
|
|
</condition>
|
|
|
|
<condition property="arch-bits" value="64">
|
|
|
|
<equals arg1="${platform}" arg2="linux64"/>
|
|
|
|
</condition>
|
2010-05-08 23:47:19 +02:00
|
|
|
|
2014-03-04 13:12:50 +01:00
|
|
|
<condition property="launch4j-download-unpack-target-name" value="launch4j-windows"><os family="windows" /></condition>
|
|
|
|
<property name="launch4j-download-unpack-target-name" value="launch4j-linux"/>
|
|
|
|
|
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" />
|
2013-04-16 16:29:50 +02:00
|
|
|
<include name="app/lib/commons-codec-1.7.jar" />
|
2013-01-28 16:33:18 +01:00
|
|
|
<include name="app/lib/commons-exec-1.1.jar" />
|
2013-04-16 16:29:50 +02:00
|
|
|
<include name="app/lib/commons-httpclient-3.1.jar" />
|
|
|
|
<include name="app/lib/commons-logging-1.0.4.jar" />
|
2013-06-11 15:02:10 +02:00
|
|
|
<include name="app/lib/ecj.jar" />
|
2013-04-16 16:29:50 +02:00
|
|
|
<include name="app/lib/jmdns-3.4.1.jar" />
|
2010-05-08 23:47:19 +02:00
|
|
|
<include name="app/lib/jna.jar" />
|
2013-06-11 15:02:10 +02:00
|
|
|
<include name="app/lib/jsch-0.1.50.jar" />
|
2014-01-23 16:20:40 +01:00
|
|
|
<include name="app/lib/jssc-2.8.0.jar" />
|
2010-05-08 23:47:19 +02:00
|
|
|
<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.">
|
2013-01-23 11:44:37 +01:00
|
|
|
<input message="Enter version number:"
|
2010-05-08 23:47:19 +02:00
|
|
|
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>
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2013-02-19 15:07:16 +01:00
|
|
|
<target name="test" depends="subprojects-test"/>
|
|
|
|
|
2010-05-08 23:47:19 +02:00
|
|
|
<!-- - - - - - - - - - - - - - - - - - -->
|
|
|
|
<!-- Subprojects: Core, App, Libraries -->
|
|
|
|
<!-- - - - - - - - - - - - - - - - - - -->
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2010-05-08 23:47:19 +02:00
|
|
|
<target name="subprojects-clean">
|
|
|
|
<subant buildpath="../core" target="clean"/>
|
|
|
|
<subant buildpath="../app" target="clean"/>
|
|
|
|
</target>
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2010-05-08 23:47:19 +02:00
|
|
|
<target name="subprojects-build">
|
|
|
|
<subant buildpath="../core" target="build"/>
|
|
|
|
<subant buildpath="../app" target="build"/>
|
|
|
|
</target>
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2013-02-19 15:07:16 +01:00
|
|
|
<target name="subprojects-test">
|
|
|
|
<subant buildpath="../app" target="test"/>
|
|
|
|
</target>
|
2010-05-08 23:47:19 +02:00
|
|
|
|
|
|
|
<!-- - - - - - - - - -->
|
|
|
|
<!-- Basic Assembly -->
|
|
|
|
<!-- - - - - - - - - -->
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2010-05-08 23:47:19 +02:00
|
|
|
<target name="assemble">
|
2013-01-23 11:44:37 +01:00
|
|
|
<fail unless="target.path"
|
2010-05-08 23:47:19 +02:00
|
|
|
message="Do not call assemble from the command line." />
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2010-05-08 23:47:19 +02:00
|
|
|
<!-- copy shared tools folder -->
|
|
|
|
<copy todir="${target.path}/tools">
|
|
|
|
<fileset dir="shared/tools" />
|
|
|
|
</copy>
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2012-01-09 18:20:55 +01:00
|
|
|
<!-- copy library folder -->
|
|
|
|
<copy todir="${target.path}/libraries">
|
|
|
|
<fileset dir="../libraries" />
|
|
|
|
</copy>
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2010-05-08 23:47:19 +02:00
|
|
|
<!-- copy hardware folder -->
|
|
|
|
<copy todir="${target.path}/hardware">
|
2013-01-21 19:13:30 +01:00
|
|
|
<fileset dir="../hardware">
|
|
|
|
<exclude name="arduino/sam/system/CMSIS/Device/ATMEL/*/svd/"/>
|
|
|
|
<exclude name="arduino/sam/system/CMSIS/Device/ATMEL/*/html/"/>
|
|
|
|
<exclude name="arduino/sam/system/CMSIS/CMSIS/Lib/ARM/*M0*"/>
|
|
|
|
<exclude name="arduino/sam/system/CMSIS/CMSIS/Lib/ARM/*M4*"/>
|
|
|
|
<exclude name="arduino/sam/system/CMSIS/CMSIS/Lib/GCC/*M0*"/>
|
|
|
|
<exclude name="arduino/sam/system/CMSIS/CMSIS/Lib/GCC/*M4*"/>
|
|
|
|
</fileset>
|
2010-05-08 23:47:19 +02:00
|
|
|
</copy>
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2010-05-08 23:47:19 +02:00
|
|
|
<!-- copy shared examples folder -->
|
|
|
|
<copy todir="${target.path}/examples">
|
|
|
|
<fileset dir="shared/examples" />
|
|
|
|
</copy>
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2010-05-08 23:47:19 +02:00
|
|
|
<!-- Unzip documentation -->
|
|
|
|
<unzip dest="${target.path}" src="shared/reference.zip" overwrite="false"/>
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2010-05-08 23:47:19 +02:00
|
|
|
<!-- Write the revision file! -->
|
|
|
|
<echo file="${target.path}/lib/version.txt" message="${version}" />
|
|
|
|
</target>
|
|
|
|
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2010-05-08 23:47:19 +02:00
|
|
|
<!-- - - - - - - - - -->
|
|
|
|
<!-- 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 -->
|
2014-05-29 11:58:20 +02:00
|
|
|
<containsregex pattern="ARDUINO ([^ ]*)" />
|
2013-01-24 14:42:51 +01:00
|
|
|
<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}" />
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2010-05-08 23:47:19 +02:00
|
|
|
<!-- figure out the revision number in base.java -->
|
2013-01-23 11:44:37 +01:00
|
|
|
<loadfile srcfile="../app/src/processing/app/Base.java"
|
2010-05-08 23:47:19 +02:00
|
|
|
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>
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2010-05-08 23:47:19 +02:00
|
|
|
<!-- - - - - - - - -->
|
|
|
|
<!-- 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" />
|
2013-01-31 12:32:29 +01:00
|
|
|
<delete>
|
|
|
|
<fileset dir="macosx" includes="arduino-*macosx*.zip"/>
|
|
|
|
</delete>
|
2010-05-08 23:47:19 +02:00
|
|
|
</target>
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2010-05-08 23:47:19 +02:00
|
|
|
<target name="macosx-checkos" unless="macosx">
|
|
|
|
<echo>
|
|
|
|
=======================================================
|
|
|
|
Arduino for Mac OS X can only be built on Mac OS X.
|
2013-01-23 11:44:37 +01:00
|
|
|
|
|
|
|
Bye.
|
2010-05-08 23:47:19 +02:00
|
|
|
=======================================================
|
|
|
|
</echo>
|
|
|
|
<fail message="wrong platform (${os.name})" />
|
|
|
|
</target>
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2013-08-03 02:10:59 +02:00
|
|
|
<target name="macosx-build" if="macosx" depends="revision-check, macosx-checkos, subprojects-build" description="Build Mac OS X version">
|
2010-05-08 23:47:19 +02:00
|
|
|
<mkdir dir="macosx/work" />
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2014-07-04 14:06:57 +02:00
|
|
|
<!-- assemble the pde -->
|
|
|
|
<copy todir="macosx/work/Arduino.app">
|
|
|
|
<fileset dir="macosx/template.app" includes="**"/>
|
|
|
|
</copy>
|
|
|
|
|
|
|
|
<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">
|
2010-05-08 23:47:19 +02:00
|
|
|
<fileset dir="shared" includes="lib/**" />
|
|
|
|
<fileset file="shared/revisions.txt" />
|
|
|
|
</copy>
|
|
|
|
|
|
|
|
<!-- Unzip AVR tools -->
|
2014-01-11 13:39:58 +01:00
|
|
|
<antcall target="unzip-avr-toolchain">
|
|
|
|
<param name="file_arch" value="mac32" />
|
|
|
|
</antcall>
|
2010-05-09 00:07:30 +02:00
|
|
|
|
2014-01-11 13:39:58 +01: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" />
|
2014-05-30 13:07:33 +02:00
|
|
|
<arg value="macosx/work/${staging_hardware_folder}" />
|
2010-05-08 23:47:19 +02:00
|
|
|
<arg value="macosx/dist/tools-universal.zip" />
|
|
|
|
</exec>
|
2010-05-09 00:07:30 +02:00
|
|
|
|
2014-01-11 13:39:58 +01:00
|
|
|
<copy todir="macosx/work/Arduino.app/Contents/Resources/Java/hardware/tools/avr/avr/include/avr">
|
|
|
|
<fileset file="macosx/dist/eeprom.h" />
|
|
|
|
</copy>
|
|
|
|
-->
|
|
|
|
|
2014-05-30 13:07:33 +02:00
|
|
|
<copy todir="macosx/work/${staging_hardware_folder}/tools/">
|
2012-05-11 22:29:42 +02:00
|
|
|
<fileset file="macosx/dist/bossac" />
|
|
|
|
</copy>
|
|
|
|
|
2014-05-30 13:07:33 +02:00
|
|
|
<chmod file="macosx/work/${staging_hardware_folder}/tools/bossac" perm="+x" />
|
2012-05-11 22:29:42 +02:00
|
|
|
|
2010-05-08 23:47:19 +02:00
|
|
|
<antcall target="assemble">
|
2014-07-04 14:06:57 +02:00
|
|
|
<param name="target.path" value="macosx/work/Arduino.app/Contents/Resources/Java" />
|
2010-05-08 23:47:19 +02:00
|
|
|
</antcall>
|
2012-05-16 13:44:51 +02:00
|
|
|
|
2014-10-08 14:22:34 +02:00
|
|
|
<antcall target="untar-tool">
|
2014-05-05 23:30:23 +02:00
|
|
|
<param name="dist_file" value="gcc-arm-none-eabi-4.8.3-2014q1-mac.tar.gz" />
|
|
|
|
<param name="dist_url" value="http://downloads.arduino.cc/gcc-arm-none-eabi-4.8.3-2014q1-mac.tar.gz" />
|
|
|
|
<param name="dist_check_file" value="gcc-arm-none-eabi-4.8.3-2014q1" />
|
2013-08-03 02:10:59 +02:00
|
|
|
</antcall>
|
2013-01-23 11:44:37 +01:00
|
|
|
|
|
|
|
<delete includeEmptyDirs="true" quiet="true">
|
2014-05-30 13:07:33 +02:00
|
|
|
<fileset dir="macosx/work/${staging_hardware_folder}/tools" includes="**/3.4.6/**/*"/>
|
|
|
|
<fileset dir="macosx/work/${staging_hardware_folder}/tools" includes="**/3.4.6"/>
|
|
|
|
<fileset dir="macosx/work/${staging_hardware_folder}/tools" includes="**/man/**/*"/>
|
|
|
|
<fileset dir="macosx/work/${staging_hardware_folder}/tools" includes="**/man"/>
|
2013-01-23 11:44:37 +01:00
|
|
|
</delete>
|
2013-10-14 17:31:35 +02:00
|
|
|
|
2014-10-07 13:02:18 +02:00
|
|
|
<antcall target="unzip-libastyle" />
|
2014-07-04 14:06:57 +02:00
|
|
|
<copy file="macosx/libastylej/libastylej.jnilib" todir="macosx/work/Arduino.app/Contents/Resources/Java/lib/" />
|
|
|
|
<chmod perm="755" file="macosx/work/Arduino.app/Contents/Resources/Java/lib/libastylej.jnilib" />
|
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">
|
2014-05-29 12:10:09 +02:00
|
|
|
<exec executable="open" dir="macosx/work">
|
|
|
|
<arg value="Arduino.app"/>
|
|
|
|
</exec>
|
2010-05-08 23:47:19 +02:00
|
|
|
</target>
|
|
|
|
|
2011-06-07 03:48:12 +02:00
|
|
|
<target name="macosx-debug" depends="macosx-build" description="Run Mac OS X version">
|
2014-05-30 13:07:33 +02:00
|
|
|
<exec executable="open" dir="macosx/work" spawn="false">
|
|
|
|
<arg value="Arduino.app"/>
|
|
|
|
</exec>
|
2011-06-07 03:48:12 +02:00
|
|
|
</target>
|
|
|
|
|
2013-02-01 23:51:50 +01:00
|
|
|
<!-- - - - - - - - - - - - - - - - -->
|
|
|
|
<!-- Sign application for MacOSX. -->
|
|
|
|
<!-- - - - - - - - - - - - - - - - -->
|
|
|
|
<target name="macosx-signed-dist" if="macosx" depends="macosx-singed-dist-check, dist"
|
|
|
|
description="Create a downloadable and signed .zip for the Mac OS X version">
|
|
|
|
<fail unless="version" message="Please set the property 'version' to correctly sign distribution file" />
|
|
|
|
|
|
|
|
<!-- Remove everything from working folder -->
|
|
|
|
<delete dir="macosx/work/Arduino.app" />
|
|
|
|
|
|
|
|
<!-- Unzip unsigned app into working dir -->
|
2013-02-05 16:30:00 +01:00
|
|
|
<exec executable="unzip" dir="macosx/work">
|
|
|
|
<arg line="../arduino-${version}-${platform}.zip" />
|
|
|
|
</exec>
|
2013-02-01 23:51:50 +01:00
|
|
|
|
2013-02-04 14:46:27 +01:00
|
|
|
<!-- Unlock keychain file -->
|
|
|
|
<exec executable="security" dir="macosx/work">
|
|
|
|
<arg line="unlock-keychain -p "${macosx-sign-keychain-pass}" "${macosx-sign-keychain}"" />
|
|
|
|
</exec>
|
|
|
|
|
2013-02-01 23:51:50 +01:00
|
|
|
<!-- Sign app -->
|
2013-08-29 16:07:09 +02:00
|
|
|
<exec executable="codesign" dir="macosx/work">
|
2013-08-28 15:15:39 +02:00
|
|
|
<arg line="--keychain "${macosx-sign-keychain}" --force -s "${macosx-sign-id}" -v Arduino.app/" />
|
2013-02-01 23:51:50 +01:00
|
|
|
</exec>
|
|
|
|
|
2013-08-29 16:07:09 +02:00
|
|
|
<!-- Check for successful signing -->
|
|
|
|
<exec executable="codesign" dir="macosx/work" failonerror="true">
|
|
|
|
<arg line="-vvvv Arduino.app/" />
|
|
|
|
</exec>
|
|
|
|
|
2013-02-05 16:30:00 +01:00
|
|
|
<delete file="macosx/arduino-${version}-${platform}.zip" />
|
|
|
|
|
2013-02-01 23:51:50 +01:00
|
|
|
<!-- Create signed zip file -->
|
|
|
|
<exec executable="zip" dir="macosx/work">
|
2013-08-29 16:17:14 +02:00
|
|
|
<arg line="-q -r ../arduino-${version}-${platform}-signed.zip ." />
|
2013-02-01 23:51:50 +01:00
|
|
|
</exec>
|
|
|
|
|
|
|
|
<echo>
|
|
|
|
=======================================================
|
|
|
|
Arduino for Mac OS X built and signed.
|
|
|
|
|
|
|
|
macosx/arduino-${version}-${platform}-signed.zip
|
|
|
|
=======================================================
|
|
|
|
</echo>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="macosx-singed-dist-check">
|
2013-02-04 14:46:27 +01:00
|
|
|
<fail unless="macosx-sign-keychain" message="Please set the property 'macosx-sign-keychain' to the correct keychain file" />
|
|
|
|
<fail unless="macosx-sign-keychain-pass" message="Please set the property 'macosx-sign-keychain-pass' with the password to unlock the keychain" />
|
|
|
|
<fail unless="macosx-sign-id" message="Please set the property 'macosx-sign-id' to the correct cert identifier" />
|
2013-02-01 23:51:50 +01:00
|
|
|
</target>
|
|
|
|
|
|
|
|
<!-- - - - - - - - - - - - - - - - - - - -->
|
|
|
|
<!-- Build distribution file for MacOSX. -->
|
|
|
|
<!-- - - - - - - - - - - - - - - - - - - -->
|
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">
|
2014-05-30 13:07:33 +02:00
|
|
|
<fileset dir="macosx/work/${staging_hardware_folder}/tools/avr/bin" includes="**/*" />
|
|
|
|
<fileset dir="macosx/work/${staging_hardware_folder}/tools/avr/avr/bin" includes="**/*" />
|
2014-06-27 16:03:51 +02:00
|
|
|
<fileset dir="macosx/work/${staging_hardware_folder}/tools/avr/libexec/gcc/avr/4.8.1/" includes="*" />
|
2011-11-28 23:36:03 +01:00
|
|
|
</chmod>
|
|
|
|
|
2014-07-04 14:06:57 +02:00
|
|
|
<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">
|
2013-01-31 12:32:29 +01:00
|
|
|
<arg line="-q -r ../arduino-${version}-${platform}.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>
|
|
|
|
=======================================================
|
2013-01-23 11:44:37 +01:00
|
|
|
Arduino for Mac OS X was built. Grab the image from
|
2013-02-19 15:07:16 +01:00
|
|
|
|
2013-02-05 16:30:00 +01:00
|
|
|
macosx/arduino-${version}-${platform}.zip
|
2011-11-28 23:36:03 +01:00
|
|
|
=======================================================
|
|
|
|
</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" />
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2010-05-08 23:47:19 +02:00
|
|
|
<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>
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2010-05-08 23:47:19 +02:00
|
|
|
<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" />
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2010-05-08 23:47:19 +02:00
|
|
|
<exec executable="hdiutil">
|
|
|
|
<!--<arg line="detach macosx/working_dir -quiet -force" />-->
|
|
|
|
<arg line="detach macosx/working_dir" />
|
|
|
|
</exec>
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2010-05-08 23:47:19 +02:00
|
|
|
<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" />
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2010-05-08 23:47:19 +02:00
|
|
|
<echo>
|
|
|
|
=======================================================
|
2013-01-23 11:44:37 +01:00
|
|
|
Arduino for Mac OS X was built. Grab the image from
|
|
|
|
|
2010-05-08 23:47:19 +02:00
|
|
|
macosx/arduino-${version}.dmg
|
|
|
|
=======================================================
|
|
|
|
</echo>
|
|
|
|
</target>
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2010-05-08 23:47:19 +02:00
|
|
|
<!-- - - - - - - - -->
|
|
|
|
<!-- Linux -->
|
|
|
|
<!-- - - - - - - - -->
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2010-05-08 23:47:19 +02:00
|
|
|
<target name="linux-clean" depends="subprojects-clean" description="Clean linux version">
|
|
|
|
<delete dir="linux/work" />
|
2013-01-31 12:32:29 +01:00
|
|
|
<delete>
|
|
|
|
<fileset dir="linux" includes="arduino-*linux*.tgz"/>
|
|
|
|
</delete>
|
2010-05-08 23:47:19 +02:00
|
|
|
</target>
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2010-05-08 23:47:19 +02:00
|
|
|
<target name="linux-checkos" unless="linux">
|
|
|
|
<echo>
|
|
|
|
=======================================================
|
|
|
|
Arduino for Linux can only be built on on unix systems.
|
2013-01-23 11:44:37 +01:00
|
|
|
|
|
|
|
Bye.
|
2010-05-08 23:47:19 +02:00
|
|
|
=======================================================
|
|
|
|
</echo>
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2010-05-08 23:47:19 +02:00
|
|
|
<fail message="wrong platform (${os.name})" />
|
|
|
|
</target>
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2013-07-28 14:14:04 +02:00
|
|
|
<target name="linux-build" depends="revision-check, linux-checkos, subprojects-build" description="Build linux version">
|
2010-05-08 23:47:19 +02:00
|
|
|
<mkdir dir="linux/work" />
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2010-05-08 23:47:19 +02:00
|
|
|
<copy todir="linux/work">
|
|
|
|
<fileset dir="shared" includes="lib/**" />
|
|
|
|
<fileset file="shared/revisions.txt" />
|
|
|
|
</copy>
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2013-02-27 17:54:48 +01: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>
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2010-05-08 23:47:19 +02:00
|
|
|
<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" />
|
|
|
|
|
2013-07-29 10:57:28 +02:00
|
|
|
<mkdir dir="linux/work/hardware/tools" />
|
|
|
|
<copy file="linux/dist/tools/adk2install" todir="linux/work/hardware/tools" />
|
|
|
|
<copy file="linux/dist/tools/adk2tool" todir="linux/work/hardware/tools" />
|
|
|
|
<copy file="linux/dist/tools/bossac${arch-bits}" tofile="linux/work/hardware/tools/bossac" />
|
2010-05-09 01:43:20 +02:00
|
|
|
|
2012-05-11 11:23:39 +02:00
|
|
|
<chmod perm="755" file="linux/work/hardware/tools/bossac" />
|
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" />
|
2013-10-14 17:31:35 +02:00
|
|
|
|
2014-10-07 13:02:18 +02:00
|
|
|
<antcall target="unzip-libastyle" />
|
2013-10-14 17:31:35 +02:00
|
|
|
<copy file="linux/libastylej/libastylej${arch-bits}.so" tofile="linux/work/lib/libastylej.so" />
|
|
|
|
<chmod perm="755" file="linux/work/lib/libastylej.so" />
|
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">
|
2013-07-28 14:14:04 +02:00
|
|
|
<!-- Unzip ARM tools -->
|
2014-10-08 14:22:34 +02:00
|
|
|
<antcall target="untar-tool">
|
2014-05-05 23:30:23 +02:00
|
|
|
<param name="dist_file" value="gcc-arm-none-eabi-4.8.3-2014q1-linux32.tar.gz" />
|
|
|
|
<param name="dist_url" value="http://downloads.arduino.cc/gcc-arm-none-eabi-4.8.3-2014q1-linux32.tar.gz" />
|
|
|
|
<param name="dist_check_file" value="gcc-arm-none-eabi-4.8.3-2014q1" />
|
2013-07-28 14:14:04 +02:00
|
|
|
</antcall>
|
|
|
|
|
2012-02-28 20:50:28 +01:00
|
|
|
<!-- Unzip AVR tools -->
|
2014-01-11 13:39:58 +01:00
|
|
|
<antcall target="unzip-avr-toolchain">
|
|
|
|
<param name="file_arch" value="linux32" />
|
|
|
|
</antcall>
|
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">
|
2013-07-28 14:14:04 +02:00
|
|
|
<!-- Unzip ARM tools -->
|
2014-10-08 14:22:34 +02:00
|
|
|
<antcall target="untar-tool">
|
2014-05-05 23:30:23 +02:00
|
|
|
<param name="dist_file" value="gcc-arm-none-eabi-4.8.3-2014q1-linux64.tar.gz" />
|
|
|
|
<param name="dist_url" value="http://downloads.arduino.cc/gcc-arm-none-eabi-4.8.3-2014q1-linux64.tar.gz" />
|
|
|
|
<param name="dist_check_file" value="gcc-arm-none-eabi-4.8.3-2014q1" />
|
2013-07-28 14:14:04 +02:00
|
|
|
</antcall>
|
|
|
|
|
2012-02-28 21:24:03 +01:00
|
|
|
<!-- Unzip AVR tools -->
|
2014-01-11 13:39:58 +01:00
|
|
|
<antcall target="unzip-avr-toolchain">
|
|
|
|
<param name="file_arch" value="linux64" />
|
|
|
|
</antcall>
|
2011-02-17 02:21:43 +01:00
|
|
|
</target>
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2013-07-28 14:14:04 +02:00
|
|
|
<target name="linux32-run" depends="linux32-build" 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>
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2013-07-28 14:14:04 +02:00
|
|
|
<target name="linux64-run" depends="linux64-build" description="Run Linux (64-bit) version">
|
2011-02-17 02:21:43 +01:00
|
|
|
<exec executable="./linux/work/arduino" spawn="false"/>
|
|
|
|
</target>
|
|
|
|
|
2014-01-11 13:39:58 +01:00
|
|
|
<target name="unzip-avr-toolchain">
|
2014-02-04 10:24:49 +01:00
|
|
|
<get src="http://downloads.arduino.cc/avr-toolchain-${file_arch}-gcc-4.8.1.zip" dest="${staging_folder}" usetimestamp="true" ignoreerrors="true" verbose="true" />
|
2014-01-11 13:39:58 +01:00
|
|
|
|
2014-02-04 10:24:49 +01:00
|
|
|
<checksum file="${staging_folder}/avr-toolchain-${file_arch}-gcc-4.8.1.zip" algorithm="sha" fileext=".sha" verifyproperty="checksum.matches"/>
|
2014-01-11 13:39:58 +01:00
|
|
|
<condition property="checksum.matches.fail">
|
|
|
|
<equals arg1="${checksum.matches}" arg2="false"/>
|
|
|
|
</condition>
|
|
|
|
<fail if="checksum.matches.fail">Checksum failed.
|
|
|
|
|
2014-02-04 10:24:49 +01:00
|
|
|
File avr-toolchain-${file_arch}-gcc-4.8.1.zip failed checksum.
|
|
|
|
Please remove "${staging_folder}/avr-toolchain-${file_arch}-gcc-4.8.1.zip" and download it again.
|
2014-01-11 13:39:58 +01:00
|
|
|
</fail>
|
|
|
|
|
|
|
|
<mkdir dir="${staging_folder}/work/${staging_hardware_folder}/tools/avr" />
|
|
|
|
<exec executable="unzip">
|
|
|
|
<arg value="-q" />
|
|
|
|
<arg value="-n" />
|
|
|
|
<arg value="-d" />
|
|
|
|
<arg value="${staging_folder}/work/${staging_hardware_folder}/tools/avr" />
|
2014-02-04 10:24:49 +01:00
|
|
|
<arg value="${staging_folder}/avr-toolchain-${file_arch}-gcc-4.8.1.zip" />
|
2014-01-11 13:39:58 +01:00
|
|
|
</exec>
|
|
|
|
</target>
|
|
|
|
|
2014-10-07 13:02:18 +02:00
|
|
|
<target name="unzip-libastyle">
|
|
|
|
<get src="http://downloads.arduino.cc/libastylej-2.04.zip" dest="." usetimestamp="true" ignoreerrors="true" verbose="true" />
|
2014-02-08 19:57:25 +01:00
|
|
|
|
2014-10-07 13:02:18 +02:00
|
|
|
<checksum file="libastylej-2.04.zip" 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 libastylej-2.04.zip failed checksum.
|
|
|
|
Please remove "libastylej-2.04.zip" and download it again.
|
|
|
|
</fail>
|
|
|
|
|
|
|
|
<unzip src="libastylej-2.04.zip" dest="${staging_folder}" overwrite="true"/>
|
|
|
|
</target>
|
2014-02-08 19:57:25 +01:00
|
|
|
|
|
|
|
<!-- Set '${dist_file}_available' property if toolchain dist_file is downloaded -->
|
|
|
|
<!-- Set '${dist_file}_installed' property if toolchain is installed in working directory -->
|
|
|
|
<!-- hardware/tools/${dist_check_file} is checked for existence -->
|
|
|
|
<target name="check-tool">
|
|
|
|
<available file="${staging_folder}/dist/${dist_file}" property="${dist_file}_available" />
|
|
|
|
<available file="${staging_folder}/work/hardware/tools/${dist_check_file}" property="${dist_file}_installed" />
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<!-- Retrieve tool -->
|
|
|
|
<target name="get-tool" depends="check-tool" unless="${dist_file}_available">
|
|
|
|
<get src="${dist_url}" dest="${staging_folder}/dist/${dist_file}" verbose="true" ignoreerrors="true" />
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<!-- Ensure that the tool is downloaded and test checksums, if everything's ok unzip it on the tools folder -->
|
2014-10-08 14:22:34 +02:00
|
|
|
<target name="untar-tool" depends="get-tool, check-tool" unless="${dist_file}_installed">
|
2014-02-08 19:57:25 +01:00
|
|
|
<echo>Testing checksum of "${staging_folder}/dist/${dist_file}"</echo>
|
|
|
|
<checksum file="${staging_folder}/dist/${dist_file}" 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 ${dist_file} failed checksum.
|
|
|
|
Please remove "${staging_folder}/dist/${dist_file}" to download it again.
|
|
|
|
</fail>
|
|
|
|
|
|
|
|
<!-- Unzip tool to the destination folder -->
|
|
|
|
<echo>Unzipping into folder ${staging_folder}/dist/${dist_file}</echo>
|
|
|
|
<exec executable="tar">
|
|
|
|
<arg value="xfz"/>
|
|
|
|
<arg value="${staging_folder}/dist/${dist_file}"/>
|
|
|
|
<arg value="--directory=${staging_folder}/work/${staging_hardware_folder}/tools/"/>
|
|
|
|
</exec>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-03 02:10:59 +02:00
|
|
|
<!-- Set 'arm_disfile_available' property if ARM toolchain dist_file is downloaded -->
|
2013-07-28 14:14:04 +02:00
|
|
|
<!-- Set 'arm_toolchain_installed' property if ARM toolchain is installed in working directory -->
|
2013-08-03 02:10:59 +02:00
|
|
|
<target name="check-arm-toolchain">
|
|
|
|
<available file="${staging_folder}/dist/${dist_file}" property="arm_distfile_available" />
|
|
|
|
<available file="${staging_folder}/work/hardware/tools/${dist_check_file}" property="arm_toolchain_installed" />
|
2012-05-15 19:58:03 +02:00
|
|
|
</target>
|
|
|
|
|
2013-07-28 14:14:04 +02:00
|
|
|
<!-- Retrieve ARM toolchain -->
|
2013-08-03 02:10:59 +02:00
|
|
|
<target name="get-arm-toolchain" depends="check-arm-toolchain" unless="arm_distfile_available">
|
2014-01-11 13:39:58 +01:00
|
|
|
<get src="${dist_url}" dest="${staging_folder}/dist/${dist_file}" verbose="true" ignoreerrors="true" />
|
2012-05-16 17:35:54 +02:00
|
|
|
</target>
|
|
|
|
|
2013-01-23 11:44:37 +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
|
|
|
|
|
|
|
<!--
|
2013-01-23 11:44:37 +01:00
|
|
|
<tar compression="gzip" basedir="linux/work"
|
2010-05-08 23:47:19 +02:00
|
|
|
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">
|
2013-01-23 11:44:37 +01:00
|
|
|
<tarfileset dir="linux/work"
|
|
|
|
prefix="arduino-${version}"
|
|
|
|
excludes="arduino,
|
2010-08-31 00:54:08 +02:00
|
|
|
hardware/tools/avrdude,
|
|
|
|
java/**"
|
2013-01-23 11:44:37 +01:00
|
|
|
/>
|
2010-08-31 00:54:08 +02:00
|
|
|
<tarfileset file="linux/work/arduino" filemode="755" prefix="arduino-${version}" />
|
2013-01-23 11:44:37 +01:00
|
|
|
<tarfileset file="linux/work/hardware/tools/avrdude" filemode="755"
|
2010-08-31 00:54:08 +02:00
|
|
|
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"/>
|
2013-01-31 12:32:29 +01:00
|
|
|
<arg value="arduino-${version}-${platform}.tgz"/>
|
2012-02-29 21:30:03 +01:00
|
|
|
<arg value="arduino-${version}"/>
|
|
|
|
</exec>
|
|
|
|
|
|
|
|
<move file="linux/arduino-${version}" tofile="linux/work" />
|
2010-05-08 23:47:19 +02:00
|
|
|
|
|
|
|
<echo>
|
|
|
|
=======================================================
|
2013-01-23 11:44:37 +01:00
|
|
|
Arduino for Linux was built. Grab the archive from
|
2013-02-19 15:07:16 +01:00
|
|
|
|
2013-01-31 12:32:29 +01:00
|
|
|
build/linux/arduino-${version}-${platform}.tgz
|
2010-05-08 23:47:19 +02:00
|
|
|
=======================================================
|
|
|
|
</echo>
|
|
|
|
</target>
|
2011-02-17 02:21:43 +01:00
|
|
|
|
2013-01-23 11:44:37 +01:00
|
|
|
<target name="linux32-dist" depends="linux-dist"
|
2012-02-29 21:30:03 +01:00
|
|
|
description="Build .tar.gz of linux version" />
|
2013-01-23 11:44:37 +01:00
|
|
|
|
|
|
|
<target name="linux64-dist" depends="linux-dist"
|
2011-02-17 02:21:43 +01:00
|
|
|
description="Build .tar.gz of linux version" />
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2010-05-08 23:47:19 +02:00
|
|
|
<!-- - - - - - - - -->
|
|
|
|
<!-- Windows -->
|
|
|
|
<!-- - - - - - - - -->
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2010-05-08 23:47:19 +02:00
|
|
|
<target name="windows-clean" depends="subprojects-clean"
|
|
|
|
description="Clean windows version">
|
|
|
|
<delete dir="windows/work" />
|
2013-01-31 12:32:29 +01:00
|
|
|
<delete>
|
|
|
|
<fileset dir="windows" includes="arduino-*windows*.zip"/>
|
|
|
|
</delete>
|
2010-05-08 23:47:19 +02:00
|
|
|
</target>
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2010-05-08 23:47:19 +02:00
|
|
|
<target name="windows-checkos" unless="windows">
|
|
|
|
<echo>
|
|
|
|
=======================================================
|
2010-05-09 01:20:52 +02:00
|
|
|
Arduino for Windows can only be built on windows.
|
2013-01-23 11:44:37 +01:00
|
|
|
|
|
|
|
Bye.
|
2010-05-08 23:47:19 +02:00
|
|
|
=======================================================
|
|
|
|
</echo>
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2010-05-08 23:47:19 +02:00
|
|
|
<fail message="wrong platform (${os.name})" />
|
|
|
|
</target>
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2014-02-20 12:25:53 +01:00
|
|
|
<target name="download-launch4j-windows">
|
|
|
|
<get src="http://switch.dl.sourceforge.net/project/launch4j/launch4j-3/3.0.2/launch4j-3.0.2-win32.zip" dest="windows" usetimestamp="true" skipexisting="true" verbose="true" />
|
|
|
|
<unzip dest="windows/launcher/" src="windows/launch4j-3.0.2-win32.zip" overwrite="true"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="download-launch4j-linux">
|
|
|
|
<get src="http://switch.dl.sourceforge.net/project/launch4j/launch4j-3/3.0.2/launch4j-3.0.2-linux.tgz" dest="windows" usetimestamp="true" skipexisting="true" verbose="true" />
|
|
|
|
|
|
|
|
<exec executable="tar" dir="windows/launcher">
|
|
|
|
<arg value="-xzf"/>
|
|
|
|
<arg value="../launch4j-3.0.2-linux.tgz"/>
|
|
|
|
</exec>
|
|
|
|
</target>
|
|
|
|
|
2013-01-23 11:44:37 +01:00
|
|
|
<target name="windows-build"
|
|
|
|
depends="revision-check, windows-checkos, subprojects-build"
|
2010-05-08 23:47:19 +02:00
|
|
|
description="Build windows version">
|
|
|
|
<mkdir dir="windows/work" />
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2010-05-08 23:47:19 +02:00
|
|
|
<!-- assemble the pde -->
|
|
|
|
<mkdir dir="windows/work/lib" />
|
|
|
|
<copy todir="windows/work/lib" flatten="true">
|
|
|
|
<fileset refid="runtime.jars" />
|
|
|
|
</copy>
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2010-05-08 23:47:19 +02:00
|
|
|
<copy todir="windows/work">
|
|
|
|
<fileset dir="shared" includes="lib/**" />
|
|
|
|
<fileset file="shared/revisions.txt" />
|
|
|
|
</copy>
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2013-02-04 16:56:26 +01:00
|
|
|
<fixcrlf file="windows/work/revisions.txt" eol="dos"/>
|
2013-10-14 18:26:59 +02:00
|
|
|
<fixcrlf file="windows/work/lib/formatter.conf" eol="dos"/>
|
2013-02-04 16:56:26 +01:00
|
|
|
|
2010-05-09 01:20:52 +02:00
|
|
|
<copy todir="windows/work">
|
|
|
|
<fileset dir="windows/dist" includes="*.dll" />
|
|
|
|
</copy>
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2010-05-09 01:20:52 +02:00
|
|
|
<copy todir="windows/work">
|
|
|
|
<fileset dir="windows/dist" includes="drivers/**" />
|
|
|
|
</copy>
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2010-05-09 01:20:52 +02:00
|
|
|
<!-- Unzip AVR tools -->
|
2014-01-11 13:39:58 +01:00
|
|
|
<antcall target="unzip-avr-toolchain">
|
|
|
|
<param name="file_arch" value="win32" />
|
|
|
|
</antcall>
|
2010-12-24 01:14:59 +01:00
|
|
|
|
2014-10-07 13:02:18 +02:00
|
|
|
<antcall target="unzip-libastyle" />
|
2013-10-14 17:31:35 +02:00
|
|
|
<copy file="windows/libastylej/AStylej.dll" todir="windows/work/lib" />
|
|
|
|
|
2012-04-02 18:30:53 +02:00
|
|
|
<!-- Copy bossac.exe tool -->
|
|
|
|
<copy todir="windows/work/hardware/tools">
|
|
|
|
<fileset file="windows/bossac.exe" />
|
2013-02-04 15:09:01 +01:00
|
|
|
<fileset file="windows/listComPorts.exe" />
|
2012-04-02 18:30:53 +02:00
|
|
|
</copy>
|
|
|
|
<chmod perm="755">
|
|
|
|
<fileset file="windows/work/hardware/tools/bossac.exe" />
|
2013-02-04 15:09:01 +01:00
|
|
|
<fileset file="windows/work/hardware/tools/listComPorts.exe" />
|
2012-04-02 18:30:53 +02:00
|
|
|
</chmod>
|
|
|
|
|
2010-05-08 23:47:19 +02:00
|
|
|
<antcall target="assemble">
|
|
|
|
<param name="target.path" value="windows/work" />
|
|
|
|
</antcall>
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2014-02-20 12:25:53 +01:00
|
|
|
<antcall target="download-${launch4j-download-unpack-target-name}" />
|
|
|
|
|
2010-05-08 23:47:19 +02:00
|
|
|
<property name="launch4j.dir" value="windows/launcher/launch4j/" />
|
2013-01-23 11:44:37 +01:00
|
|
|
<taskdef name="launch4j"
|
|
|
|
classname="net.sf.launch4j.ant.Launch4jTask"
|
2010-05-08 23:47:19 +02:00
|
|
|
classpath="${launch4j.dir}/launch4j.jar; ${launch4j.dir}/lib/xstream.jar" />
|
|
|
|
|
|
|
|
<copy todir="windows/work">
|
2013-01-23 11:44:37 +01:00
|
|
|
<fileset dir="windows/launcher"
|
2014-02-20 11:06:30 +01:00
|
|
|
includes="about.bmp, application.ico, config.xml, config_debug.xml"/>
|
2010-05-08 23:47:19 +02:00
|
|
|
</copy>
|
|
|
|
<launch4j configFile="windows/work/config.xml" />
|
2014-02-20 11:06:30 +01:00
|
|
|
<launch4j configFile="windows/work/config_debug.xml" />
|
2013-01-23 11:44:37 +01:00
|
|
|
<delete dir="windows/work"
|
2014-02-20 11:06:30 +01:00
|
|
|
includes="about.bmp, application.ico, config.xml, config_debug.xml" />
|
2010-05-08 23:47:19 +02:00
|
|
|
|
|
|
|
<!-- 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
|
|
|
|
2013-08-03 02:10:59 +02:00
|
|
|
<!-- Unzip ARM toolchain -->
|
2014-10-08 14:22:34 +02:00
|
|
|
<antcall target="untar-tool">
|
2014-05-05 23:30:23 +02:00
|
|
|
<param name="dist_file" value="gcc-arm-none-eabi-4.8.3-2014q1-windows.tar.gz" />
|
|
|
|
<param name="dist_url" value="http://downloads.arduino.cc/gcc-arm-none-eabi-4.8.3-2014q1-windows.tar.gz" />
|
|
|
|
<param name="dist_check_file" value="gcc-arm-none-eabi-4.8.3-2014q1" />
|
2013-08-03 02:10:59 +02:00
|
|
|
</antcall>
|
2013-01-23 11:58:06 +01:00
|
|
|
|
|
|
|
<delete includeEmptyDirs="true" quiet="true">
|
|
|
|
<fileset dir="windows/work/hardware/tools/avr/doc" />
|
|
|
|
</delete>
|
2010-05-08 23:47:19 +02:00
|
|
|
</target>
|
2013-01-23 11:44:37 +01:00
|
|
|
|
|
|
|
<target name="windows-run" depends="windows-build"
|
2010-05-08 23:47:19 +02:00
|
|
|
description="Run windows version">
|
2013-01-23 11:44:37 +01:00
|
|
|
<exec executable="windows/work/arduino.exe"
|
2010-05-08 23:47:19 +02:00
|
|
|
dir="windows/work" spawn="true"/>
|
|
|
|
</target>
|
|
|
|
|
2013-01-23 11:44:37 +01:00
|
|
|
<target name="windows-dist" depends="windows-build"
|
2010-05-08 23:47:19 +02:00
|
|
|
description="Create .zip files of windows version">
|
|
|
|
|
2014-02-18 18:34:19 +01:00
|
|
|
<get src="http://downloads.arduino.cc/jre_7u40_windows_i586.zip" dest="windows/jre.zip" usetimestamp="true" skipexisting="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/**" />
|
|
|
|
-->
|
|
|
|
|
2013-01-23 12:29:18 +01:00
|
|
|
<zip destfile="windows/arduino-${version}-${platform}.zip" level="9">
|
2013-02-19 15:07:16 +01: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>
|
|
|
|
|
|
|
|
<echo>
|
|
|
|
=======================================================
|
2013-01-23 11:44:37 +01:00
|
|
|
Arduino for Windows was built. Grab the archive from
|
2013-02-19 15:07:16 +01:00
|
|
|
|
2013-01-31 12:32:29 +01:00
|
|
|
windows/arduino-${version}-${platform}.zip
|
2010-05-08 23:47:19 +02:00
|
|
|
=======================================================
|
|
|
|
</echo>
|
|
|
|
</target>
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2010-10-04 03:21:27 +02:00
|
|
|
|
|
|
|
<!-- - - - - - - - -->
|
|
|
|
<!-- Source -->
|
|
|
|
<!-- - - - - - - - -->
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2010-10-04 03:21:27 +02:00
|
|
|
<target name="source-dist" depends="revision-check"
|
|
|
|
description="Build .tar.gz of source code">
|
2013-01-23 11:44:37 +01:00
|
|
|
<input message="Enter version number:"
|
2010-10-04 03:21:27 +02:00
|
|
|
addproperty="version"
|
|
|
|
defaultvalue="${revision}" />
|
|
|
|
|
|
|
|
<tar compression="gzip" destfile="arduino-${version}-src.tar.gz">
|
2013-01-23 11:44:37 +01:00
|
|
|
<tarfileset dir="../"
|
|
|
|
prefix="arduino-${version}"
|
2010-10-04 03:21:27 +02:00
|
|
|
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"
|
2013-01-23 11:44:37 +01:00
|
|
|
/>
|
2010-10-04 03:21:27 +02:00
|
|
|
</tar>
|
|
|
|
|
|
|
|
<echo>
|
|
|
|
=======================================================
|
2013-01-23 11:44:37 +01:00
|
|
|
Arduino source distribution was built. Grab the archive from
|
|
|
|
|
2010-10-04 03:21:27 +02:00
|
|
|
arduino-${version}-src.tar.gz
|
|
|
|
=======================================================
|
|
|
|
</echo>
|
|
|
|
</target>
|
2013-01-23 11:44:37 +01:00
|
|
|
|
2010-10-04 03:21:27 +02:00
|
|
|
|
2010-05-08 23:47:19 +02:00
|
|
|
<!-- - - - - - - - -->
|
|
|
|
<!-- Run It! -->
|
|
|
|
<!-- - - - - - - - -->
|
2013-01-23 11:44:37 +01:00
|
|
|
|
|
|
|
<target name="clean" description="Perform a spring cleaning"
|
2010-05-08 23:47:19 +02:00
|
|
|
depends="linux-clean, windows-clean, macosx-clean, subprojects-clean">
|
|
|
|
</target>
|
|
|
|
|
|
|
|
</project>
|