|
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 | <!-- |
|
252 | 252 | <param name="target.path" value="macosx/work/Arduino.app/Contents/Resources/Java" /> |
253 | 253 | </antcall> |
254 | 254 |
|
255 | | - <antcall target="unzip-arm-toolchain"> |
256 | | - <param name="dist_file" value="gcc-arm-none-eabi-4.8.3-2014q1-mac.tar.gz" /> |
257 | | - <param name="dist_url" value="http://downloads.arduino.cc/gcc-arm-none-eabi-4.8.3-2014q1-mac.tar.gz" /> |
258 | | - <param name="dist_check_file" value="gcc-arm-none-eabi-4.8.3-2014q1" /> |
| 255 | + <antcall target="untar"> |
| 256 | + <param name="archive_file" value="${staging_folder}/dist/gcc-arm-none-eabi-4.8.3-2014q1-mac.tar.gz" /> |
| 257 | + <param name="archive_url" value="http://downloads.arduino.cc/gcc-arm-none-eabi-4.8.3-2014q1-mac.tar.gz" /> |
| 258 | + <param name="final_folder" value="${staging_folder}/work/${staging_hardware_folder}/tools/gcc-arm-none-eabi-4.8.3-2014q1" /> |
| 259 | + <param name="dest_folder" value="${staging_folder}/work/${staging_hardware_folder}/tools/" /> |
259 | 260 | </antcall> |
260 | 261 |
|
261 | 262 | <delete includeEmptyDirs="true" quiet="true"> |
|
265 | 266 | <fileset dir="macosx/work/${staging_hardware_folder}/tools" includes="**/man"/> |
266 | 267 | </delete> |
267 | 268 |
|
268 | | - <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> |
269 | 275 | <copy file="macosx/libastylej/libastylej.jnilib" todir="macosx/work/Arduino.app/Contents/Resources/Java/lib/" /> |
270 | 276 | <chmod perm="755" file="macosx/work/Arduino.app/Contents/Resources/Java/lib/libastylej.jnilib" /> |
271 | 277 | </target> |
|
479 | 485 | <copy todir="linux/work" file="linux/dist/arduino" /> |
480 | 486 | <chmod perm="755" file="linux/work/arduino" /> |
481 | 487 |
|
482 | | - <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> |
483 | 494 | <copy file="linux/libastylej/libastylej${arch-bits}.so" tofile="linux/work/lib/libastylej.so" /> |
484 | 495 | <chmod perm="755" file="linux/work/lib/libastylej.so" /> |
485 | 496 | </target> |
486 | 497 |
|
487 | 498 | <target name="linux32-build" depends="linux-build" description="Build linux (32-bit) version"> |
488 | 499 | <!-- Unzip ARM tools --> |
489 | | - <antcall target="unzip-arm-toolchain"> |
490 | | - <param name="dist_file" value="gcc-arm-none-eabi-4.8.3-2014q1-linux32.tar.gz" /> |
491 | | - <param name="dist_url" value="http://downloads.arduino.cc/gcc-arm-none-eabi-4.8.3-2014q1-linux32.tar.gz" /> |
492 | | - <param name="dist_check_file" value="gcc-arm-none-eabi-4.8.3-2014q1" /> |
| 500 | + <antcall target="untar"> |
| 501 | + <param name="archive_file" value="${staging_folder}/dist/gcc-arm-none-eabi-4.8.3-2014q1-linux32.tar.gz" /> |
| 502 | + <param name="archive_url" value="http://downloads.arduino.cc/gcc-arm-none-eabi-4.8.3-2014q1-linux32.tar.gz" /> |
| 503 | + <param name="final_folder" value="${staging_folder}/work/${staging_hardware_folder}/tools/gcc-arm-none-eabi-4.8.3-2014q1" /> |
| 504 | + <param name="dest_folder" value="${staging_folder}/work/${staging_hardware_folder}/tools/" /> |
493 | 505 | </antcall> |
494 | 506 |
|
495 | 507 | <!-- Unzip AVR tools --> |
496 | | - <antcall target="unzip-avr-toolchain"> |
497 | | - <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" /> |
498 | 513 | </antcall> |
499 | 514 | </target> |
500 | 515 |
|
501 | 516 | <target name="linux64-build" depends="linux-build" description="Build linux (64-bit) version"> |
502 | 517 | <!-- Unzip ARM tools --> |
503 | | - <antcall target="unzip-tool"> |
504 | | - <param name="dist_file" value="gcc-arm-none-eabi-4.8.3-2014q1-linux64.tar.gz" /> |
505 | | - <param name="dist_url" value="http://downloads.arduino.cc/gcc-arm-none-eabi-4.8.3-2014q1-linux64.tar.gz" /> |
506 | | - <param name="dist_check_file" value="gcc-arm-none-eabi-4.8.3-2014q1" /> |
| 518 | + <antcall target="untar"> |
| 519 | + <param name="archive_file" value="${staging_folder}/dist/gcc-arm-none-eabi-4.8.3-2014q1-linux64.tar.gz" /> |
| 520 | + <param name="archive_url" value="http://downloads.arduino.cc/gcc-arm-none-eabi-4.8.3-2014q1-linux64.tar.gz" /> |
| 521 | + <param name="final_folder" value="${staging_folder}/work/${staging_hardware_folder}/tools/gcc-arm-none-eabi-4.8.3-2014q1" /> |
| 522 | + <param name="dest_folder" value="${staging_folder}/work/${staging_hardware_folder}/tools/" /> |
507 | 523 | </antcall> |
508 | 524 |
|
509 | 525 | <!-- Unzip AVR tools --> |
510 | | - <antcall target="unzip-avr-toolchain"> |
511 | | - <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" /> |
512 | 531 | </antcall> |
513 | 532 | </target> |
514 | 533 |
|
|
520 | 539 | <exec executable="./linux/work/arduino" spawn="false"/> |
521 | 540 | </target> |
522 | 541 |
|
523 | | - <target name="unzip-avr-toolchain"> |
524 | | - <get src="http://downloads.arduino.cc/avr-toolchain-${file_arch}-gcc-4.8.1.zip" dest="${staging_folder}" usetimestamp="true" ignoreerrors="true" verbose="true" /> |
525 | | - |
526 | | - <checksum file="${staging_folder}/avr-toolchain-${file_arch}-gcc-4.8.1.zip" algorithm="sha" fileext=".sha" verifyproperty="checksum.matches"/> |
527 | | - <condition property="checksum.matches.fail"> |
528 | | - <equals arg1="${checksum.matches}" arg2="false"/> |
529 | | - </condition> |
530 | | - <fail if="checksum.matches.fail">Checksum failed. |
531 | | - |
532 | | - File avr-toolchain-${file_arch}-gcc-4.8.1.zip failed checksum. |
533 | | - Please remove "${staging_folder}/avr-toolchain-${file_arch}-gcc-4.8.1.zip" and download it again. |
534 | | - </fail> |
535 | | - |
536 | | - <mkdir dir="${staging_folder}/work/${staging_hardware_folder}/tools/avr" /> |
537 | | - <exec executable="unzip"> |
538 | | - <arg value="-q" /> |
539 | | - <arg value="-n" /> |
540 | | - <arg value="-d" /> |
541 | | - <arg value="${staging_folder}/work/${staging_hardware_folder}/tools/avr" /> |
542 | | - <arg value="${staging_folder}/avr-toolchain-${file_arch}-gcc-4.8.1.zip" /> |
543 | | - </exec> |
544 | | - </target> |
545 | | - |
546 | | - <target name="unzip-libastyle"> |
547 | | - <get src="http://downloads.arduino.cc/libastylej-2.04.zip" dest="." usetimestamp="true" ignoreerrors="true" verbose="true" /> |
548 | | - |
549 | | - <checksum file="libastylej-2.04.zip" algorithm="sha" fileext=".sha" verifyproperty="checksum.matches"/> |
550 | | - <condition property="checksum.matches.fail"> |
551 | | - <equals arg1="${checksum.matches}" arg2="false"/> |
552 | | - </condition> |
553 | | - <fail if="checksum.matches.fail">Checksum failed. |
554 | | - |
555 | | - File libastylej-2.04.zip failed checksum. |
556 | | - Please remove "libastylej-2.04.zip" and download it again. |
557 | | - </fail> |
558 | | - |
559 | | - <unzip src="libastylej-2.04.zip" dest="${staging_folder}" overwrite="true"/> |
560 | | - </target> |
561 | | - |
562 | 542 | <!-- Set '${dist_file}_available' property if toolchain dist_file is downloaded --> |
563 | 543 | <!-- Set '${dist_file}_installed' property if toolchain is installed in working directory --> |
564 | 544 | <!-- hardware/tools/${dist_check_file} is checked for existence --> |
565 | | - <target name="check-tool"> |
566 | | - <available file="${staging_folder}/dist/${dist_file}" property="${dist_file}_available" /> |
567 | | - <available file="${staging_folder}/work/hardware/tools/${dist_check_file}" property="${dist_file}_installed" /> |
| 545 | + <target name="untar-unzip-check"> |
| 546 | + <available file="${archive_file}" property="${archive_file}_available" /> |
| 547 | + <available file="${final_folder}" property="${archive_file}_installed" /> |
568 | 548 | </target> |
569 | 549 |
|
570 | 550 | <!-- Retrieve tool --> |
571 | | - <target name="get-tool" depends="check-tool" unless="${dist_file}_available"> |
572 | | - <get src="${dist_url}" dest="${staging_folder}/dist/${dist_file}" verbose="true" ignoreerrors="true" /> |
| 551 | + <target name="untar-unzip-download" depends="untar-unzip-check" unless="${archive_file}_available"> |
| 552 | + <get src="${archive_url}" dest="${archive_file}" verbose="true" ignoreerrors="true" /> |
573 | 553 | </target> |
574 | 554 |
|
575 | | - <!-- Ensure that the tool is downloaded and test checksums, if everything's ok unzip it on the tools folder --> |
576 | | - <target name="unzip-tool" depends="get-tool, check-tool" unless="${dist_file}_installed"> |
577 | | - <echo>Testing checksum of "${staging_folder}/dist/${dist_file}"</echo> |
578 | | - <checksum file="${staging_folder}/dist/${dist_file}" algorithm="sha" fileext=".sha" verifyproperty="checksum.matches"/> |
| 555 | + <target name="untar-unzip-checksum" depends="untar-unzip-download"> |
| 556 | + <echo>Testing checksum of "${archive_file}"</echo> |
| 557 | + <checksum file="${archive_file}" algorithm="sha" fileext=".sha" verifyproperty="checksum.matches"/> |
579 | 558 | <condition property="checksum.matches.fail"> |
580 | 559 | <equals arg1="${checksum.matches}" arg2="false"/> |
581 | 560 | </condition> |
582 | 561 | <fail if="checksum.matches.fail">Checksum failed. |
583 | 562 |
|
584 | | - File ${dist_file} failed checksum. |
585 | | - Please remove "${staging_folder}/dist/${dist_file}" to download it again. |
| 563 | + File ${archive_file} failed checksum. |
| 564 | + Please remove "${archive_file}" to download it again. |
586 | 565 | </fail> |
| 566 | + </target> |
587 | 567 |
|
588 | | - <!-- Unzip tool to the destination folder --> |
589 | | - <echo>Unzipping into folder ${staging_folder}/dist/${dist_file}</echo> |
| 568 | + <!-- Ensure that the tool is downloaded and test checksums, if everything's ok unzip it on the tools folder --> |
| 569 | + <target name="untar" depends="untar-unzip-checksum" unless="${archive_file}_installed"> |
| 570 | + <echo>Unzipping into folder ${dest_folder}</echo> |
590 | 571 | <exec executable="tar"> |
591 | | - <arg value="xfz"/> |
592 | | - <arg value="${staging_folder}/dist/${dist_file}"/> |
593 | | - <arg value="--directory=${staging_folder}/work/${staging_hardware_folder}/tools/"/> |
| 572 | + <arg value="xf"/> |
| 573 | + <arg value="${archive_file}"/> |
| 574 | + <arg value="--directory=${dest_folder}"/> |
594 | 575 | </exec> |
595 | 576 | </target> |
596 | 577 |
|
597 | | - |
598 | | - |
599 | | - <!-- Set 'arm_disfile_available' property if ARM toolchain dist_file is downloaded --> |
600 | | - <!-- Set 'arm_toolchain_installed' property if ARM toolchain is installed in working directory --> |
601 | | - <target name="check-arm-toolchain"> |
602 | | - <available file="${staging_folder}/dist/${dist_file}" property="arm_distfile_available" /> |
603 | | - <available file="${staging_folder}/work/hardware/tools/${dist_check_file}" property="arm_toolchain_installed" /> |
604 | | - </target> |
605 | | - |
606 | | - <!-- Retrieve ARM toolchain --> |
607 | | - <target name="get-arm-toolchain" depends="check-arm-toolchain" unless="arm_distfile_available"> |
608 | | - <get src="${dist_url}" dest="${staging_folder}/dist/${dist_file}" verbose="true" ignoreerrors="true" /> |
609 | | - </target> |
610 | | - |
611 | | - <target name="unzip-arm-toolchain" depends="get-arm-toolchain, check-arm-toolchain" |
612 | | - unless="arm_toolchain_installed"> |
613 | | - <checksum file="${staging_folder}/dist/${dist_file}" algorithm="sha" |
614 | | - fileext=".sha" verifyproperty="checksum.matches"/> |
615 | | - <condition property="checksum.matches.fail"> |
616 | | - <equals arg1="${checksum.matches}" arg2="false"/> |
617 | | - </condition> |
618 | | - <fail if="checksum.matches.fail">Checksum failed. |
619 | | - |
620 | | - File ${dist_file} failed checksum. |
621 | | - Please remove "${staging_folder}/dist/${dist_file}" to download it again. |
622 | | - </fail> |
623 | | - |
624 | | - <!-- Unzip toolchain to the destination folder --> |
625 | | - <exec executable="tar"> |
626 | | - <arg value="xfz"/> |
627 | | - <arg value="${staging_folder}/dist/${dist_file}"/> |
628 | | - <arg value="--directory=${staging_folder}/work/${staging_hardware_folder}/tools/"/> |
| 578 | + <target name="unzip" depends="untar-unzip-checksum" unless="${archive_file}_installed"> |
| 579 | + <echo>Unzipping into folder ${dest_folder}</echo> |
| 580 | + <mkdir dir="${dest_folder}" /> |
| 581 | + <exec executable="unzip"> |
| 582 | + <arg value="-q" /> |
| 583 | + <arg value="-n" /> |
| 584 | + <arg value="-d" /> |
| 585 | + <arg value="${dest_folder}" /> |
| 586 | + <arg value="${archive_file}" /> |
629 | 587 | </exec> |
630 | 588 | </target> |
631 | 589 |
|
|
659 | 617 | <move file="linux/work" tofile="linux/arduino-${version}" /> |
660 | 618 |
|
661 | 619 | <exec executable="tar" dir="linux"> |
662 | | - <arg value="-z"/> |
663 | 620 | <arg value="-c"/> |
664 | 621 | <arg value="-f"/> |
665 | 622 | <arg value="arduino-${version}-${platform}.tgz"/> |
|
716 | 673 | <get src="http://switch.dl.sourceforge.net/project/launch4j/launch4j-3/3.0.2/launch4j-3.0.2-linux.tgz" dest="windows" usetimestamp="true" skipexisting="true" verbose="true" /> |
717 | 674 |
|
718 | 675 | <exec executable="tar" dir="windows/launcher"> |
719 | | - <arg value="-xzf"/> |
| 676 | + <arg value="-xf"/> |
720 | 677 | <arg value="../launch4j-3.0.2-linux.tgz"/> |
721 | 678 | </exec> |
722 | 679 | </target> |
|
749 | 706 | </copy> |
750 | 707 |
|
751 | 708 | <!-- Unzip AVR tools --> |
752 | | - <antcall target="unzip-avr-toolchain"> |
753 | | - <param name="file_arch" value="win32" /> |
| 709 | + <antcall target="unzip"> |
| 710 | + <param name="archive_file" value="${staging_folder}/avr-toolchain-win32-gcc-4.8.1.zip" /> |
| 711 | + <param name="archive_url" value="http://downloads.arduino.cc/avr-toolchain-win32-gcc-4.8.1.zip" /> |
| 712 | + <param name="final_folder" value="${staging_folder}/work/${staging_hardware_folder}/tools/avr" /> |
| 713 | + <param name="dest_folder" value="${staging_folder}/work/${staging_hardware_folder}/tools/avr" /> |
754 | 714 | </antcall> |
755 | 715 |
|
756 | | - <antcall target="unzip-libastyle" /> |
| 716 | + <antcall target="unzip"> |
| 717 | + <param name="archive_file" value="./libastylej-2.04.zip" /> |
| 718 | + <param name="archive_url" value="http://downloads.arduino.cc/libastylej-2.04.zip" /> |
| 719 | + <param name="final_folder" value="${staging_folder}/libastylej" /> |
| 720 | + <param name="dest_folder" value="${staging_folder}" /> |
| 721 | + </antcall> |
757 | 722 | <copy file="windows/libastylej/AStylej.dll" todir="windows/work/lib" /> |
758 | 723 |
|
759 | 724 | <!-- Copy bossac.exe tool --> |
|
792 | 757 | </chmod> |
793 | 758 |
|
794 | 759 | <!-- Unzip ARM toolchain --> |
795 | | - <antcall target="unzip-arm-toolchain"> |
796 | | - <param name="dist_file" value="gcc-arm-none-eabi-4.8.3-2014q1-windows.tar.gz" /> |
797 | | - <param name="dist_url" value="http://downloads.arduino.cc/gcc-arm-none-eabi-4.8.3-2014q1-windows.tar.gz" /> |
798 | | - <param name="dist_check_file" value="gcc-arm-none-eabi-4.8.3-2014q1" /> |
| 760 | + <antcall target="untar"> |
| 761 | + <param name="archive_file" value="${staging_folder}/dist/gcc-arm-none-eabi-4.8.3-2014q1-windows.tar.gz" /> |
| 762 | + <param name="archive_url" value="http://downloads.arduino.cc/gcc-arm-none-eabi-4.8.3-2014q1-windows.tar.gz" /> |
| 763 | + <param name="final_folder" value="${staging_folder}/work/${staging_hardware_folder}/tools/gcc-arm-none-eabi-4.8.3-2014q1" /> |
| 764 | + <param name="dest_folder" value="${staging_folder}/work/${staging_hardware_folder}/tools/" /> |
799 | 765 | </antcall> |
800 | 766 |
|
801 | 767 | <delete includeEmptyDirs="true" quiet="true"> |
|
0 commit comments