Skip to content

Commit 00ecd55

Browse files
author
Federico Fissore
committed
build.xml: removed unzip-avr-toolchain and unzip-libastyle in favour of unzip
1 parent 30d4c89 commit 00ecd55

File tree

1 file changed

+59
-64
lines changed

1 file changed

+59
-64
lines changed

build/build.xml

Lines changed: 59 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@
2727
<condition property="staging_hardware_folder" value="hardware"><equals arg1="${platform}" arg2="linux32" /></condition>
2828
<condition property="staging_hardware_folder" value="hardware"><equals arg1="${platform}" arg2="linux64" /></condition>
2929

30-
<condition property="launch4j-download-unpack-target-name" value="launch4j-windows"><os family="windows" /></condition>
31-
<property name="launch4j-download-unpack-target-name" value="launch4j-linux"/>
32-
3330
<condition property="arch-bits" value="32">
3431
<equals arg1="${platform}" arg2="linux32"/>
3532
</condition>
@@ -224,8 +221,11 @@
224221
</copy>
225222

226223
<!-- Unzip AVR tools -->
227-
<antcall target="unzip-avr-toolchain">
228-
<param name="file_arch" value="mac32" />
224+
<antcall target="unzip">
225+
<param name="archive_file" value="${staging_folder}/avr-toolchain-mac32-gcc-4.8.1.zip" />
226+
<param name="archive_url" value="http://downloads.arduino.cc/avr-toolchain-mac32-gcc-4.8.1.zip" />
227+
<param name="final_folder" value="${staging_folder}/work/${staging_hardware_folder}/tools/avr" />
228+
<param name="dest_folder" value="${staging_folder}/work/${staging_hardware_folder}/tools/avr" />
229229
</antcall>
230230

231231
<!--
@@ -266,7 +266,12 @@
266266
<fileset dir="macosx/work/${staging_hardware_folder}/tools" includes="**/man"/>
267267
</delete>
268268

269-
<antcall target="unzip-libastyle" />
269+
<antcall target="unzip">
270+
<param name="archive_file" value="./libastylej-2.04.zip" />
271+
<param name="archive_url" value="http://downloads.arduino.cc/libastylej-2.04.zip" />
272+
<param name="final_folder" value="${staging_folder}/libastylej" />
273+
<param name="dest_folder" value="${staging_folder}" />
274+
</antcall>
270275
<copy file="macosx/libastylej/libastylej.jnilib" todir="macosx/work/Arduino.app/Contents/Resources/Java/lib/" />
271276
<chmod perm="755" file="macosx/work/Arduino.app/Contents/Resources/Java/lib/libastylej.jnilib" />
272277
</target>
@@ -480,7 +485,12 @@
480485
<copy todir="linux/work" file="linux/dist/arduino" />
481486
<chmod perm="755" file="linux/work/arduino" />
482487

483-
<antcall target="unzip-libastyle" />
488+
<antcall target="unzip">
489+
<param name="archive_file" value="./libastylej-2.04.zip" />
490+
<param name="archive_url" value="http://downloads.arduino.cc/libastylej-2.04.zip" />
491+
<param name="final_folder" value="${staging_folder}/libastylej" />
492+
<param name="dest_folder" value="${staging_folder}" />
493+
</antcall>
484494
<copy file="linux/libastylej/libastylej${arch-bits}.so" tofile="linux/work/lib/libastylej.so" />
485495
<chmod perm="755" file="linux/work/lib/libastylej.so" />
486496
</target>
@@ -495,8 +505,11 @@
495505
</antcall>
496506

