|
27 | 27 | <condition property="staging_hardware_folder" value="hardware"><equals arg1="${platform}" arg2="linux32" /></condition> |
28 | 28 | <condition property="staging_hardware_folder" value="hardware"><equals arg1="${platform}" arg2="linux64" /></condition> |
29 | 29 |
|
30 | | - <condition property="launch4j-download-unpack-target-name" value="launch4j-windows"><os family="windows" /></condition> |
31 | | - <property name="launch4j-download-unpack-target-name" value="launch4j-linux"/> |
32 | | - |
33 | 30 | <condition property="arch-bits" value="32"> |
34 | 31 | <equals arg1="${platform}" arg2="linux32"/> |
35 | 32 | </condition> |
|
224 | 221 | </copy> |
225 | 222 |
|
226 | 223 | <!-- Unzip AVR tools --> |
227 | | - <antcall target="unzip-avr-toolchain"> |
228 | | - <param name="file_arch" value="mac32" /> |
| 224 | + <antcall target="unzip"> |
| 225 | + <param name="archive_file" value="${staging_folder}/avr-toolchain-mac32-gcc-4.8.1.zip" /> |
| 226 | + <param name="archive_url" value="http://downloads.arduino.cc/avr-toolchain-mac32-gcc-4.8.1.zip" /> |
| 227 | + <param name="final_folder" value="${staging_folder}/work/${staging_hardware_folder}/tools/avr" /> |
| 228 | + <param name="dest_folder" value="${staging_folder}/work/${staging_hardware_folder}/tools/avr" /> |
229 | 229 | </antcall> |
230 | 230 |
|
231 | 231 | <!-- |
|
266 | 266 | <fileset dir="macosx/work/${staging_hardware_folder}/tools" includes="**/man"/> |
267 | 267 | </delete> |
268 | 268 |
|
269 | | - <antcall target="unzip-libastyle" /> |
| 269 | + <antcall target="unzip"> |
| 270 | + <param name="archive_file" value="./libastylej-2.04.zip" /> |
| 271 | + <param name="archive_url" value="http://downloads.arduino.cc/libastylej-2.04.zip" /> |
| 272 | + <param name="final_folder" value="${staging_folder}/libastylej" /> |
| 273 | + <param name="dest_folder" value="${staging_folder}" /> |
| 274 | + </antcall> |
270 | 275 | <copy file="macosx/libastylej/libastylej.jnilib" todir="macosx/work/Arduino.app/Contents/Resources/Java/lib/" /> |
271 | 276 | <chmod perm="755" file="macosx/work/Arduino.app/Contents/Resources/Java/lib/libastylej.jnilib" /> |
272 | 277 | </target> |
|
480 | 485 | <copy todir="linux/work" file="linux/dist/arduino" /> |
481 | 486 | <chmod perm="755" file="linux/work/arduino" /> |
482 | 487 |
|
483 | | - <antcall target="unzip-libastyle" /> |
| 488 | + <antcall target="unzip"> |
| 489 | + <param name="archive_file" value="./libastylej-2.04.zip" /> |
| 490 | + <param name="archive_url" value="http://downloads.arduino.cc/libastylej-2.04.zip" /> |
| 491 | + <param name="final_folder" value="${staging_folder}/libastylej" /> |
| 492 | + <param name="dest_folder" value="${staging_folder}" /> |
| 493 | + </antcall> |
484 | 494 | <copy file="linux/libastylej/libastylej${arch-bits}.so" tofile="linux/work/lib/libastylej.so" /> |
485 | 495 | <chmod perm="755" file="linux/work/lib/libastylej.so" /> |
486 | 496 | </target> |
|
495 | 505 | </antcall> |
496 | 506 |
|
497 | 507 | <!-- Unzip AVR tools --> |
498 | | - <antcall target="unzip-avr-toolchain"> |
499 | | - <param name="file_arch" value="linux32" /> |
| 508 | + <antcall target="unzip"> |
| 509 | + <param name="archive_file" value="${staging_folder}/avr-toolchain-linux32-gcc-4.8.1.zip" /> |
| 510 | + <param name="archive_url" value="http://downloads.arduino.cc/avr-toolchain-linux32-gcc-4.8.1.zip" /> |
| 511 | + <param name="final_folder" value="${staging_folder}/work/${staging_hardware_folder}/tools/avr" /> |
| 512 | + <param name="dest_folder" value="${staging_folder}/work/${staging_hardware_folder}/tools/avr" /> |
500 | 513 | </antcall> |
501 | 514 | </target> |
502 | 515 |
|
|
510 | 523 | </antcall> |
511 | 524 |
|
512 | 525 | <!-- Unzip AVR tools --> |
513 | | - <antcall target="unzip-avr-toolchain"> |
514 | | - <param name="file_arch" value="linux64" /> |
| 526 | + <antcall target="unzip"> |
| 527 | + <param name="archive_file" value="${staging_folder}/avr-toolchain-linux64-gcc-4.8.1.zip" /> |
| 528 | + <param name="archive_url" value="http://downloads.arduino.cc/avr-toolchain-linux64-gcc-4.8.1.zip" /> |
| 529 | + <param name="final_folder" value="${staging_folder}/work/${staging_hardware_folder}/tools/avr" /> |
| 530 | + <param name="dest_folder" value="${staging_folder}/work/${staging_hardware_folder}/tools/avr" /> |
515 | 531 | </antcall> |
516 | 532 | </target> |
517 | 533 |
|
|
523 | 539 | <exec executable="./linux/work/arduino" spawn="false"/> |
524 | 540 | </target> |
525 | 541 |
|
526 | | - <target name="unzip-avr-toolchain"> |
527 | | - <get src="http://downloads.arduino.cc/avr-toolchain-${file_arch}-gcc-4.8.1.zip" dest="${staging_folder}" usetimestamp="true" ignoreerrors="true" verbose="true" /> |
528 | | - |
529 | | - <checksum file="${staging_folder}/avr-toolchain-${file_arch}-gcc-4.8.1.zip" algorithm="sha" fileext=".sha" verifyproperty="checksum.matches"/> |
530 | | - <condition property="checksum.matches.fail"> |
531 | | - <equals arg1="${checksum.matches}" arg2="false"/> |
532 | | - </condition> |
533 | | - <fail if="checksum.matches.fail">Checksum failed. |
534 | | - |
535 | | - File avr-toolchain-${file_arch}-gcc-4.8.1.zip failed checksum. |
536 | | - Please remove "${staging_folder}/avr-toolchain-${file_arch}-gcc-4.8.1.zip" and download it again. |
537 | | - </fail> |
538 | | - |
539 | | - <mkdir dir="${staging_folder}/work/${staging_hardware_folder}/tools/avr" /> |
540 | | - <exec executable="unzip"> |
541 | | - <arg value="-q" /> |
542 | | - <arg value="-n" /> |
543 | | - <arg value="-d" /> |
544 | | - <arg value="${staging_folder}/work/${staging_hardware_folder}/tools/avr" /> |
545 | | - <arg value="${staging_folder}/avr-toolchain-${file_arch}-gcc-4.8.1.zip" /> |
546 | | - </exec> |
547 | | - </target> |
548 | | - |
549 | | - <target name="unzip-libastyle"> |
550 | | - <get src="http://downloads.arduino.cc/libastylej-2.04.zip" dest="." usetimestamp="true" ignoreerrors="true" verbose="true" /> |
551 | | - |
552 | | - <checksum file="libastylej-2.04.zip" algorithm="sha" fileext=".sha" verifyproperty="checksum.matches"/> |
553 | | - <condition property="checksum.matches.fail"> |
554 | | - <equals arg1="${checksum.matches}" arg2="false"/> |
555 | | - </condition> |
556 | | - <fail if="checksum.matches.fail">Checksum failed. |
557 | | - |
558 | | - File libastylej-2.04.zip failed checksum. |
559 | | - Please remove "libastylej-2.04.zip" and download it again. |
560 | | - </fail> |
561 | | - |
562 | | - <unzip src="libastylej-2.04.zip" dest="${staging_folder}" overwrite="true"/> |
563 | | - </target> |
564 | | - |
565 | 542 | <!-- Set '${dist_file}_available' property if toolchain dist_file is downloaded --> |
566 | 543 | <!-- Set '${dist_file}_installed' property if toolchain is installed in working directory --> |
567 | 544 | <!-- hardware/tools/${dist_check_file} is checked for existence --> |
|
576 | 553 | </target> |
577 | 554 |
|
578 | 555 | <!-- Ensure that the tool is downloaded and test checksums, if everything's ok unzip it on the tools folder --> |
579 | | - <target name="untar" depends="untar-unzip-download" unless="${dist_file}_installed"> |
| 556 | + <target name="untar" depends="untar-unzip-download" unless="${archive_file}_installed"> |
580 | 557 | <echo>Testing checksum of "${archive_file}"</echo> |
581 | 558 | <checksum file="${archive_file}" algorithm="sha" fileext=".sha" verifyproperty="checksum.matches"/> |
582 | 559 | <condition property="checksum.matches.fail"> |
|
597 | 574 | </exec> |
598 | 575 | </target> |
599 | 576 |
|
| 577 | + <target name="unzip" depends="untar-unzip-download" unless="${archive_file}_installed"> |
| 578 | + <echo>Testing checksum of "${archive_file}"</echo> |
| 579 | + <checksum file="${archive_file}" algorithm="sha" fileext=".sha" verifyproperty="checksum.matches"/> |
| 580 | + <condition property="checksum.matches.fail"> |
| 581 | + <equals arg1="${checksum.matches}" arg2="false"/> |
| 582 | + </condition> |
| 583 | + <fail if="checksum.matches.fail">Checksum failed. |
600 | 584 |
|
| 585 | + File ${archive_file} failed checksum. |
| 586 | + Please remove "${archive_file}" to download it again. |
| 587 | + </fail> |
601 | 588 |
|
602 | | - <!-- Set 'arm_disfile_available' property if ARM toolchain dist_file is downloaded --> |
603 | | - <!-- Set 'arm_toolchain_installed' property if ARM toolchain is installed in working directory --> |
604 | | - <target name="check-arm-toolchain"> |
605 | | - <available file="${staging_folder}/dist/${dist_file}" property="arm_distfile_available" /> |
606 | | - <available file="${staging_folder}/work/hardware/tools/${dist_check_file}" property="arm_toolchain_installed" /> |
607 | | - </target> |
608 | | - |
609 | | - <!-- Retrieve ARM toolchain --> |
610 | | - <target name="get-arm-toolchain" depends="check-arm-toolchain" unless="arm_distfile_available"> |
611 | | - <get src="${dist_url}" dest="${staging_folder}/dist/${dist_file}" verbose="true" ignoreerrors="true" /> |
| 589 | + <!-- Unzip tool to the destination folder --> |
| 590 | + <echo>Unzipping into folder ${dest_folder}</echo> |
| 591 | + <mkdir dir="${dest_folder}" /> |
| 592 | + <exec executable="unzip"> |
| 593 | + <arg value="-q" /> |
| 594 | + <arg value="-n" /> |
| 595 | + <arg value="-d" /> |
| 596 | + <arg value="${dest_folder}" /> |
| 597 | + <arg value="${archive_file}" /> |
| 598 | + </exec> |
612 | 599 | </target> |
613 | 600 |
|
614 | 601 | <target name="linux-dist" depends="build" |
|
731 | 718 | </copy> |
732 | 719 |
|
733 | 720 | <!-- Unzip AVR tools --> |
734 | | - <antcall target="unzip-avr-toolchain"> |
735 | | - <param name="file_arch" value="win32" /> |
| 721 | + <antcall target="unzip"> |
| 722 | + <param name="archive_file" value="${staging_folder}/avr-toolchain-win32-gcc-4.8.1.zip" /> |
| 723 | + <param name="archive_url" value="http://downloads.arduino.cc/avr-toolchain-win32-gcc-4.8.1.zip" /> |
| 724 | + <param name="final_folder" value="${staging_folder}/work/${staging_hardware_folder}/tools/avr" /> |
| 725 | + <param name="dest_folder" value="${staging_folder}/work/${staging_hardware_folder}/tools/avr" /> |
736 | 726 | </antcall> |
737 | 727 |
|
738 | | - <antcall target="unzip-libastyle" /> |
| 728 | + <antcall target="unzip"> |
| 729 | + <param name="archive_file" value="./libastylej-2.04.zip" /> |
| 730 | + <param name="archive_url" value="http://downloads.arduino.cc/libastylej-2.04.zip" /> |
| 731 | + <param name="final_folder" value="${staging_folder}/libastylej" /> |
| 732 | + <param name="dest_folder" value="${staging_folder}" /> |
| 733 | + </antcall> |
739 | 734 | <copy file="windows/libastylej/AStylej.dll" todir="windows/work/lib" /> |
740 | 735 |
|
741 | 736 | <!-- Copy bossac.exe tool --> |
|
0 commit comments