|
20 | 20 | <condition property="platform"
|
21 | 21 | value="linux64"><os family="unix" arch="amd64" /></condition>
|
22 | 22 |
|
| 23 | + <property name="nodejs.version" value="0.8.19"/> |
| 24 | + |
| 25 | + <condition property="nodejs.file" value="node-v${nodejs.version}-linux-x86.tar.gz"> |
| 26 | + <equals arg1="${platform}" arg2="linux32"/> |
| 27 | + </condition> |
| 28 | + <condition property="nodejs.file" value="node-v${nodejs.version}-linux-x64.tar.gz"> |
| 29 | + <equals arg1="${platform}" arg2="linux64"/> |
| 30 | + </condition> |
| 31 | + <condition property="nodejs.file" value="node-v${nodejs.version}-x86.msi"> |
| 32 | + <equals arg1="${platform}" arg2="windows"/> |
| 33 | + </condition> |
| 34 | + <condition property="nodejs.file" value="node-v${nodejs.version}-darwin-x86.tar.gz"> |
| 35 | + <equals arg1="${platform}" arg2="macosx"/> |
| 36 | + </condition> |
| 37 | + |
23 | 38 | <!-- Libraries required for running arduino -->
|
24 | 39 | <fileset dir=".." id="runtime.jars">
|
25 | 40 | <include name="core/core.jar" />
|
|
222 | 237 | <param name="target.path" value="macosx/work/Arduino.app/Contents/Resources/Java" />
|
223 | 238 | </antcall>
|
224 | 239 |
|
| 240 | + <antcall target="macosx-unzip-nodejs" /> |
| 241 | + |
225 | 242 | <antcall target="macosx-unzip-arm-toolchain" />
|
226 | 243 |
|
227 | 244 | <delete includeEmptyDirs="true" quiet="true">
|
|
276 | 293 | </exec>
|
277 | 294 | </target>
|
278 | 295 |
|
| 296 | + <target name="macosx-check-nodejs-distfile"> |
| 297 | + <available file="macosx/dist/${nodejs.file}" property="nodejs_distfile_available" /> |
| 298 | + </target> |
| 299 | + |
| 300 | + <target name="macosx-get-nodejs" depends="macosx-check-nodejs-distfile" unless="nodejs_distfile_available"> |
| 301 | + <get |
| 302 | + src="http://nodejs.org/dist/v${nodejs.version}/${nodejs.file}" |
| 303 | + dest="macosx/dist/${nodejs.file}" |
| 304 | + verbose="true" /> |
| 305 | + </target> |
| 306 | + |
| 307 | + <target name="macosx-unzip-nodejs" depends="macosx-get-nodejs" unless="nodejs_available"> |
| 308 | + <checksum file="macosx/dist/${nodejs.file}" algorithm="sha" |
| 309 | + fileext=".sha" verifyproperty="checksum.matches"/> |
| 310 | + <condition property="checksum.matches.fail"> |
| 311 | + <equals arg1="${checksum.matches}" arg2="false"/> |
| 312 | + </condition> |
| 313 | + <fail if="checksum.matches.fail">Checksum failed. |
| 314 | + |
| 315 | + File ${nodejs.file} failed checksum. |
| 316 | + Please remove "macosx/dist/${nodejs.file}" to download it again. |
| 317 | + </fail> |
| 318 | + |
| 319 | + <mkdir dir="macosx/work/Arduino.app/Contents/Resources/Java/nodejs"/> |
| 320 | + |
| 321 | + <!-- Unzip toolchain to the destination folder --> |
| 322 | + <exec executable="tar" output="/dev/null"> |
| 323 | + <arg value="xfz"/> |
| 324 | + <arg value="macosx/dist/${nodejs.file}"/> |
| 325 | + <arg value="--directory=macosx/work/Arduino.app/Contents/Resources/Java/nodejs/"/> |
| 326 | + <arg value="--strip-components=1"/> |
| 327 | + </exec> |
| 328 | + </target> |
| 329 | + |
279 | 330 | <!-- - - - - - - - - - - - - - - - -->
|
280 | 331 | <!-- Sign application for MacOSX. -->
|
281 | 332 | <!-- - - - - - - - - - - - - - - - -->
|
|
471 | 522 | <copy todir="linux/work" file="linux/dist/arduino" />
|
472 | 523 | <chmod perm="755" file="linux/work/arduino" />
|
473 | 524 |
|
| 525 | + <antcall target="linux-unzip-nodejs" /> |
| 526 | + |
474 | 527 | <antcall target="linux-unzip-arm-toolchain" />
|
475 | 528 | </target>
|
476 | 529 |
|
|
541 | 594 | </exec>
|
542 | 595 | </target>
|
543 | 596 |
|
| 597 | + <target name="linux-check-nodejs-distfile"> |
| 598 | + <available file="linux/dist/${nodejs.file}" property="nodejs_distfile_available" /> |
| 599 | + </target> |
| 600 | + |
| 601 | + <target name="linux-get-nodejs" depends="linux-check-nodejs-distfile" unless="nodejs_distfile_available"> |
| 602 | + <get |
| 603 | + src="http://nodejs.org/dist/v${nodejs.version}/${nodejs.file}" |
| 604 | + dest="linux/dist/${nodejs.file}" |
| 605 | + verbose="true" /> |
| 606 | + </target> |
| 607 | + |
| 608 | + <target name="linux-unzip-nodejs" depends="linux-get-nodejs" unless="nodejs_available"> |
| 609 | + <checksum file="linux/dist/${nodejs.file}" algorithm="sha" |
| 610 | + fileext=".sha" verifyproperty="checksum.matches"/> |
| 611 | + <condition property="checksum.matches.fail"> |
| 612 | + <equals arg1="${checksum.matches}" arg2="false"/> |
| 613 | + </condition> |
| 614 | + <fail if="checksum.matches.fail">Checksum failed. |
| 615 | + |
| 616 | + File ${nodejs.file} failed checksum. |
| 617 | + Please remove "linux/dist/${nodejs.file}" to download it again. |
| 618 | + </fail> |
| 619 | + |
| 620 | + <mkdir dir="linux/work/nodejs"/> |
| 621 | + |
| 622 | + <!-- Unzip toolchain to the destination folder --> |
| 623 | + <exec executable="tar" os="Linux"> |
| 624 | + <arg value="xfz"/> |
| 625 | + <arg value="linux/dist/${nodejs.file}"/> |
| 626 | + <arg value="--directory=linux/work/nodejs/"/> |
| 627 | + <arg value="--strip-components=1"/> |
| 628 | + </exec> |
| 629 | + </target> |
| 630 | + |
544 | 631 | <target name="linux64-get-arm-toolchain" depends="linux-check-arm-toolchain-distfile" unless="arm_distfile_available">
|
545 | 632 | <antcall target="linux-get-arm-toolchain" />
|
546 | 633 | </target>
|
|
690 | 777 | <fileset dir="windows/work" includes="**/*.html, **/*.dll, **/*.exe" />
|
691 | 778 | </chmod>
|
692 | 779 |
|
| 780 | + <antcall target="windows-unzip-nodejs" /> |
| 781 | + |
693 | 782 | <antcall target="windows-unzip-arm-toolchain" />
|
694 | 783 |
|
695 | 784 | <delete includeEmptyDirs="true" quiet="true">
|
|
739 | 828 | </exec>
|
740 | 829 | </target>
|
741 | 830 |
|
| 831 | + <target name="windows-check-nodejs-distfile"> |
| 832 | + <available file="windows/dist/${nodejs.file}" property="nodejs_distfile_available" /> |
| 833 | + </target> |
| 834 | + |
| 835 | + <target name="windows-get-nodejs" depends="windows-check-nodejs-distfile" unless="nodejs_distfile_available"> |
| 836 | + <get |
| 837 | + src="http://nodejs.org/dist/v${nodejs.version}/${nodejs.file}" |
| 838 | + dest="windows/dist/${nodejs.file}" |
| 839 | + verbose="true" /> |
| 840 | + </target> |
| 841 | + |
| 842 | + <target name="windows-unzip-nodejs" depends="windows-get-nodejs" unless="nodejs_available"> |
| 843 | + <checksum file="windows/dist/${nodejs.file}" algorithm="sha" |
| 844 | + fileext=".sha" verifyproperty="checksum.matches"/> |
| 845 | + <condition property="checksum.matches.fail"> |
| 846 | + <equals arg1="${checksum.matches}" arg2="false"/> |
| 847 | + </condition> |
| 848 | + <fail if="checksum.matches.fail">Checksum failed. |
| 849 | + |
| 850 | + File ${nodejs.file} failed checksum. |
| 851 | + Please remove "windows/dist/${nodejs.file}" to download it again. |
| 852 | + </fail> |
| 853 | + |
| 854 | + <mkdir dir="windows/work/nodejs"/> |
| 855 | + |
| 856 | + <exec executable="windows/lessmsi/lessmsi.exe"> |
| 857 | + <arg value="/x"/> |
| 858 | + <arg value="windows/dist/${nodejs.file}"/> |
| 859 | + <arg value="windows/work/nodejs/"/> |
| 860 | + </exec> |
| 861 | + |
| 862 | + <move todir="windows/work/nodejs/"> |
| 863 | + <fileset dir="windows/work/nodejs/SourceDir/nodejs/" /> |
| 864 | + </move> |
| 865 | + <delete dir="windows/work/nodejs/SourceDir"/> |
| 866 | + </target> |
| 867 | + |
742 | 868 | <target name="windows-dist" depends="windows-build"
|
743 | 869 | description="Create .zip files of windows version">
|
744 | 870 |
|
|
0 commit comments