497507
<!-- Unzip AVR tools -->
498-
<antcall target="unzip-avr-toolchain">
499-
<param name="file_arch" value="linux32" />
508+
<antcall target="unzip">
509+
<param name="archive_file" value="${staging_folder}/avr-toolchain-linux32-gcc-4.8.1.zip" />
510+
<param name="archive_url" value="http://downloads.arduino.cc/avr-toolchain-linux32-gcc-4.8.1.zip" />
511+
<param name="final_folder" value="${staging_folder}/work/${staging_hardware_folder}/tools/avr" />
512+
<param name="dest_folder" value="${staging_folder}/work/${staging_hardware_folder}/tools/avr" />
500513
</antcall>
501514
</target>
502515

@@ -510,8 +523,11 @@
510523
</antcall>
511524

512525
<!-- Unzip AVR tools -->
513-
<antcall target="unzip-avr-toolchain">
514-
<param name="file_arch" value="linux64" />
526+
<antcall target="unzip">
527+
<param name="archive_file" value="${staging_folder}/avr-toolchain-linux64-gcc-4.8.1.zip" />
528+
<param name="archive_url" value="http://downloads.arduino.cc/avr-toolchain-linux64-gcc-4.8.1.zip" />
529+
<param name="final_folder" value="${staging_folder}/work/${staging_hardware_folder}/tools/avr" />
530+
<param name="dest_folder" value="${staging_folder}/work/${staging_hardware_folder}/tools/avr" />
515531
</antcall>
516532
</target>
517533

@@ -523,45 +539,6 @@
523539
<exec executable="./linux/work/arduino" spawn="false"/>
524540
</target>
525541

526-
<target name="unzip-avr-toolchain">
527-
<get src="http://downloads.arduino.cc/avr-toolchain-${file_arch}-gcc-4.8.1.zip" dest="${staging_folder}" usetimestamp="true" ignoreerrors="true" verbose="true" />
528-
529-
<checksum file="${staging_folder}/avr-toolchain-${file_arch}-gcc-4.8.1.zip" algorithm="sha" fileext=".sha" verifyproperty="checksum.matches"/>
530-
<condition property="checksum.matches.fail">
531-
<equals arg1="${checksum.matches}" arg2="false"/>
532-
</condition>
533-
<fail if="checksum.matches.fail">Checksum failed.
534-
535-
File avr-toolchain-${file_arch}-gcc-4.8.1.zip failed checksum.
536-
Please remove "${staging_folder}/avr-toolchain-${file_arch}-gcc-4.8.1.zip" and download it again.
537-
</fail>
538-
539-
<mkdir dir="${staging_folder}/work/${staging_hardware_folder}/tools/avr" />
540-
<exec executable="unzip">
541-
<arg value="-q" />
542-
<arg value="-n" />
543-
<arg value="-d" />
544-
<arg value="${staging_folder}/work/${staging_hardware_folder}/tools/avr" />
545-
<arg value="${staging_folder}/avr-toolchain-${file_arch}-gcc-4.8.1.zip" />
546-
</exec>
547-
</target>
548-
549-
<target name="unzip-libastyle">
550-
<get src="http://downloads.arduino.cc/libastylej-2.04.zip" dest="." usetimestamp="true" ignoreerrors="true" verbose="true" />
551-
552-
<checksum file="libastylej-2.04.zip" algorithm="sha" fileext=".sha" verifyproperty="checksum.matches"/>
553-
<condition property="checksum.matches.fail">
554-
<equals arg1="${checksum.matches}" arg2="false"/>
555-
</condition>
556-
<fail if="checksum.matches.fail">Checksum failed.
557-
558-
File libastylej-2.04.zip failed checksum.
559-
Please remove "libastylej-2.04.zip" and download it again.
560-
</fail>
561-
562-
<unzip src="libastylej-2.04.zip" dest="${staging_folder}" overwrite="true"/>
563-
</target>
564-
565542
<!-- Set '${dist_file}_available' property if toolchain dist_file is downloaded -->
566543
<!-- Set '${dist_file}_installed' property if toolchain is installed in working directory -->
567544
<!-- hardware/tools/${dist_check_file} is checked for existence -->
@@ -576,7 +553,7 @@
576553
</target>
577554

