1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-02-12 06:54:24 +01:00

build.xml: made untar-tool (and dependencies) easier to reuse

This commit is contained in:
Federico Fissore 2014-10-08 15:50:32 +02:00
parent 24be3773ea
commit 30d4c89ed3

View File

@ -252,10 +252,11 @@
<param name="target.path" value="macosx/work/Arduino.app/Contents/Resources/Java" /> <param name="target.path" value="macosx/work/Arduino.app/Contents/Resources/Java" />
</antcall> </antcall>
<antcall target="untar-tool"> <antcall target="untar">
<param name="dist_file" value="gcc-arm-none-eabi-4.8.3-2014q1-mac.tar.gz" /> <param name="archive_file" value="${staging_folder}/dist/gcc-arm-none-eabi-4.8.3-2014q1-mac.tar.gz" />
<param name="dist_url" value="http://downloads.arduino.cc/gcc-arm-none-eabi-4.8.3-2014q1-mac.tar.gz" /> <param name="archive_url" value="http://downloads.arduino.cc/gcc-arm-none-eabi-4.8.3-2014q1-mac.tar.gz" />
<param name="dist_check_file" value="gcc-arm-none-eabi-4.8.3-2014q1" /> <param name="final_folder" value="${staging_folder}/work/${staging_hardware_folder}/tools/gcc-arm-none-eabi-4.8.3-2014q1" />
<param name="dest_folder" value="${staging_folder}/work/${staging_hardware_folder}/tools/" />
</antcall> </antcall>
<delete includeEmptyDirs="true" quiet="true"> <delete includeEmptyDirs="true" quiet="true">
@ -486,10 +487,11 @@
<target name="linux32-build" depends="linux-build" description="Build linux (32-bit) version"> <target name="linux32-build" depends="linux-build" description="Build linux (32-bit) version">
<!-- Unzip ARM tools --> <!-- Unzip ARM tools -->
<antcall target="untar-tool"> <antcall target="untar">
<param name="dist_file" value="gcc-arm-none-eabi-4.8.3-2014q1-linux32.tar.gz" /> <param name="archive_file" value="${staging_folder}/dist/gcc-arm-none-eabi-4.8.3-2014q1-linux32.tar.gz" />
<param name="dist_url" value="http://downloads.arduino.cc/gcc-arm-none-eabi-4.8.3-2014q1-linux32.tar.gz" /> <param name="archive_url" value="http://downloads.arduino.cc/gcc-arm-none-eabi-4.8.3-2014q1-linux32.tar.gz" />
<param name="dist_check_file" value="gcc-arm-none-eabi-4.8.3-2014q1" /> <param name="final_folder" value="${staging_folder}/work/${staging_hardware_folder}/tools/gcc-arm-none-eabi-4.8.3-2014q1" />
<param name="dest_folder" value="${staging_folder}/work/${staging_hardware_folder}/tools/" />
</antcall> </antcall>
<!-- Unzip AVR tools --> <!-- Unzip AVR tools -->
@ -500,10 +502,11 @@
<target name="linux64-build" depends="linux-build" description="Build linux (64-bit) version"> <target name="linux64-build" depends="linux-build" description="Build linux (64-bit) version">
<!-- Unzip ARM tools --> <!-- Unzip ARM tools -->
<antcall target="untar-tool"> <antcall target="untar">
<param name="dist_file" value="gcc-arm-none-eabi-4.8.3-2014q1-linux64.tar.gz" /> <param name="archive_file" value="${staging_folder}/dist/gcc-arm-none-eabi-4.8.3-2014q1-linux64.tar.gz" />
<param name="dist_url" value="http://downloads.arduino.cc/gcc-arm-none-eabi-4.8.3-2014q1-linux64.tar.gz" /> <param name="archive_url" value="http://downloads.arduino.cc/gcc-arm-none-eabi-4.8.3-2014q1-linux64.tar.gz" />
<param name="dist_check_file" value="gcc-arm-none-eabi-4.8.3-2014q1" /> <param name="final_folder" value="${staging_folder}/work/${staging_hardware_folder}/tools/gcc-arm-none-eabi-4.8.3-2014q1" />
<param name="dest_folder" value="${staging_folder}/work/${staging_hardware_folder}/tools/" />
</antcall> </antcall>
<!-- Unzip AVR tools --> <!-- Unzip AVR tools -->
@ -562,35 +565,35 @@
<!-- Set '${dist_file}_available' property if toolchain dist_file is downloaded --> <!-- Set '${dist_file}_available' property if toolchain dist_file is downloaded -->
<!-- Set '${dist_file}_installed' property if toolchain is installed in working directory --> <!-- Set '${dist_file}_installed' property if toolchain is installed in working directory -->
<!-- hardware/tools/${dist_check_file} is checked for existence --> <!-- hardware/tools/${dist_check_file} is checked for existence -->
<target name="check-tool"> <target name="untar-unzip-check">
<available file="${staging_folder}/dist/${dist_file}" property="${dist_file}_available" /> <available file="${archive_file}" property="${archive_file}_available" />
<available file="${staging_folder}/work/hardware/tools/${dist_check_file}" property="${dist_file}_installed" /> <available file="${final_folder}" property="${archive_file}_installed" />
</target> </target>
<!-- Retrieve tool --> <!-- Retrieve tool -->
<target name="get-tool" depends="check-tool" unless="${dist_file}_available"> <target name="untar-unzip-download" depends="untar-unzip-check" unless="${archive_file}_available">
<get src="${dist_url}" dest="${staging_folder}/dist/${dist_file}" verbose="true" ignoreerrors="true" /> <get src="${archive_url}" dest="${archive_file}" verbose="true" ignoreerrors="true" />
</target> </target>
<!-- Ensure that the tool is downloaded and test checksums, if everything's ok unzip it on the tools folder --> <!-- Ensure that the tool is downloaded and test checksums, if everything's ok unzip it on the tools folder -->
<target name="untar-tool" depends="get-tool, check-tool" unless="${dist_file}_installed"> <target name="untar" depends="untar-unzip-download" unless="${dist_file}_installed">
<echo>Testing checksum of "${staging_folder}/dist/${dist_file}"</echo> <echo>Testing checksum of "${archive_file}"</echo>
<checksum file="${staging_folder}/dist/${dist_file}" algorithm="sha" fileext=".sha" verifyproperty="checksum.matches"/> <checksum file="${archive_file}" algorithm="sha" fileext=".sha" verifyproperty="checksum.matches"/>
<condition property="checksum.matches.fail"> <condition property="checksum.matches.fail">
<equals arg1="${checksum.matches}" arg2="false"/> <equals arg1="${checksum.matches}" arg2="false"/>
</condition> </condition>
<fail if="checksum.matches.fail">Checksum failed. <fail if="checksum.matches.fail">Checksum failed.
File ${dist_file} failed checksum. File ${archive_file} failed checksum.
Please remove "${staging_folder}/dist/${dist_file}" to download it again. Please remove "${archive_file}" to download it again.
</fail> </fail>
<!-- Unzip tool to the destination folder --> <!-- Unzip tool to the destination folder -->
<echo>Unzipping into folder ${staging_folder}/dist/${dist_file}</echo> <echo>Unzipping into folder ${dest_folder}</echo>
<exec executable="tar"> <exec executable="tar">
<arg value="xfz"/> <arg value="xfz"/>
<arg value="${staging_folder}/dist/${dist_file}"/> <arg value="${archive_file}"/>
<arg value="--directory=${staging_folder}/work/${staging_hardware_folder}/tools/"/> <arg value="--directory=${dest_folder}"/>
</exec> </exec>
</target> </target>
@ -771,10 +774,11 @@
</chmod> </chmod>
<!-- Unzip ARM toolchain --> <!-- Unzip ARM toolchain -->
<antcall target="untar-tool"> <antcall target="untar">
<param name="dist_file" value="gcc-arm-none-eabi-4.8.3-2014q1-windows.tar.gz" /> <param name="archive_file" value="${staging_folder}/dist/gcc-arm-none-eabi-4.8.3-2014q1-windows.tar.gz" />
<param name="dist_url" value="http://downloads.arduino.cc/gcc-arm-none-eabi-4.8.3-2014q1-windows.tar.gz" /> <param name="archive_url" value="http://downloads.arduino.cc/gcc-arm-none-eabi-4.8.3-2014q1-windows.tar.gz" />
<param name="dist_check_file" value="gcc-arm-none-eabi-4.8.3-2014q1" /> <param name="final_folder" value="${staging_folder}/work/${staging_hardware_folder}/tools/gcc-arm-none-eabi-4.8.3-2014q1" />
<param name="dest_folder" value="${staging_folder}/work/${staging_hardware_folder}/tools/" />
</antcall> </antcall>
<delete includeEmptyDirs="true" quiet="true"> <delete includeEmptyDirs="true" quiet="true">