1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-01-19 08:52:15 +01:00

Replace "unzip/tar" in build.xml by Ant's provided unzip/untar method

Replace the "unzip" and "tar" command used while building Arduino by the unzip and untar method that Ant provides.
This fixes #8617, meaning that "ant run" will work again and no files/directories are created with weird permissions and share names anymore.
This commit is contained in:
Pieter12345 2019-03-20 04:49:20 +01:00
parent a87024dcd4
commit 126c79a3ed

View File

@ -282,7 +282,7 @@
<!-- copy hardware folder --> <!-- copy hardware folder -->
<target name="assemble-hardware" unless="light_bundle"> <target name="assemble-hardware" unless="light_bundle">
<mkdir dir="${target.path}/hardware/arduino" /> <mkdir dir="${target.path}/hardware/arduino" />
<antcall target="untar"> <antcall target="untar-bz2">
<param name="archive_file" value="avr-${AVRCORE-VERSION}.tar.bz2"/> <param name="archive_file" value="avr-${AVRCORE-VERSION}.tar.bz2"/>
<param name="archive_url" value="https://downloads.arduino.cc/cores/avr-${AVRCORE-VERSION}.tar.bz2"/> <param name="archive_url" value="https://downloads.arduino.cc/cores/avr-${AVRCORE-VERSION}.tar.bz2"/>
<param name="final_folder" value="${target.path}/hardware/arduino/avr"/> <param name="final_folder" value="${target.path}/hardware/arduino/avr"/>
@ -528,9 +528,7 @@
<delete dir="macosx/work/Arduino.app" /> <delete dir="macosx/work/Arduino.app" />
<!-- Unzip unsigned app into working dir --> <!-- Unzip unsigned app into working dir -->
<exec executable="unzip" dir="macosx/work" failonerror="true"> <unzip src="../arduino-${version}-${platform}.zip" dest="macosx/work"/>
<arg line="../arduino-${version}-${platform}.zip" />
</exec>
<!-- Unlock keychain file --> <!-- Unlock keychain file -->
<exec executable="security" dir="macosx/work" failonerror="true"> <exec executable="security" dir="macosx/work" failonerror="true">
@ -895,26 +893,14 @@
<!-- 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" depends="untar-unzip-checksum" unless="${archive_file}_installed"> <target name="untar" depends="untar-unzip-checksum" unless="${archive_file}_installed">
<echo>Untarring ${archive_file} into folder ${dest_folder}</echo> <echo>Untarring ${archive_file} into folder ${dest_folder}</echo>
<exec executable="tar" failonerror="true"> <untar src="${archive_file}" dest="${dest_folder}"/>
<arg value="xf"/> </target>
<arg value="${archive_file}"/> <target name="untar-bz2" depends="untar-unzip-checksum" unless="${archive_file}_installed">
<arg value="--directory=${dest_folder}"/> <echo>Untarring ${archive_file} into folder ${dest_folder}</echo>
</exec> <untar src="${archive_file}" dest="${dest_folder}" compression="bzip2"/>
</target> </target>
<target name="unzip" depends="untar-unzip-checksum" unless="${archive_file}_installed"> <target name="unzip" depends="untar-unzip-checksum" unless="${archive_file}_installed">
<echo>Unzipping ${archive_file} into folder ${dest_folder}</echo>
<mkdir dir="${dest_folder}" />
<exec executable="unzip" failonerror="true">
<arg value="-q" />
<arg value="-n" />
<arg value="-d" />
<arg value="${dest_folder}" />
<arg value="${archive_file}" />
</exec>
</target>
<target name="unzip-with-ant-task" depends="untar-unzip-checksum" unless="${archive_file}_installed">
<echo>Unzipping ${archive_file} into folder ${dest_folder}</echo> <echo>Unzipping ${archive_file} into folder ${dest_folder}</echo>
<mkdir dir="${dest_folder}" /> <mkdir dir="${dest_folder}" />
<unzip src="${archive_file}" dest="${dest_folder}"/> <unzip src="${archive_file}" dest="${dest_folder}"/>
@ -994,7 +980,7 @@
</target> </target>
<target name="download-launch4j-windows"> <target name="download-launch4j-windows">
<antcall target="unzip-with-ant-task"> <antcall target="unzip">
<param name="archive_file" value="windows/launch4j-3.9-win32.zip"/> <param name="archive_file" value="windows/launch4j-3.9-win32.zip"/>
<param name="archive_url" value="https://downloads.arduino.cc/tools/launch4j-3.9-win32.zip"/> <param name="archive_url" value="https://downloads.arduino.cc/tools/launch4j-3.9-win32.zip"/>
<param name="final_folder" value="windows/launcher/launch4j"/> <param name="final_folder" value="windows/launcher/launch4j"/>
@ -1068,7 +1054,7 @@
<delete dir="${staging_folder}/arduino-builder-windows" includeemptydirs="true"/> <delete dir="${staging_folder}/arduino-builder-windows" includeemptydirs="true"/>
<mkdir dir="${staging_folder}/arduino-builder-windows"/> <mkdir dir="${staging_folder}/arduino-builder-windows"/>
<antcall target="unzip-with-ant-task"> <antcall target="unzip">
<param name="archive_file" value="./arduino-builder-windows-${ARDUINO-BUILDER-VERSION}.zip" /> <param name="archive_file" value="./arduino-builder-windows-${ARDUINO-BUILDER-VERSION}.zip" />
<param name="archive_url" value="https://downloads.arduino.cc/tools/arduino-builder-windows-${ARDUINO-BUILDER-VERSION}.zip" /> <param name="archive_url" value="https://downloads.arduino.cc/tools/arduino-builder-windows-${ARDUINO-BUILDER-VERSION}.zip" />
<param name="final_folder" value="${staging_folder}/arduino-builder-windows/arduino-builder.exe" /> <param name="final_folder" value="${staging_folder}/arduino-builder-windows/arduino-builder.exe" />
@ -1087,42 +1073,33 @@
</copy> </copy>
<delete dir="${staging_folder}/arduino-builder-windows" includeemptydirs="true"/> <delete dir="${staging_folder}/arduino-builder-windows" includeemptydirs="true"/>
<exec executable="unzip" failonerror="true"> <unzip src="../arduino-core/lib/jna-4.2.2.jar" dest="windows/work/lib">
<arg value="-q" /> <patternset>
<arg value="-n" /> <include name="com/sun/jna/win32-x86/jnidispatch.dll"/>
<arg value="-j" /> </patternset>
<arg value="-d" /> <mapper type="flatten"/>
<arg value="windows/work/lib" /> </unzip>
<arg value="../arduino-core/lib/jna-4.2.2.jar" />
<arg value="com/sun/jna/win32-x86/jnidispatch.dll" />
</exec>
<move file="windows/work/lib/jnidispatch.dll" tofile="windows/work/lib/jnidispatch-4.2.2-win32-x86.dll" /> <move file="windows/work/lib/jnidispatch.dll" tofile="windows/work/lib/jnidispatch-4.2.2-win32-x86.dll" />
<antcall target="make-file-executable"> <antcall target="make-file-executable">
<param name="file" value="windows/work/lib/jnidispatch-4.2.2-win32-x86.dll" /> <param name="file" value="windows/work/lib/jnidispatch-4.2.2-win32-x86.dll" />
</antcall> </antcall>
<exec executable="unzip" failonerror="true"> <unzip src="../arduino-core/lib/jssc-2.8.0-arduino3.jar" dest="windows/work/lib">
<arg value="-q" /> <patternset>
<arg value="-n" /> <include name="libs/windows/jSSC-2.8_x86.dll"/>
<arg value="-j" /> </patternset>
<arg value="-d" /> <mapper type="flatten"/>
<arg value="windows/work/lib" /> </unzip>
<arg value="../arduino-core/lib/jssc-2.8.0-arduino3.jar" />
<arg value="libs/windows/jSSC-2.8_x86.dll" />
</exec>
<move file="windows/work/lib/jSSC-2.8_x86.dll" tofile="windows/work/lib/jSSC-2.8_x86.dll" /> <move file="windows/work/lib/jSSC-2.8_x86.dll" tofile="windows/work/lib/jSSC-2.8_x86.dll" />
<antcall target="make-file-executable"> <antcall target="make-file-executable">
<param name="file" value="windows/work/lib/jSSC-2.8_x86.dll" /> <param name="file" value="windows/work/lib/jSSC-2.8_x86.dll" />
</antcall> </antcall>
<exec executable="unzip" failonerror="true"> <unzip src="../arduino-core/lib/jssc-2.8.0-arduino3.jar" dest="windows/work/lib">
<arg value="-q" /> <patternset>
<arg value="-n" /> <include name="libs/windows/jSSC-2.8_x86_64.dll"/>
<arg value="-j" /> </patternset>
<arg value="-d" /> <mapper type="flatten"/>
<arg value="windows/work/lib" /> </unzip>
<arg value="../arduino-core/lib/jssc-2.8.0-arduino3.jar" />
<arg value="libs/windows/jSSC-2.8_x86_64.dll" />
</exec>
<move file="windows/work/lib/jSSC-2.8_x86_64.dll" tofile="windows/work/lib/jSSC-2.8_x86_64.dll" /> <move file="windows/work/lib/jSSC-2.8_x86_64.dll" tofile="windows/work/lib/jSSC-2.8_x86_64.dll" />
<antcall target="make-file-executable"> <antcall target="make-file-executable">
<param name="file" value="windows/work/lib/jSSC-2.8_x86_64.dll" /> <param name="file" value="windows/work/lib/jSSC-2.8_x86_64.dll" />