Skip to content

Commit 86abe3d

Browse files
author
Cristian Maglie
committed
Added 'unzip-tool' target in build.xml
1 parent a966acd commit 86abe3d

File tree

1 file changed

+40
-1
lines changed

1 file changed

+40
-1
lines changed

build/build.xml

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@
500500

501501
<target name="linux64-build" depends="linux-build" description="Build linux (64-bit) version">
502502
<!-- Unzip ARM tools -->
503-
<antcall target="unzip-arm-toolchain">
503+
<antcall target="unzip-tool">
504504
<param name="dist_file" value="gcc-arm-none-eabi-4.4.1-2010q1-188-linux32.tar.gz" />
505505
<param name="dist_url" value="http://arduino.googlecode.com/files/gcc-arm-none-eabi-4.4.1-2010q1-188-linux32.tar.gz" />
506506
<param name="dist_check_file" value="g++_arm_none_eabi" />
@@ -543,6 +543,45 @@
543543
</exec>
544544
</target>
545545

546+
547+
548+
<!-- Set '${dist_file}_available' property if toolchain dist_file is downloaded -->
549+
<!-- Set '${dist_file}_installed' property if toolchain is installed in working directory -->
550+
<!-- hardware/tools/${dist_check_file} is checked for existence -->
551+
<target name="check-tool">
552+
<available file="${staging_folder}/dist/${dist_file}" property="${dist_file}_available" />
553+
<available file="${staging_folder}/work/hardware/tools/${dist_check_file}" property="${dist_file}_installed" />
554+
</target>
555+
556+
<!-- Retrieve tool -->
557+
<target name="get-tool" depends="check-tool" unless="${dist_file}_available">
558+
<get src="${dist_url}" dest="${staging_folder}/dist/${dist_file}" verbose="true" ignoreerrors="true" />
559+
</target>
560+
561+
<!-- Ensure that the tool is downloaded and test checksums, if everything's ok unzip it on the tools folder -->
562+
<target name="unzip-tool" depends="get-tool, check-tool" unless="${dist_file}_installed">
563+
<echo>Testing checksum of "${staging_folder}/dist/${dist_file}"</echo>
564+
<checksum file="${staging_folder}/dist/${dist_file}" algorithm="sha" fileext=".sha" verifyproperty="checksum.matches"/>
565+
<condition property="checksum.matches.fail">
566+
<equals arg1="${checksum.matches}" arg2="false"/>
567+
</condition>
568+
<fail if="checksum.matches.fail">Checksum failed.
569+
570+
File ${dist_file} failed checksum.
571+
Please remove "${staging_folder}/dist/${dist_file}" to download it again.
572+
</fail>
573+
574+
<!-- Unzip tool to the destination folder -->
575+
<echo>Unzipping into folder ${staging_folder}/dist/${dist_file}</echo>
576+
<exec executable="tar">
577+
<arg value="xfz"/>
578+
<arg value="${staging_folder}/dist/${dist_file}"/>
579+
<arg value="--directory=${staging_folder}/work/${staging_hardware_folder}/tools/"/>
580+
</exec>
581+
</target>
582+
583+
584+
546585
<!-- Set 'arm_disfile_available' property if ARM toolchain dist_file is downloaded -->
547586
<!-- Set 'arm_toolchain_installed' property if ARM toolchain is installed in working directory -->
548587
<target name="check-arm-toolchain">

0 commit comments

Comments
 (0)