diff --git a/build/build.xml b/build/build.xml index bb5e088e1..ca3134d60 100644 --- a/build/build.xml +++ b/build/build.xml @@ -252,10 +252,11 @@ <param name="target.path" value="macosx/work/Arduino.app/Contents/Resources/Java" /> </antcall> - <antcall target="untar-tool"> - <param name="dist_file" value="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="dist_check_file" value="gcc-arm-none-eabi-4.8.3-2014q1" /> + <antcall target="untar"> + <param name="archive_file" value="${staging_folder}/dist/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="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> <delete includeEmptyDirs="true" quiet="true"> @@ -486,10 +487,11 @@ <target name="linux32-build" depends="linux-build" description="Build linux (32-bit) version"> <!-- Unzip ARM tools --> - <antcall target="untar-tool"> - <param name="dist_file" value="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="dist_check_file" value="gcc-arm-none-eabi-4.8.3-2014q1" /> + <antcall target="untar"> + <param name="archive_file" value="${staging_folder}/dist/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="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> <!-- Unzip AVR tools --> @@ -500,10 +502,11 @@ <target name="linux64-build" depends="linux-build" description="Build linux (64-bit) version"> <!-- Unzip ARM tools --> - <antcall target="untar-tool"> - <param name="dist_file" value="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="dist_check_file" value="gcc-arm-none-eabi-4.8.3-2014q1" /> + <antcall target="untar"> + <param name="archive_file" value="${staging_folder}/dist/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="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> <!-- Unzip AVR tools --> @@ -562,35 +565,35 @@ <!-- Set '${dist_file}_available' property if toolchain dist_file is downloaded --> <!-- Set '${dist_file}_installed' property if toolchain is installed in working directory --> <!-- hardware/tools/${dist_check_file} is checked for existence --> - <target name="check-tool"> - <available file="${staging_folder}/dist/${dist_file}" property="${dist_file}_available" /> - <available file="${staging_folder}/work/hardware/tools/${dist_check_file}" property="${dist_file}_installed" /> + <target name="untar-unzip-check"> + <available file="${archive_file}" property="${archive_file}_available" /> + <available file="${final_folder}" property="${archive_file}_installed" /> </target> <!-- Retrieve tool --> - <target name="get-tool" depends="check-tool" unless="${dist_file}_available"> - <get src="${dist_url}" dest="${staging_folder}/dist/${dist_file}" verbose="true" ignoreerrors="true" /> + <target name="untar-unzip-download" depends="untar-unzip-check" unless="${archive_file}_available"> + <get src="${archive_url}" dest="${archive_file}" verbose="true" ignoreerrors="true" /> </target> <!-- 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"> - <echo>Testing checksum of "${staging_folder}/dist/${dist_file}"</echo> - <checksum file="${staging_folder}/dist/${dist_file}" algorithm="sha" fileext=".sha" verifyproperty="checksum.matches"/> + <target name="untar" depends="untar-unzip-download" unless="${dist_file}_installed"> + <echo>Testing checksum of "${archive_file}"</echo> + <checksum file="${archive_file}" algorithm="sha" fileext=".sha" verifyproperty="checksum.matches"/> <condition property="checksum.matches.fail"> <equals arg1="${checksum.matches}" arg2="false"/> </condition> <fail if="checksum.matches.fail">Checksum failed. - File ${dist_file} failed checksum. - Please remove "${staging_folder}/dist/${dist_file}" to download it again. + File ${archive_file} failed checksum. + Please remove "${archive_file}" to download it again. </fail> <!-- 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"> <arg value="xfz"/> - <arg value="${staging_folder}/dist/${dist_file}"/> - <arg value="--directory=${staging_folder}/work/${staging_hardware_folder}/tools/"/> + <arg value="${archive_file}"/> + <arg value="--directory=${dest_folder}"/> </exec> </target> @@ -771,10 +774,11 @@ </chmod> <!-- Unzip ARM toolchain --> - <antcall target="untar-tool"> - <param name="dist_file" value="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="dist_check_file" value="gcc-arm-none-eabi-4.8.3-2014q1" /> + <antcall target="untar"> + <param name="archive_file" value="${staging_folder}/dist/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="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> <delete includeEmptyDirs="true" quiet="true">