1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-11-29 10:24:12 +01:00
Arduino/build/build.xml

1205 lines
52 KiB
XML
Raw Normal View History

<?xml version="1.0"?>
<project name="Arduino" default="build">
<!--echo message="os.name = ${os.name}" /-->
<!--echo message="os.arch = ${os.arch}" /-->
<!--echo message="os.version = ${os.version}" /-->
<tstamp>
<format property="BUILD_DATE" pattern="yyyy/MM/dd hh:mm"/>
</tstamp>
<!-- Main url for boards and libraries repository -->
<property name="library_index_url" value="http://downloads.arduino.cc/libraries/library_index.json" />
<property name="package_index_url" value="http://downloads.arduino.cc/packages/package_index.json" />
<!-- Sets properties for macosx/windows/linux depending on current system -->
<condition property="platform" value="macosx-old">
<and>
<os family="mac" />
<matches string="${os.version}" pattern="^10.[56]." />
</and>
</condition>
<condition property="macosx-old"><equals arg1="${platform}" arg2="macosx-old" /></condition>
<fail if="macosx-old" message="MacOSX older than 10.7 are not supported"/>
<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>
2015-12-05 12:51:11 +01:00
<condition property="platform" value="arm"><os family="unix" arch="arm" /></condition>
<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>
2015-12-05 12:51:11 +01:00
<condition property="linux"><equals arg1="${platform}" arg2="arm" /></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>
2015-12-05 12:51:11 +01:00
<condition property="staging_folder" value="linux"><equals arg1="${platform}" arg2="arm" /></condition>
<condition property="staging_hardware_folder" value="Arduino.app/Contents/Java/hardware"><equals arg1="${platform}" arg2="macosx" /></condition>
<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>
2015-12-05 12:51:11 +01:00
<condition property="staging_hardware_folder" value="hardware"><equals arg1="${platform}" arg2="arm" /></condition>
<condition property="arch-bits" value="32">
<equals arg1="${platform}" arg2="linux32"/>
</condition>
2015-12-05 12:51:11 +01:00
<condition property="arch-bits" value="32">
<equals arg1="${platform}" arg2="arm"/>
</condition>
<condition property="arch-bits" value="64">
<equals arg1="${platform}" arg2="linux64"/>
</condition>
<condition property="launch4j-download-unpack-target-name" value="launch4j-windows"><os family="windows" /></condition>
<property name="launch4j-download-unpack-target-name" value="launch4j-linux"/>
<property name="MACOSX_BUNDLED_JVM" value="${java.home}/../"/>
<property name="WINDOWS_BUNDLED_JVM" value="${java.home}"/>
<property name="LINUX32_BUNDLED_JVM" value="none"/>
<property name="LINUX64_BUNDLED_JVM" value="none"/>
<condition property="linux-bundle-jvm-task" value="noop">
<and>
<equals arg1="${LINUX32_BUNDLED_JVM}" arg2="none"/>
<equals arg1="${LINUX64_BUNDLED_JVM}" arg2="none"/>
</and>
</condition>
<condition property="linux-bundle-jvm-task" value="bundle">
<or>
<not>
<equals arg1="${LINUX32_BUNDLED_JVM}" arg2="none"/>
</not>
<not>
<equals arg1="${LINUX64_BUNDLED_JVM}" arg2="none"/>
</not>
</or>
</condition>
<property name="portable" value="false" />
2016-03-25 14:09:58 +01:00
<property name="ARDUINO-BUILDER-VERSION" value="1.3.15" />
2016-04-01 11:40:32 +02:00
<property name="LIBLISTSERIAL-VERSION" value="1.1.0" />
2015-09-21 13:22:41 +02:00
<!-- Libraries required for running arduino -->
<fileset dir=".." id="runtime.jars">
<include name="arduino-core/arduino-core.jar" />
<include name="app/pde.jar" />
<include name="app/lib/*.jar" />
2015-03-13 12:31:01 +01:00
<include name="arduino-core/lib/*.jar" />
</fileset>
<target name="build" description="Build Arduino.">
<antcall target="${platform}-build" />
<antcall target="generate-hourly-build-txt"/>
</target>
<target name="run" description="Packs and runs Arduino">
<antcall target="${platform}-run" />
</target>
<target name="start" description="Starts Arduino">
<antcall target="${platform}-start" />
</target>
<target name="dist" depends="revision-check" description="Build Arduino for distribution.">
<input message="Enter version number:" addproperty="version" defaultvalue="${revision}"/>
<condition property="full-version" value="${version}-${platform}">
<not>
<equals arg1="${portable}" arg2="true"/>
</not>
</condition>
<condition property="full-version" value="${version}-${platform}-portable">
<equals arg1="${portable}" arg2="true"/>
</condition>
<antcall target="${platform}-dist">
<param name="full-version" value="${full-version}"/>
</antcall>
</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>
<target name="test" depends="subprojects-test"/>
<!-- - - - - - - - - - - - - - - - - - -->
<!-- Subprojects: Core, App, Libraries -->
<!-- - - - - - - - - - - - - - - - - - -->
<target name="subprojects-clean">
<subant buildpath="../arduino-core" target="clean"/>
<subant buildpath="../app" target="clean"/>
</target>
<target name="subprojects-build">
<subant buildpath="../arduino-core" target="build"/>
<subant buildpath="../app" target="build"/>
</target>
<target name="subprojects-test">
<subant buildpath="../app" target="test"/>
</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>
<copy file="shared/icons/48x48/apps/arduino.png" tofile="${target.path}/lib/arduino_small.png"/>
<antcall target="assemble-hardware" />
<!-- copy shared examples folder -->
<copy todir="${target.path}/examples">
<fileset dir="shared/examples" />
</copy>
2015-06-17 16:28:55 +02:00
<mkdir dir="${target.path}/reference"/>
<!-- Unzip documentation -->
2015-02-08 18:00:47 +01:00
<antcall target="unzip">
2015-10-26 15:36:36 +01:00
<param name="archive_file" value="shared/reference-1.6.6-3.zip" />
<param name="archive_url" value="http://downloads.arduino.cc/reference-1.6.6-3.zip" />
2015-06-17 16:28:55 +02:00
<param name="final_folder" value="${target.path}/reference/www.arduino.cc" />
<param name="dest_folder" value="${target.path}/reference/" />
2015-02-08 18:00:47 +01:00
</antcall>
2015-03-24 23:25:42 +01:00
<antcall target="unzip">
<param name="archive_file" value="shared/Galileo_help_files-1.6.2.zip" />
<param name="archive_url" value="http://downloads.arduino.cc/Galileo_help_files-1.6.2.zip" />
2015-03-24 23:25:42 +01:00
<param name="final_folder" value="${target.path}/reference/Galileo_help_files" />
<param name="dest_folder" value="${target.path}/reference/" />
</antcall>
<antcall target="unzip">
<param name="archive_file" value="shared/Edison_help_files-1.6.2.zip" />
<param name="archive_url" value="http://downloads.arduino.cc/Edison_help_files-1.6.2.zip" />
2015-03-24 23:25:42 +01:00
<param name="final_folder" value="${target.path}/reference/Edison_help_files" />
<param name="dest_folder" value="${target.path}/reference/" />
</antcall>
<!-- Write the revision file! -->
<echo file="${target.path}/lib/version.txt" message="${version}" />
<antcall target="assemble-libraries" />
</target>
<!-- copy library folder -->
<target name="assemble-libraries" unless="light_bundle">
<copy todir="${target.path}/libraries">
2015-10-28 16:29:05 +01:00
<fileset dir="../libraries"/>
</copy>
2016-03-08 17:13:57 +01:00
<download-library name="Firmata" version="2.5.2"/>
<download-library name="Bridge" version="1.6.1"/>
<download-library name="Robot_Control" version="1.0.2"/>
<download-library name="Robot_Motor" version="1.0.2"/>
<download-library name="RobotIRremote" version="1.0.2"/>
<download-library name="SpacebrewYun" version="1.0.0"/>
2016-03-08 17:13:57 +01:00
<download-library name="Temboo" version="1.1.5"/>
<download-library name="Esplora" version="1.0.4"/>
2016-03-08 17:13:57 +01:00
<download-library name="Mouse" version="1.0.1"/>
<download-library name="Keyboard" version="1.0.1"/>
2015-09-21 13:22:41 +02:00
</target>
<macrodef name="download-library">
<attribute name="name"/>
<attribute name="version"/>
<attribute name="tag" default="@{version}"/>
<attribute name="githubuser" default="arduino-libraries"/>
<sequential>
<antcall target="unzip">
<param name="archive_file" value="@{name}-@{version}.zip"/>
<param name="archive_url" value="https://github.com/@{githubuser}/@{name}/archive/@{tag}.zip"/>
<param name="final_folder" value="${target.path}/libraries/@{name}-@{version}"/>
<param name="dest_folder" value="${target.path}/libraries"/>
</antcall>
<move file="${target.path}/libraries/@{name}-@{version}" tofile="${target.path}/libraries/@{name}"/>
</sequential>
</macrodef>
<!-- copy hardware folder -->
<target name="assemble-hardware" unless="light_bundle">
<copy todir="${target.path}/hardware">
<fileset dir="../hardware">
<exclude name="arduino/sam/**"/>
</fileset>
</copy>
</target>
<!-- - - - - - - - - -->
<!-- Revision check -->
<!-- - - - - - - - - -->
<target name="revision-check" depends="package-library-index-json-bundle">
<!-- figure out the AVR core version number in platform.txt -->
<loadfile srcfile="../hardware/arduino/avr/platform.txt" property="revision.avr.platform">
<filterchain>
<tokenfilter>
<linetokenizer />
<containsregex pattern="version="/>
<replaceregex pattern="version=(.*)" flags="g" replace="\1"/>
</tokenfilter>
</filterchain>
</loadfile>
<!-- figure out the latest AVR core version number in package_index.json -->
<loadfile srcfile="${staging_folder}/work/${staging_hardware_folder}/../dist/package_index.json" property="revision.avr.index">
<filterchain>
<tokenfilter>
<linetokenizer />
<containsregex pattern="archiveFileName.*avr-.......?tar.bz2"/>
<replaceregex pattern=".*avr-(.*).tar.bz2.*" flags="g" replace="\1"/>
</tokenfilter>
<tailfilter lines="1"/>
</filterchain>
</loadfile>
<echo message="AVR Arduino core version in platform.txt is: ${revision.avr.platform}" />
<echo message=" latest in index.json is: ${revision.avr.index}" />
<condition property="revision.avr.ok">
<or>
<!-- fail build if -Drevision.check=enforce is set -->
<not><equals arg1="${revision.check}" arg2="enforce"/></not>
<equals arg1="${revision.avr.index}" arg2="${revision.avr.platform}"/>
</or>
</condition>
<fail unless="revision.avr.ok">
Mismatching versions for bundled AVR core and package_index.json.
Please check your platform.txt and package_index.json.
</fail>
<!-- figure out the IDE version number -->
<loadfile srcfile="shared/revisions.txt" property="revision">
<filterchain>
<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>
</filterchain>
</loadfile>
<!-- figure out the IDE version number in base.java -->
<loadfile srcfile="../arduino-core/src/processing/app/BaseNoGui.java"
property="revision.base">
<filterchain>
<tokenfilter>
<linetokenizer />
<containsregex pattern="String VERSION_NAME = "/>
<replaceregex pattern=".*&quot;(.*)&quot;.*" flags="g" replace="\1"/>
</tokenfilter>
</filterchain>
</loadfile>
<echo message="Latest revision detected in shared/revision.txt is: ${revision}" />
<echo message=" Revision in BaseNoGui.java is: ${revision.base}" />
</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" />
<delete>
<fileset dir="macosx" includes="arduino-*macosx*.zip"/>
</delete>
</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>
<target name="macosx-build" if="macosx" depends="revision-check, macosx-checkos, subprojects-build" description="Build Mac OS X version">
<fail unless="MACOSX_BUNDLED_JVM" message="MacOSX requires MACOSX_BUNDLED_JVM property set"/>
<mkdir dir="${staging_folder}/work" />
<antcall target="unzip">
<param name="archive_file" value="${staging_folder}/appbundler-1.0ea-arduino4.jar.zip" />
<param name="archive_url" value="http://downloads.arduino.cc/appbundler-1.0ea-arduino4.jar.zip" />
<param name="final_folder" value="${staging_folder}/appbundler-1.0ea-arduino4" />
<param name="dest_folder" value="${staging_folder}/appbundler-1.0ea-arduino4" />
</antcall>
<taskdef name="bundleapp" classname="com.oracle.appbundler.AppBundlerTask" classpath="${staging_folder}/appbundler-1.0ea-arduino4/appbundler-1.0ea-arduino4.jar"/>
<bundleapp
jvmRequired="1.8"
jrepreferred="true"
outputdirectory="${staging_folder}/work"
name="Arduino"
displayname="Arduino"
executablename="Arduino"
identifier="cc.arduino.Arduino"
shortversion="${version}"
version="${revision}"
signature="Pde1"
icon="macosx/processing.icns"
mainclassname="processing.app.Base"
copyright="Arduino LLC"
applicationCategory="public.app-category.education"
minimumsystemversion="10.7"
highresolutioncapable="true">
<runtime dir="${MACOSX_BUNDLED_JVM}"/>
<arch name="x86_64"/>
<arch name="i386"/>
<classpath refid="runtime.jars"/>
<option value="-Dapple.awt.application.name=Arduino"/>
<option value="-Dapple.laf.useScreenMenuBar=true"/>
<option value="-Dcom.apple.macos.use-file-dialog-packages=true"/>
<option value="-Dcom.apple.smallTabs=true"/>
<option value="-Dcom.apple.macos.useScreenMenuBar=true"/>
<option value="-DAPP_DIR=$APP_ROOT/Contents/Java"/>
<option value="-Djava.ext.dirs=$JVM_RUNTIME/Contents/Home/lib/ext/:$JVM_RUNTIME/Contents/Home/jre/lib/ext/"/>
<!--
<option value="-Dapple.awt.showGrowBox=false"/>
<option value="-Dapple.awt.Antialiasing=false"/>
<option value="-Dapple.awt.TextAntialiasing=true"/>
<option value="-Dcom.apple.hwaccel=true"/>
<option value="-Dapple.awt.graphics.UseQuartz=true"/>
-->
<!--<option value="-Dcom.apple.macos.useScreenMenuBar=true"/>-->
<!-- Workaround since the icon parameter for bundleapp doesn't work -->
<option value="-Xdock:name=Arduino"/>
<option value="-Dcom.apple.mrj.application.apple.menu.about.name=Arduino"/>
<option value="-Dfile.encoding=UTF-8"/>
<option value="-Xms128M"/>
2015-03-12 09:25:57 +01:00
<option value="-Xmx512M"/>
2015-03-11 16:26:59 +01:00
<option value="-splash:$APP_ROOT/Contents/Java/lib/splash.png"/>
<bundledocument extensions="ino,c,cpp,h"
icon="macosx/pde.icns"
name="Arduino Source File"
role="Editor" ispackage="false">
</bundledocument>
</bundleapp>
<mkdir dir="${staging_folder}/work/${staging_hardware_folder}" />
<copy todir="${staging_folder}/work/${staging_hardware_folder}/../">
<fileset dir="shared" includes="lib/**" />
<fileset file="shared/revisions.txt" />
</copy>
<mkdir dir="${staging_folder}/work" />
<mkdir dir="${staging_folder}/work/${staging_hardware_folder}" />
<antcall target="macosx-build-avr-toolchain" />
<antcall target="package-library-index-json-bundle"/>
<antcall target="assemble">
<param name="target.path" value="${staging_folder}/work/${staging_hardware_folder}/.." />
</antcall>
2012-05-16 13:44:51 +02:00
<antcall target="unzip">
<param name="archive_file" value="./libastylej-2.05.1-2.zip" />
<param name="archive_url" value="http://downloads.arduino.cc/libastylej-2.05.1-2.zip" />
<param name="final_folder" value="${staging_folder}/libastylej-2.05.1" />
<param name="dest_folder" value="${staging_folder}" />
</antcall>
<copy file="macosx/libastylej-2.05.1/libastylej.jnilib" todir="macosx/work/${staging_hardware_folder}/../lib/" />
<chmod perm="755" file="macosx/work/${staging_hardware_folder}/../lib/libastylej.jnilib" />
<copy file="macosx/libastylej-2.05.1/libastylej.jnilib" tofile="macosx/work/${staging_hardware_folder}/../lib/libastylej.dylib" />
<chmod perm="755" file="macosx/work/${staging_hardware_folder}/../lib/libastylej.dylib" />
<antcall target="unzip">
2016-04-01 11:40:32 +02:00
<param name="archive_file" value="./liblistSerials-${LIBLISTSERIAL-VERSION}.zip" />
<param name="archive_url" value="http://downloads.arduino.cc/liblistSerials/liblistSerials-${LIBLISTSERIAL-VERSION}.zip" />
<param name="final_folder" value="${staging_folder}/liblistSerials-${LIBLISTSERIAL-VERSION}" />
<param name="dest_folder" value="${staging_folder}" />
</antcall>
2016-04-01 11:40:32 +02:00
<copy file="macosx/liblistSerials-${LIBLISTSERIAL-VERSION}/osx/liblistSerialsj.dylib" todir="macosx/work/${staging_hardware_folder}/../lib/" />
<chmod perm="755" file="macosx/work/${staging_hardware_folder}/../lib/liblistSerialsj.dylib" />
<delete dir="${staging_folder}/arduino-builder-macosx" includeemptydirs="true"/>
2015-08-31 16:05:23 +02:00
<mkdir dir="${staging_folder}/arduino-builder-macosx"/>
<antcall target="untar">
<param name="archive_file" value="./arduino-builder-macosx-${ARDUINO-BUILDER-VERSION}.tar.bz2" />
<param name="archive_url" value="http://downloads.arduino.cc/tools/arduino-builder-macosx-${ARDUINO-BUILDER-VERSION}.tar.bz2" />
<param name="final_folder" value="${staging_folder}/arduino-builder-macosx/arduino-builder" />
<param name="dest_folder" value="${staging_folder}/arduino-builder-macosx" />
</antcall>
<copy file="${staging_folder}/arduino-builder-macosx/arduino-builder" tofile="macosx/work/${staging_hardware_folder}/../arduino-builder" />
<chmod perm="755" file="macosx/work/${staging_hardware_folder}/../arduino-builder" />
<move file="${staging_folder}/arduino-builder-macosx/tools" tofile="macosx/work/${staging_hardware_folder}/../tools-builder"/>
<copy todir="macosx/work/${staging_hardware_folder}" overwrite="true">
<fileset dir="${staging_folder}/arduino-builder-macosx/hardware" includes="*.txt"/>
</copy>
<delete dir="${staging_folder}/arduino-builder-macosx" includeemptydirs="true"/>
<antcall target="portable-${portable}">
<param name="parentdir" value="macosx/work/${staging_hardware_folder}/.." />
</antcall>
</target>
<!-- Unzip AVR tools -->
<target name="macosx-build-avr-toolchain" unless="light_bundle">
<antcall target="avr-toolchain-bundle">
<param name="unpack_target" value="untar"/>
2015-04-23 10:56:56 +02:00
<param name="gcc_archive_file" value="avr-gcc-4.8.1-arduino5-i386-apple-darwin11.tar.bz2"/>
<param name="gcc_version" value="4.8.1-arduino5"/>
<param name="avrdude_archive_file" value="avrdude-6.0.1-arduino5-r2-i386-apple-darwin11.tar.bz2"/>
2015-04-23 10:56:56 +02:00
<param name="avrdude_version" value="6.0.1-arduino5"/>
</antcall>
<chmod perm="+x">
<fileset dir="${staging_folder}/work/${staging_hardware_folder}/tools" includes="**/bin/*"/>
<fileset dir="${staging_folder}/work/${staging_hardware_folder}/tools" includes="**/libexec/gcc/avr/4.8.1/*"/>
</chmod>
<!-- macosx gatekeeper workaround. See https://github.com/arduino/Arduino/issues/3468 -->
<chmod perm="-x">
<fileset dir="${staging_folder}/work/${staging_hardware_folder}/tools" includes="**/bin/avrdude_bin" />
</chmod>
</target>
<target name="macosx-run" depends="build,start"/>
<target name="macosx-start">
<exec executable="macosx/work/Arduino.app/Contents/MacOS/Arduino" spawn="false" failonerror="true"/>
</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 -->
<exec executable="unzip" dir="macosx/work" failonerror="true">
2013-02-05 16:30:00 +01:00
<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" failonerror="true">
2013-02-04 14:46:27 +01:00
<arg line="unlock-keychain -p &quot;${macosx-sign-keychain-pass}&quot; &quot;${macosx-sign-keychain}&quot;" />
</exec>
2013-02-01 23:51:50 +01:00
<!-- Sign app -->
<exec executable="codesign" dir="macosx/work" failonerror="true">
2015-03-27 17:29:34 +01:00
<arg line="--keychain &quot;${macosx-sign-keychain}&quot; --force -s &quot;${macosx-sign-id}&quot; --deep -v Arduino.app/" />
2013-02-01 23:51:50 +01:00
</exec>
<!-- 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" failonerror="true">
<arg line="-q -r ../arduino-${full-version}-signed.zip ." />
2013-02-01 23:51:50 +01:00
</exec>
<echo>
=======================================================
Arduino for Mac OS X built and signed.
macosx/arduino-${full-version}-signed.zip
2013-02-01 23:51:50 +01:00
=======================================================
</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. -->
<!-- - - - - - - - - - - - - - - - - - - -->
<target name="macosx-dist" if="macosx" depends="build" description="Create a downloadable .zip for the Mac OS X version">
<exec executable="zip" dir="macosx/work" failonerror="true">
<arg line="-q -r ../arduino-${full-version}.zip ." />
</exec>
<echo>
=======================================================
Arduino for Mac OS X was built. Grab the image from
macosx/arduino-${full-version}.zip
=======================================================
</echo>
</target>
<!-- - - - - - - - -->
<!-- Linux -->
<!-- - - - - - - - -->
<target name="linux-clean" depends="subprojects-clean" description="Clean linux version">
<delete dir="linux/work" />
<delete>
<fileset dir="linux" includes="arduino-*linux*.tar.xz"/>
</delete>
2015-08-31 16:05:23 +02:00
<delete>
<fileset dir="linux" includes="arduino-*linux*.tar.xz"/>
</delete>
</target>
<target name="linux-checkos" unless="linux">
<echo>
=======================================================
Arduino for Linux can only be built 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" />
<mkdir dir="linux/work/${staging_hardware_folder}" />
<copy todir="linux/work">
<fileset dir="shared" includes="lib/**" />
<fileset file="shared/revisions.txt" />
</copy>
<copy todir="linux/work">
<fileset dir="linux/dist" includes="lib/**" />
</copy>
<copy todir="linux/work/lib">
<fileset dir="shared" includes="icons/**/*.png" />
</copy>
<copy todir="linux/work/lib" flatten="true">
<fileset refid="runtime.jars" />
</copy>
<antcall target="assemble">
<param name="target.path" value="linux/work" />
</antcall>
<copy tofile="linux/work/lib/arduino-arduinoide.xml" file="linux/dist/mime.xml" />
<copy todir="linux/work/lib" file="linux/dist/desktop.template" />
<copy todir="linux/work/lib" file="linux/dist/appdata.xml" />
2012-02-29 22:16:37 +01:00
<copy todir="linux/work" file="linux/dist/arduino" />
<copy todir="linux/work" file="linux/dist/install.sh" />
<copy todir="linux/work" file="linux/dist/uninstall.sh" />
2012-02-29 22:16:37 +01:00
<chmod perm="ugo+x">
<fileset dir="linux/work" includes="arduino" />
<fileset dir="linux/work" includes="**/*.sh" />
</chmod>
2015-12-05 12:51:11 +01:00
</target>
2015-12-05 12:51:11 +01:00
<target name="linux-libastyle-x86" depends="linux-build" description="Download libastyle.so for x86/x64 arch">
<antcall target="unzip">
<param name="archive_file" value="./libastylej-2.05.1-2.zip" />
<param name="archive_url" value="http://downloads.arduino.cc/libastylej-2.05.1-2.zip" />
<param name="final_folder" value="${staging_folder}/libastylej-2.05.1" />
<param name="dest_folder" value="${staging_folder}" />
</antcall>
<copy file="linux/libastylej-2.05.1/libastylej${arch-bits}.so" tofile="linux/work/lib/libastylej.so" />
<chmod perm="755" file="linux/work/lib/libastylej.so" />
<antcall target="portable-${portable}">
<param name="parentdir" value="linux/work" />
</antcall>
<antcall target="unzip">
2016-04-01 11:40:32 +02:00
<param name="archive_file" value="./liblistSerials-${LIBLISTSERIAL-VERSION}.zip" />
<param name="archive_url" value="http://downloads.arduino.cc/liblistSerials/liblistSerials-${LIBLISTSERIAL-VERSION}.zip" />
<param name="final_folder" value="${staging_folder}/liblistSerials-${LIBLISTSERIAL-VERSION}" />
<param name="dest_folder" value="${staging_folder}" />
</antcall>
2016-04-01 11:40:32 +02:00
<copy file="linux/liblistSerials-${LIBLISTSERIAL-VERSION}/linux${arch-bits}/liblistSerialsj.so" todir="linux/work/lib/" />
<chmod perm="755" file="linux/work/lib/liblistSerialsj.so" />
</target>
2015-12-05 12:51:11 +01:00
<target name="linux-libastyle-arm" depends="linux-build" description="Download libastyle.so for ARM">
<antcall target="unzip">
<param name="archive_file" value="./libastylej-2.05.1-2.zip" />
<param name="archive_url" value="http://downloads.arduino.cc/libastylej-2.05.1-2.zip" />
<param name="final_folder" value="${staging_folder}/libastylej-2.05.1" />
<param name="dest_folder" value="${staging_folder}" />
</antcall>
<copy file="linux/libastylej-2.05.1/libastylej_arm.so" tofile="linux/work/lib/libastylej.so" />
<chmod perm="755" file="linux/work/lib/libastylej.so" />
<antcall target="portable-${portable}">
<param name="parentdir" value="linux/work" />
</antcall>
<antcall target="unzip">
<param name="archive_file" value="./liblistSerials-1.0.5.zip" />
<param name="archive_url" value="http://downloads.arduino.cc/liblistSerials/liblistSerials-1.0.5.zip" />
<param name="final_folder" value="${staging_folder}/liblistSerials-1.0.5" />
<param name="dest_folder" value="${staging_folder}" />
</antcall>
<copy file="linux/liblistSerials-1.0.5/arm/liblistSerialsj.so" todir="linux/work/lib/" />
<chmod perm="755" file="linux/work/lib/liblistSerialsj.so" />
</target>
<target name="arm-build" depends="linux-libastyle-arm" description="Build linux (32-bit) version">
<antcall target="linux-jvm-${linux-bundle-jvm-task}">
<param name="JVM" value="${LINUX32_BUNDLED_JVM}"/>
</antcall>
<delete dir="${staging_folder}/arduino-builder-arm" includeemptydirs="true"/>
<mkdir dir="${staging_folder}/arduino-builder-arm"/>
<antcall target="untar">
<param name="archive_file" value="./arduino-builder-arm-${ARDUINO-BUILDER-VERSION}.tar.bz2" />
<param name="archive_url" value="http://downloads.arduino.cc/tools/arduino-builder-arm-${ARDUINO-BUILDER-VERSION}.tar.bz2" />
<param name="final_folder" value="${staging_folder}/arduino-builder-arm/arduino-builder" />
<param name="dest_folder" value="${staging_folder}/arduino-builder-arm" />
</antcall>
<copy file="${staging_folder}/arduino-builder-arm/arduino-builder" tofile="linux/work/arduino-builder" />
<chmod perm="755" file="linux/work/arduino-builder" />
<move file="${staging_folder}/arduino-builder-arm/tools" tofile="linux/work/tools-builder"/>
<copy todir="linux/work/hardware" overwrite="true">
<fileset dir="${staging_folder}/arduino-builder-arm/hardware" includes="*.txt"/>
</copy>
<delete dir="${staging_folder}/arduino-builder-arm" includeemptydirs="true"/>
<antcall target="avr-toolchain-bundle">
<param name="unpack_target" value="untar"/>
<param name="gcc_archive_file" value="avr-gcc-4.8.1-arduino5-armhf-pc-linux-gnu.tar.bz2"/>
<param name="gcc_version" value="4.8.1-arduino5"/>
<param name="avrdude_archive_file" value="avrdude-6.0.1-arduino5-armhf-pc-linux-gnu.tar.bz2"/>
<param name="avrdude_version" value="6.0.1-arduino5"/>
</antcall>
<antcall target="package-library-index-json-bundle"/>
</target>
<target name="linux32-build" depends="linux-libastyle-x86" description="Build linux (32-bit) version">
<antcall target="linux-jvm-${linux-bundle-jvm-task}">
<param name="JVM" value="${LINUX32_BUNDLED_JVM}"/>
</antcall>
<delete dir="${staging_folder}/arduino-builder-linux32" includeemptydirs="true"/>
2015-08-31 16:05:23 +02:00
<mkdir dir="${staging_folder}/arduino-builder-linux32"/>
<antcall target="untar">
<param name="archive_file" value="./arduino-builder-linux32-${ARDUINO-BUILDER-VERSION}.tar.bz2" />
<param name="archive_url" value="http://downloads.arduino.cc/tools/arduino-builder-linux32-${ARDUINO-BUILDER-VERSION}.tar.bz2" />
<param name="final_folder" value="${staging_folder}/arduino-builder-linux32/arduino-builder" />
<param name="dest_folder" value="${staging_folder}/arduino-builder-linux32" />
</antcall>
<copy file="${staging_folder}/arduino-builder-linux32/arduino-builder" tofile="linux/work/arduino-builder" />
<chmod perm="755" file="linux/work/arduino-builder" />
<move file="${staging_folder}/arduino-builder-linux32/tools" tofile="linux/work/tools-builder"/>
<copy todir="linux/work/hardware" overwrite="true">
<fileset dir="${staging_folder}/arduino-builder-linux32/hardware" includes="*.txt"/>
</copy>
<delete dir="${staging_folder}/arduino-builder-linux32" includeemptydirs="true"/>
<antcall target="avr-toolchain-bundle">
<param name="unpack_target" value="untar"/>
2015-04-23 10:56:56 +02:00
<param name="gcc_archive_file" value="avr-gcc-4.8.1-arduino5-i686-pc-linux-gnu.tar.bz2"/>
<param name="gcc_version" value="4.8.1-arduino5"/>
<param name="avrdude_archive_file" value="avrdude-6.0.1-arduino5-i686-pc-linux-gnu.tar.bz2"/>
<param name="avrdude_version" value="6.0.1-arduino5"/>
</antcall>
<antcall target="package-library-index-json-bundle"/>
</target>
2015-12-05 12:51:11 +01:00
<target name="linux64-build" depends="linux-libastyle-x86" description="Build linux (64-bit) version">
<antcall target="linux-jvm-${linux-bundle-jvm-task}">
<param name="JVM" value="${LINUX64_BUNDLED_JVM}"/>
</antcall>
<delete dir="${staging_folder}/arduino-builder-linux64" includeemptydirs="true"/>
2015-08-31 16:05:23 +02:00
<mkdir dir="${staging_folder}/arduino-builder-linux64"/>
<antcall target="untar">
<param name="archive_file" value="./arduino-builder-linux64-${ARDUINO-BUILDER-VERSION}.tar.bz2" />
<param name="archive_url" value="http://downloads.arduino.cc/tools/arduino-builder-linux64-${ARDUINO-BUILDER-VERSION}.tar.bz2" />
<param name="final_folder" value="${staging_folder}/arduino-builder-linux64/arduino-builder" />
<param name="dest_folder" value="${staging_folder}/arduino-builder-linux64" />
</antcall>
<copy file="${staging_folder}/arduino-builder-linux64/arduino-builder" tofile="linux/work/arduino-builder" />
<chmod perm="755" file="linux/work/arduino-builder" />
<move file="${staging_folder}/arduino-builder-linux64/tools" tofile="linux/work/tools-builder"/>
<copy todir="linux/work/hardware" overwrite="true">
<fileset dir="${staging_folder}/arduino-builder-linux64/hardware" includes="*.txt"/>
</copy>
<delete dir="${staging_folder}/arduino-builder-linux64" includeemptydirs="true"/>
<antcall target="avr-toolchain-bundle">
<param name="unpack_target" value="untar"/>
2015-04-23 10:56:56 +02:00
<param name="gcc_archive_file" value="avr-gcc-4.8.1-arduino5-x86_64-pc-linux-gnu.tar.bz2"/>
<param name="gcc_version" value="4.8.1-arduino5"/>
<param name="avrdude_archive_file" value="avrdude-6.0.1-arduino5-x86_64-pc-linux-gnu.tar.bz2"/>
<param name="avrdude_version" value="6.0.1-arduino5"/>
</antcall>
<antcall target="package-library-index-json-bundle"/>
</target>
<target name="linux-jvm-noop"/>
<target name="linux-jvm-bundle">
<mkdir dir="${staging_folder}/work/java" />
<exec executable="rsync">
<arg value="-a"/>
<arg value="${JVM}"/>
<arg value="${staging_folder}/work/java/"/>
</exec>
</target>
<target name="linux32-run" depends="build,start"/>
<target name="linux64-run" depends="build,start"/>
2015-12-05 12:51:11 +01:00
<target name="arm-run" depends="build,start"/>
<target name="linux32-start">
<exec executable="./linux/work/arduino" spawn="false" failonerror="true"/>
</target>
<target name="linux64-start">
<exec executable="./linux/work/arduino" spawn="false" failonerror="true"/>
</target>
2015-12-05 12:51:11 +01:00
<target name="arm-start">
<exec executable="./linux/work/arduino" spawn="false" failonerror="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="untar-unzip-check">
<available file="${archive_file}" property="${archive_file}_available" />
<available file="${final_folder}" property="${archive_file}_installed" />
2014-02-08 19:57:25 +01:00
</target>
<!-- Retrieve tool -->
<target name="untar-unzip-download" depends="untar-unzip-check" unless="${archive_file}_available">
<get src="${archive_url}" dest="${archive_file}" verbose="true" ignoreerrors="true" />
2014-02-08 19:57:25 +01:00
</target>
<target name="untar-unzip-checksum" depends="untar-unzip-download">
<echo>Testing checksum of "${archive_file}"</echo>
<checksum file="${archive_file}" algorithm="sha" fileext=".sha" verifyproperty="checksum.matches"/>
2014-02-08 19:57:25 +01:00
<condition property="checksum.matches.fail">
<equals arg1="${checksum.matches}" arg2="false"/>
</condition>
<fail if="checksum.matches.fail">Checksum failed.
File ${archive_file} failed checksum.
Please remove "${archive_file}" to download it again.
2014-02-08 19:57:25 +01:00
</fail>
</target>
2014-02-08 19:57:25 +01:00
<!-- Ensure that the tool is downloaded and test checksums, if everything's ok unzip it on the tools folder -->
<target name="untar" depends="untar-unzip-checksum" unless="${archive_file}_installed">
<echo>Untarring ${archive_file} into folder ${dest_folder}</echo>
<exec executable="tar" failonerror="true">
<arg value="xf"/>
<arg value="${archive_file}"/>
<arg value="--directory=${dest_folder}"/>
2014-02-08 19:57:25 +01:00
</exec>
</target>
<target name="unzip" depends="untar-unzip-checksum" unless="${archive_file}_installed">
<echo>Unzipping ${archive_file} into folder ${dest_folder}</echo>
<mkdir dir="${dest_folder}" />
<exec executable="unzip" failonerror="true">
<arg value="-q" />
<arg value="-n" />
<arg value="-d" />
<arg value="${dest_folder}" />
<arg value="${archive_file}" />
</exec>
</target>
<target name="unzip-with-ant-task" depends="untar-unzip-checksum" unless="${archive_file}_installed">
<echo>Unzipping ${archive_file} into folder ${dest_folder}</echo>
<mkdir dir="${dest_folder}" />
<unzip src="${archive_file}" dest="${dest_folder}"/>
</target>
<target name="linux-dist" depends="build"
description="Build .tar.xz of linux version">
<move file="linux/work" tofile="linux/arduino-${version}" />
<exec executable="tar" dir="linux" failonerror="true">
<arg value="--lzma"/>
<arg value="-c"/>
<arg value="-f"/>
<arg value="arduino-${full-version}.tar.xz"/>
<arg value="arduino-${version}"/>
</exec>
<move file="linux/arduino-${version}" tofile="linux/work" />
<echo>
=======================================================
Arduino for Linux was built. Grab the archive from
linux/arduino-${full-version}.tar.xz
=======================================================
</echo>
</target>
<target name="linux32-dist" depends="linux-dist"
description="Build .tar.xz of linux version" />
<target name="linux64-dist" depends="linux-dist"
description="Build .tar.xz of linux version" />
2015-12-05 12:51:11 +01:00
<target name="arm-dist" depends="linux-dist"
description="Build .tar.xz of linux version" />
<!-- - - - - - - - -->
<!-- Windows -->
<!-- - - - - - - - -->
<target name="windows-clean" depends="subprojects-clean"
description="Clean windows version">
<delete dir="windows/work" />
<delete>
<fileset dir="windows" includes="arduino-*windows*.zip"/>
</delete>
</target>
<target name="windows-checkos" unless="windows">
<echo>
=======================================================
Arduino for Windows can only be built on windows.
Bye.
=======================================================
</echo>
<fail message="wrong platform (${os.name})" />
</target>
<target name="download-launch4j-windows">
<antcall target="unzip-with-ant-task">
<param name="archive_file" value="windows/launch4j-3.8-win32.zip"/>
<param name="archive_url" value="http://downloads.sourceforge.net/project/launch4j/launch4j-3/3.8/launch4j-3.8-win32.zip"/>
<param name="final_folder" value="windows/launcher/launch4j"/>
<param name="dest_folder" value="windows/launcher/"/>
</antcall>
</target>
<target name="download-launch4j-linux">
<antcall target="untar">
<param name="archive_file" value="windows/launch4j-3.8-linux.tgz"/>
<param name="archive_url" value="http://downloads.sourceforge.net/project/launch4j/launch4j-3/3.8/launch4j-3.8-linux.tgz"/>
<param name="final_folder" value="windows/launcher/launch4j"/>
<param name="dest_folder" value="windows/launcher/"/>
</antcall>
</target>
<target name="windows-build"
depends="revision-check, windows-checkos, subprojects-build"
description="Build windows version">
<mkdir dir="windows/work" />
<mkdir dir="windows/work/${staging_hardware_folder}" />
<copy todir="windows/work/lib">
<fileset dir="shared" includes="icons/**/*.png"/>
</copy>
<!-- 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>
<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"/>
<copy todir="windows/work">
<fileset dir="windows/dist" includes="*.dll" />
</copy>
<copy todir="windows/work">
<fileset dir="windows/dist" includes="drivers/**" />
</copy>
<antcall target="windows-build-avr-toolchain" />
<antcall target="unzip">
<param name="archive_file" value="./libastylej-2.05.1-2.zip" />
<param name="archive_url" value="http://downloads.arduino.cc/libastylej-2.05.1-2.zip" />
<param name="final_folder" value="${staging_folder}/libastylej-2.05.1" />
<param name="dest_folder" value="${staging_folder}" />
</antcall>
<copy file="windows/libastylej-2.05.1/AStylej.dll" todir="windows/work/lib" />
2015-01-19 19:38:08 +01:00
<copy file="windows/msvcp100.dll" todir="windows/work" />
<copy file="windows/msvcr100.dll" todir="windows/work" />
<antcall target="unzip">
2016-04-01 11:40:32 +02:00
<param name="archive_file" value="./liblistSerials-${LIBLISTSERIAL-VERSION}.zip" />
<param name="archive_url" value="http://downloads.arduino.cc/liblistSerials/liblistSerials-${LIBLISTSERIAL-VERSION}.zip" />
<param name="final_folder" value="${staging_folder}/liblistSerials-${LIBLISTSERIAL-VERSION}" />
<param name="dest_folder" value="${staging_folder}" />
</antcall>
2016-04-01 11:40:32 +02:00
<copy file="windows/liblistSerials-${LIBLISTSERIAL-VERSION}/windows/listSerialsj.dll" todir="windows/work/lib/" />
<chmod perm="755" file="windows/work/lib/listSerialsj.dll" />
2012-04-02 18:30:53 +02:00
<delete dir="${staging_folder}/arduino-builder-windows" includeemptydirs="true"/>
2015-08-31 16:05:23 +02:00
<mkdir dir="${staging_folder}/arduino-builder-windows"/>
2015-09-14 17:05:56 +02:00
<antcall target="unzip-with-ant-task">
2015-08-31 16:05:23 +02:00
<param name="archive_file" value="./arduino-builder-windows-${ARDUINO-BUILDER-VERSION}.zip" />
<param name="archive_url" value="http://downloads.arduino.cc/tools/arduino-builder-windows-${ARDUINO-BUILDER-VERSION}.zip" />
<param name="final_folder" value="${staging_folder}/arduino-builder-windows/arduino-builder.exe" />
<param name="dest_folder" value="${staging_folder}/arduino-builder-windows" />
</antcall>
<copy file="${staging_folder}/arduino-builder-windows/arduino-builder.exe" tofile="windows/work/arduino-builder.exe" />
<chmod perm="755" file="windows/work/arduino-builder.exe" />
<move file="${staging_folder}/arduino-builder-windows/tools" tofile="windows/work/tools-builder"/>
2016-03-09 15:44:52 +01:00
<chmod perm="755" file="windows/work/tools-builder/ctags/5.8-arduino10/ctags.exe" />
2015-08-31 16:05:23 +02:00
<copy todir="windows/work/hardware" overwrite="true">
<fileset dir="${staging_folder}/arduino-builder-windows/hardware" includes="*.txt"/>
</copy>
<delete dir="${staging_folder}/arduino-builder-windows" includeemptydirs="true"/>
<antcall target="assemble">
<param name="target.path" value="windows/work" />
</antcall>
<delete dir="windows/launcher/launch4j"/>
<antcall target="download-${launch4j-download-unpack-target-name}" />
<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"
2015-03-17 10:49:16 +01:00
includes="application.ico, config.xml, config_debug.xml, arduino.l4j.ini"/>
</copy>
2015-05-25 17:49:46 +02:00
<launch4j configFile="windows/work/config.xml" fileVersion="${revision}.0" txtFileVersion="${revision}" productVersion="${revision}.0" txtProductVersion="${revision}"/>
<launch4j configFile="windows/work/config_debug.xml" fileVersion="${revision}.0" txtFileVersion="${revision}" productVersion="${revision}.0" txtProductVersion="${revision}"/>
2015-03-17 10:49:16 +01:00
<delete dir="windows/work" includes="application.ico, config.xml, config_debug.xml" />
<copy file="windows/work/arduino.l4j.ini" tofile="windows/work/arduino_debug.l4j.ini" />
<!-- cygwin requires html, dll, and exe to have the +x flag -->
<chmod perm="755">
<fileset dir="windows/work" includes="**/*.html, **/*.dll, **/*.exe" />
</chmod>
<!-- For JVM within JDK, release file is in parent directory -->
<property file="${WINDOWS_BUNDLED_JVM}/release" prefix="windows"/>
<property file="${WINDOWS_BUNDLED_JVM}/../release" prefix="windows"/>
<fail message="It looks like ${WINDOWS_BUNDLED_JVM} does not contain a Windows JVM">
<condition>
<not>
<equals arg1="${windows.OS_NAME}" arg2="&quot;Windows&quot;"/>
</not>
</condition>
</fail>
<copy todir="${staging_folder}/work/java" includeemptydirs="true" preservelastmodified="true" overwrite="true" failonerror="true">
<fileset dir="${WINDOWS_BUNDLED_JVM}" includes="*/**"/>
</copy>
<antcall target="portable-${portable}">
<param name="parentdir" value="${staging_folder}/work" />
</antcall>
</target>
<target name="windows-build-avr-toolchain">
<antcall target="avr-toolchain-bundle">
<param name="unpack_target" value="unzip"/>
2015-04-23 10:56:56 +02:00
<param name="gcc_archive_file" value="avr-gcc-4.8.1-arduino5-i686-mingw32.zip"/>
<param name="gcc_version" value="4.8.1-arduino5"/>
<param name="avrdude_archive_file" value="avrdude-6.0.1-arduino5-i686-mingw32.zip"/>
<param name="avrdude_version" value="6.0.1-arduino5"/>
</antcall>
<antcall target="package-library-index-json-bundle"/>
</target>
<target name="windows-run" depends="build,start"/>
<target name="windows-start">
<exec executable="windows/work/arduino.exe" dir="windows/work" spawn="false" failonerror="true"/>
</target>
<target name="windows-dist" depends="build" description="Create .zip files of windows version">
<zip destfile="windows/arduino-${full-version}.zip" level="9">
2015-03-13 13:21:49 +01:00
<zipfileset dir="windows/work" prefix="arduino-${version}"/>
</zip>
<echo>
=======================================================
Arduino for Windows was built. Grab the archive from
windows/arduino-${full-version}.zip
=======================================================
</echo>
</target>
<!-- - - - - - - - -->
<!-- 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,
**/build/macosx/,
**/build/windows/,
**/work/,
**/.git/,
**/*.class"
/>
</tar>
<echo>
=======================================================
Arduino source distribution was built. Grab the archive from
arduino-${version}-src.tar.gz
=======================================================
</echo>
</target>
<!-- - - - - - - - -->
<!-- Run It! -->
<!-- - - - - - - - -->
<target name="clean" description="Perform a spring cleaning"
depends="linux-clean, windows-clean, macosx-clean, subprojects-clean">
</target>
<target name="avr-toolchain-bundle" unless="light_bundle">
<!-- Unzip AVR tools -->
<mkdir dir="${staging_folder}/work/${staging_hardware_folder}/tmp/gcc"/>
<antcall target="${unpack_target}">
<param name="archive_file" value="${staging_folder}/${gcc_archive_file}"/>
<param name="archive_url" value="http://downloads.arduino.cc/tools/${gcc_archive_file}"/>
<param name="final_folder" value="${staging_folder}/work/${staging_hardware_folder}/tmp/gcc/${gcc_version}/"/>
<param name="dest_folder" value="${staging_folder}/work/${staging_hardware_folder}/tmp/gcc/"/>
</antcall>
<mkdir dir="${staging_folder}/work/${staging_hardware_folder}/tmp/avrdude"/>
<antcall target="${unpack_target}">
<param name="archive_file" value="${staging_folder}/${avrdude_archive_file}"/>
<param name="archive_url" value="http://downloads.arduino.cc/tools/${avrdude_archive_file}"/>
<param name="final_folder" value="${staging_folder}/work/${staging_hardware_folder}/tmp/avrdude/${avrdude_version}"/>
<param name="dest_folder" value="${staging_folder}/work/${staging_hardware_folder}/tmp/avrdude/"/>
</antcall>
<move file="${staging_folder}/work/${staging_hardware_folder}/tmp/gcc/avr" tofile="${staging_folder}/work/${staging_hardware_folder}/tools/avr"/>
<move file="${staging_folder}/work/${staging_hardware_folder}/tmp/avrdude/avrdude-6.0.1" tofile="${staging_folder}/work/${staging_hardware_folder}/tools/avr"/>
<antcall target="macosx-fix-bundled-toolchain-missing-symlinks"/>
<echo append="true" file="${staging_folder}/work/${staging_hardware_folder}/tools/avr/builtin_tools_versions.txt" message="arduino.avrdude=${avrdude_version}${line.separator}"/>
<echo append="true" file="${staging_folder}/work/${staging_hardware_folder}/tools/avr/builtin_tools_versions.txt" message="arduino.avr-gcc=${gcc_version}${line.separator}"/>
</target>
<target name="package-library-index-json-bundle">
<mkdir dir="${staging_folder}/work/${staging_hardware_folder}/../dist/"/>
<get src="${package_index_url}.gz"
dest="${staging_folder}/work/${staging_hardware_folder}/../dist/package_index.json.gz"
verbose="true" skipexisting="false" />
<gunzip src ="${staging_folder}/work/${staging_hardware_folder}/../dist/package_index.json.gz"
dest="${staging_folder}/work/${staging_hardware_folder}/../dist/"/>
<delete file="${staging_folder}/work/${staging_hardware_folder}/../dist/package_index.json.gz"/>
<get src="${package_index_url}.sig"
dest="${staging_folder}/work/${staging_hardware_folder}/../dist/package_index.json.sig"
verbose="true" skipexisting="false" />
<get src="${library_index_url}.gz"
dest="${staging_folder}/work/${staging_hardware_folder}/../dist/library_index.json.gz"
verbose="true" skipexisting="false" />
<gunzip src ="${staging_folder}/work/${staging_hardware_folder}/../dist/library_index.json.gz"
dest="${staging_folder}/work/${staging_hardware_folder}/../dist/"/>
<delete file="${staging_folder}/work/${staging_hardware_folder}/../dist/library_index.json.gz"/>
<delete dir="${staging_folder}/work/${staging_hardware_folder}/tmp"/>
</target>
<target name="macosx-fix-bundled-toolchain-missing-symlinks" if="macosx">
<exec executable="mv" failonerror="true">
<arg value="${staging_folder}/work/${staging_hardware_folder}/tmp/avrdude/avrdude-6.0.1/lib/libusb.dylib"/>
<arg value="${staging_folder}/work/${staging_hardware_folder}/tools/avr/lib/"/>
</exec>
<exec executable="mv" failonerror="true">
<arg value="${staging_folder}/work/${staging_hardware_folder}/tmp/avrdude/avrdude-6.0.1/lib/libusb-1.0.dylib"/>
<arg value="${staging_folder}/work/${staging_hardware_folder}/tools/avr/lib/"/>
</exec>
</target>
<target name="generate-hourly-build-txt" if="hourly">
<echo file="${staging_folder}/work/${staging_hardware_folder}/../lib/hourlyBuild.txt">${BUILD_DATE}</echo>
</target>
<target name="portable-true">
<mkdir dir="${parentdir}/portable"/>
</target>
<target name="portable-false"/>
</project>