578555
<!-- Ensure that the tool is downloaded and test checksums, if everything's ok unzip it on the tools folder -->
579-
<target name="untar" depends="untar-unzip-download" unless="${dist_file}_installed">
556+
<target name="untar" depends="untar-unzip-download" unless="${archive_file}_installed">
580557
<echo>Testing checksum of "${archive_file}"</echo>
581558
<checksum file="${archive_file}" algorithm="sha" fileext=".sha" verifyproperty="checksum.matches"/>
582559
<condition property="checksum.matches.fail">
@@ -597,18 +574,28 @@
597574
</exec>
598575
</target>
599576

577+
<target name="unzip" depends="untar-unzip-download" unless="${archive_file}_installed">
578+
<echo>Testing checksum of "${archive_file}"</echo>
579+
<checksum file="${archive_file}" algorithm="sha" fileext=".sha" verifyproperty="checksum.matches"/>
580+
<condition property="checksum.matches.fail">
581+
<equals arg1="${checksum.matches}" arg2="false"/>
582+
</condition>
583+
<fail if="checksum.matches.fail">Checksum failed.
600584

585+
File ${archive_file} failed checksum.
586+
Please remove "${archive_file}" to download it again.
587+
</fail>
601588

602-
<!-- Set 'arm_disfile_available' property if ARM toolchain dist_file is downloaded -->
603-
<!-- Set 'arm_toolchain_installed' property if ARM toolchain is installed in working directory -->
604-
<target name="check-arm-toolchain">
605-
<available file="${staging_folder}/dist/${dist_file}" property="arm_distfile_available" />
606-
<available file="${staging_folder}/work/hardware/tools/${dist_check_file}" property="arm_toolchain_installed" />
607-
</target>
608-
609-
<!-- Retrieve ARM toolchain -->
610-
<target name="get-arm-toolchain" depends="check-arm-toolchain" unless="arm_distfile_available">
611-
<get src="${dist_url}" dest="${staging_folder}/dist/${dist_file}" verbose="true" ignoreerrors="true" />
589+
<!-- Unzip tool to the destination folder -->
590+
<echo>Unzipping into folder ${dest_folder}</echo>
591+
<mkdir dir="${dest_folder}" />
592+
<exec executable="unzip">
593+
<arg value="-q" />
594+
<arg value="-n" />
595+
<arg value="-d" />
596+
<arg value="${dest_folder}" />
597+
<arg value="${archive_file}" />
598+
</exec>
612599
</target>
613600

614601
<target name="linux-dist" depends="build"
@@ -731,11 +718,19 @@
731718
</copy>
732719

733720
<!-- Unzip AVR tools -->
734-
<antcall target="unzip-avr-toolchain">
735-
<param name="file_arch" value="win32" />
721+
<antcall target="unzip">
722+
<param name="archive_file" value="${staging_folder}/avr-toolchain-win32-gcc-4.8.1.zip" />
723+
<param name="archive_url" value="http://downloads.arduino.cc/avr-toolchain-win32-gcc-4.8.1.zip" />
724+
<param name="final_folder" value="${staging_folder}/work/${staging_hardware_folder}/tools/avr" />
725+
<param name="dest_folder" value="${staging_folder}/work/${staging_hardware_folder}/tools/avr" />
736726
</antcall>
737727

738-
<antcall target="unzip-libastyle" />
728+
<antcall target="unzip">
729+
<param name="archive_file" value="./libastylej-2.04.zip" />
730+
<param name="archive_url" value="http://downloads.arduino.cc/libastylej-2.04.zip" />
731+
<param name="final_folder" value="${staging_folder}/libastylej" />
732+
<param name="dest_folder" value="${staging_folder}" />
733+
</antcall>
739734
<copy file="windows/libastylej/AStylej.dll" todir="windows/work/lib" />
740735

741736
<!-- Copy bossac.exe tool -->

0 commit comments

Comments
 (0)