Skip to content

Commit a284871

Browse files
author
Federico Fissore
committed
Added -Dportable=true param to ant. You can build your own portable version of
the IDE
1 parent 66117a5 commit a284871

File tree

1 file changed

+38
-14
lines changed

1 file changed

+38
-14
lines changed

build/build.xml

+38-14
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@
7171
</or>
7272
</condition>
7373

74+
<property name="portable" value="false" />
75+
7476
<property name="ARDUINO-BUILDER-VERSION" value="1.3.5" />
7577

7678
<!-- Libraries required for running arduino -->
@@ -95,12 +97,19 @@
9597
<antcall target="${platform}-start" />
9698
</target>
9799

98-
<target name="dist" depends="revision-check"
99-
description="Build Arduino for distribution.">
100-
<input message="Enter version number:"
101-
addproperty="version"
102-
defaultvalue="${revision}" />
103-
<antcall target="${platform}-dist" />
100+
<target name="dist" depends="revision-check" description="Build Arduino for distribution.">
101+
<input message="Enter version number:" addproperty="version" defaultvalue="${revision}"/>
102+
<condition property="full-version" value="${version}-${platform}">
103+
<not>
104+
<equals arg1="${portable}" arg2="true"/>
105+
</not>
106+
</condition>
107+
<condition property="full-version" value="${version}-${platform}-portable">
108+
<equals arg1="${portable}" arg2="true"/>
109+
</condition>
110+
<antcall target="${platform}-dist">
111+
<param name="full-version" value="${full-version}"/>
112+
</antcall>
104113
</target>
105114

106115
<!-- "§$§$&, ant doesn't have a built-in help target :( -->
@@ -400,6 +409,9 @@
400409
</copy>
401410
<delete dir="${staging_folder}/arduino-builder-macosx" includeemptydirs="true"/>
402411

412+
<antcall target="portable-${portable}">
413+
<param name="parentdir" value="macosx/work/${staging_hardware_folder}/.." />
414+
</antcall>
403415
</target>
404416

405417
<!-- Unzip AVR tools -->
@@ -463,14 +475,14 @@
463475

464476
<!-- Create signed zip file -->
465477
<exec executable="zip" dir="macosx/work" failonerror="true">
466-
<arg line="-q -r ../arduino-${version}-${platform}-signed.zip ." />
478+
<arg line="-q -r ../arduino-${full-version}-signed.zip ." />
467479
</exec>
468480

469481
<echo>
470482
=======================================================
471483
Arduino for Mac OS X built and signed.
472484

473-
macosx/arduino-${version}-${platform}-signed.zip
485+
macosx/arduino-${full-version}-signed.zip
474486
=======================================================
475487
</echo>
476488
</target>
@@ -486,14 +498,14 @@
486498
<!-- - - - - - - - - - - - - - - - - - - -->
487499
<target name="macosx-dist" if="macosx" depends="build" description="Create a downloadable .zip for the Mac OS X version">
488500
<exec executable="zip" dir="macosx/work" failonerror="true">
489-
<arg line="-q -r ../arduino-${version}-${platform}.zip ." />
501+
<arg line="-q -r ../arduino-${full-version}.zip ." />
490502
</exec>
491503

492504
<echo>
493505
=======================================================
494506
Arduino for Mac OS X was built. Grab the image from
495507

496-
macosx/arduino-${version}-${platform}.zip
508+
macosx/arduino-${full-version}.zip
497509
=======================================================
498510
</echo>
499511
</target>
@@ -569,6 +581,10 @@
569581
</antcall>
570582
<copy file="linux/libastylej-2.05.1/libastylej${arch-bits}.so" tofile="linux/work/lib/libastylej.so" />
571583
<chmod perm="755" file="linux/work/lib/libastylej.so" />
584+
585+
<antcall target="portable-${portable}">
586+
<param name="parentdir" value="linux/work" />
587+
</antcall>
572588
</target>
573589

574590
<target name="linux32-build" depends="linux-build" description="Build linux (32-bit) version">
@@ -722,7 +738,7 @@
722738
<arg value="--lzma"/>
723739
<arg value="-c"/>
724740
<arg value="-f"/>
725-
<arg value="arduino-${version}-${platform}.tar.xz"/>
741+
<arg value="arduino-${full-version}.tar.xz"/>
726742
<arg value="arduino-${version}"/>
727743
</exec>
728744

@@ -732,7 +748,7 @@
732748
=======================================================
733749
Arduino for Linux was built. Grab the archive from
734750

735-
linux/arduino-${version}-${platform}.tar.xz
751+
linux/arduino-${full-version}.tar.xz
736752
=======================================================
737753
</echo>
738754
</target>
@@ -895,6 +911,10 @@
895911
<copy todir="${staging_folder}/work/java" includeemptydirs="true" preservelastmodified="true" overwrite="true" failonerror="true">
896912
<fileset dir="${WINDOWS_BUNDLED_JVM}" includes="*/**"/>
897913
</copy>
914+
915+
<antcall target="portable-${portable}">
916+
<param name="parentdir" value="${staging_folder}/work" />
917+
</antcall>
898918
</target>
899919

900920
<target name="windows-build-avr-toolchain">
@@ -916,15 +936,15 @@
916936
</target>
917937

918938
<target name="windows-dist" depends="build" description="Create .zip files of windows version">
919-
<zip destfile="windows/arduino-${version}-${platform}.zip" level="9">
939+
<zip destfile="windows/arduino-${full-version}.zip" level="9">
920940
<zipfileset dir="windows/work" prefix="arduino-${version}"/>
921941
</zip>
922942

923943
<echo>
924944
=======================================================
925945
Arduino for Windows was built. Grab the archive from
926946

927-
windows/arduino-${version}-${platform}.zip
947+
windows/arduino-${full-version}.zip
928948
=======================================================
929949
</echo>
930950
</target>
@@ -1030,4 +1050,8 @@
10301050
<echo file="${staging_folder}/work/${staging_hardware_folder}/../lib/hourlyBuild.txt">${BUILD_DATE}</echo>
10311051
</target>
10321052

1053+
<target name="portable-true">
1054+
<mkdir dir="${parentdir}/portable"/>
1055+
</target>
1056+
<target name="portable-false"/>
10331057
</project>

0 commit comments

Comments
 (0)