Skip to content

Commit 578cac4

Browse files
Cristian Magliecmaglie
Cristian Maglie
authored andcommitted
Added 'unzip-tool' target in build.xml
1 parent c778de0 commit 578cac4

File tree

1 file changed

+40
-1
lines changed

1 file changed

+40
-1
lines changed

build/build.xml

+40-1
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@
503503

504504
<target name="linux64-build" depends="linux-build" description="Build linux (64-bit) version">
505505
<!-- Unzip ARM tools -->
506-
<antcall target="unzip-arm-toolchain">
506+
<antcall target="unzip-tool">
507507
<param name="dist_file" value="gcc-arm-none-eabi-4.4.1-2010q1-188-linux32.tar.gz" />
508508
<param name="dist_url" value="http://arduino.googlecode.com/files/gcc-arm-none-eabi-4.4.1-2010q1-188-linux32.tar.gz" />
509509
<param name="dist_check_file" value="g++_arm_none_eabi" />
@@ -546,6 +546,45 @@
546546
</exec>
547547
</target>
548548

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

0 commit comments

Comments
 (0)