Advertisement
Guest User

Untitled

a guest
Feb 28th, 2013
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 30.70 KB | None | 0 0
  1. <?xml version="1.0"?>
  2. <project name="Processing" default="build">
  3.  
  4. <!-- Sets properties for macosx/windows/linux depending on current system -->
  5. <condition property="platform" value="macosx">
  6. <os family="mac" />
  7. </condition>
  8.  
  9. <condition property="platform" value="windows">
  10. <os family="windows" />
  11. </condition>
  12.  
  13. <condition property="platform" value="linux">
  14. <and>
  15. <os family="unix" />
  16. <not>
  17. <os family="mac" />
  18. </not>
  19. </and>
  20. </condition>
  21.  
  22. <!--
  23. <echo message="${java.class.path}" />
  24. -->
  25.  
  26. <!-- Set a property named macosx, linux, or windows.
  27. The 'value' chosen is arbitrary. -->
  28. <property name="${platform}" value="${platform}" />
  29.  
  30. <property environment="env" />
  31.  
  32. <!-- code signing hack, turns on code signing during dist -->
  33. <condition property="codesign">
  34. <equals arg1="${env.USER}" arg2="fry" />
  35. </condition>
  36.  
  37. <!-- Make sure that we have a legitimate JDK... This was promoted
  38. from app/build.xml because we now need this on OS X as well. -->
  39. <property name="java_home" value="${env.JAVA_HOME}" />
  40. <available file="${env.JAVA_HOME}/lib/tools.jar"
  41. property="java_tools_found" />
  42.  
  43. <fail if="windows" unless="java_tools_found"
  44. message="The JAVA_HOME variable must be set to the location of a full JDK. For instance, on Windows, this might be c:\jdk1.6.0_19." />
  45.  
  46. <!-- OS X gets a second chance that covers JDK 6,
  47. a necessity for building on OS X 10.6. -->
  48. <!--<available file="/System/Library/Frameworks/JavaVM.framework/Classes/classes.jar" property="java_tools_found" />
  49.  
  50. <fail if="macosx" unless="java_tools_found"
  51. message="To build on OS X, you must install both Apple's Java 6 and Oracle's JDK 7 (not just the plugin). Then add this line: ${line.separator}export JAVA_HOME=`/usr/libexec/java_home`${line.separator}to ~/.profile and open a new Terminal window." />
  52.  
  53. <fail if="linux" unless="java_tools_found"
  54. message="The JAVA_HOME variable must be set to the location of a full JDK. For instance, on Ubuntu Linux, this might be /usr/lib/jvm/java-6-sun." />
  55. -->
  56. <!-- Figure out the platform-specific output directory for all this work. -->
  57. <condition property="target.path"
  58. value="macosx/work/Processing.app/Contents/Resources/Java">
  59. <os family="mac" />
  60. </condition>
  61.  
  62. <condition property="target.path" value="linux/work">
  63. <os family="unix" />
  64. </condition>
  65.  
  66. <condition property="target.path" value="windows/work">
  67. <os family="windows" />
  68. </condition>
  69.  
  70. <!-- Libraries required for running processing -->
  71. <fileset dir=".." id="runtime.jars">
  72. <include name="app/pde.jar" />
  73. <include name="app/lib/antlr.jar" />
  74. <include name="app/lib/jna.jar" />
  75. <include name="app/lib/ant.jar" />
  76. <include name="app/lib/ant-launcher.jar" />
  77. <include name="app/lib/org-netbeans-swing-outline.jar" />
  78. </fileset>
  79.  
  80. <target name="build" description="Build Processing.">
  81. <antcall target="${platform}-build" />
  82. </target>
  83.  
  84. <target name="run" description="Run Processing.">
  85. <antcall target="${platform}-run" />
  86. </target>
  87.  
  88. <target name="dist" depends="revision-check"
  89. description="Build Processing for distribution.">
  90. <input message="Enter version number:"
  91. addproperty="version"
  92. defaultvalue="${revision}" />
  93. <antcall target="${platform}-dist" />
  94. </target>
  95.  
  96. <target name="android-dist-check">
  97. <!-- ensure that the android-core.zip file has been built -->
  98. <available file="${target.path}/modes/android/android-core.zip"
  99. property="android-core-present" />
  100. <!--<echo message="${target.path}/modes/android/android-core.zip" />-->
  101. <fail unless="android-core-present"
  102. message="android-core.zip was not built, but is required for dist. Install the Android tools, set ANDROID_SDK, and try again." />
  103. </target>
  104.  
  105. <!-- "§$§$&, ant doesn't have a built-in help target :( -->
  106. <target name="help" description="Show project help">
  107. <java classname="org.apache.tools.ant.Main">
  108. <arg value="-p" />
  109. </java>
  110. </target>
  111.  
  112. <!-- - - - - - - - - - - - - - - - - - -->
  113. <!-- Subprojects: Core, App, Libraries -->
  114. <!-- - - - - - - - - - - - - - - - - - -->
  115.  
  116. <target name="subprojects-clean">
  117. <subant buildpath="../core" target="clean"/>
  118. <subant buildpath="../app" target="clean"/>
  119. <subant buildpath="../java/libraries/dxf" target="clean"/>
  120. <subant buildpath="../java/libraries/net" target="clean"/>
  121. <subant buildpath="../java/libraries/pdf" target="clean"/>
  122. <subant buildpath="../java/libraries/serial" target="clean"/>
  123. <subant buildpath="../java/libraries/video" target="clean"/>
  124. <subant buildpath="../experimental" target="clean"/>
  125. <subant buildpath="../android/core" target="clean"/>
  126. <subant buildpath="shared/tools/MovieMaker" target="clean"/>
  127. </target>
  128.  
  129. <target name="subprojects-build">
  130. <subant buildpath="../core" target="build"/>
  131. <subant buildpath="../app" target="build"/>
  132. <subant buildpath="../java/libraries/dxf" target="build"/>
  133. <subant buildpath="../java/libraries/net" target="build"/>
  134. <subant buildpath="../java/libraries/pdf" target="build"/>
  135. <subant buildpath="../java/libraries/serial" target="build"/>
  136. <subant buildpath="../java/libraries/video" target="build"/>
  137. <subant buildpath="../experimental" target="build"/>
  138. <subant buildpath="../android/core" target="build"/>
  139. <subant buildpath="shared/tools/MovieMaker" target="build"/>
  140. </target>
  141.  
  142.  
  143. <!-- - - - - - - - - -->
  144. <!-- Basic Assembly -->
  145. <!-- - - - - - - - - -->
  146.  
  147.  
  148. <!-- <target name="experimental" unless="version">-->
  149. <target name="experimental">
  150. <copy todir="${target.path}/modes/experimental">
  151. <fileset dir="../experimental">
  152. <include name="**/mode/*" />
  153. <include name="**/theme/*" />
  154. </fileset>
  155. </copy>
  156. </target>
  157.  
  158. <target name="assemble" depends="version-clear, version-write, experimental">
  159. <fail unless="target.path"
  160. message="Do not call assemble from the command line." />
  161.  
  162. <!-- copy shared tools folder -->
  163. <copy todir="${target.path}/tools">
  164. <fileset dir="shared/tools" />
  165. </copy>
  166.  
  167. <copy todir="${target.path}/modes/java">
  168. <fileset dir="../java">
  169. <!--
  170. <exclude name="**/bin/*" />
  171. <exclude name="**/src/*" />
  172. <exclude name="examples" />
  173. <exclude name="**/cmd/**" />
  174. -->
  175. <exclude name="reference.zip" />
  176. <exclude name="**/._*" />
  177.  
  178. <exclude name="examples/**/applet/**" />
  179. </fileset>
  180. </copy>
  181.  
  182. <!-- decided against this.
  183. see: http://code.google.com/p/processing/issues/detail?id=650 -->
  184. <!--
  185. <get src="http://www.java.com/js/deployJava.js"
  186. dest="${target.path}/modes/java/applet/deployJava.js"
  187. usetimestamp="true" />
  188. -->
  189.  
  190. <delete dir="${target.path}/modes/java/examples">
  191. <include name="**/applet/**" />
  192. </delete>
  193. <!--
  194. <delete>
  195. <fileset dir="${target.path}/modes/java/examples"
  196. includes="**/applet/**" />
  197. </delete>
  198. -->
  199.  
  200. <!--
  201. not happy on windows, since cygwin may not be installed
  202. <exec executable="find" dir="${target.path}/modes/java/examples"
  203. errorproperty="ignored">
  204. <arg line=". -name applet -exec rm -rf {} ';'" />
  205. </exec>
  206. -->
  207.  
  208. <!--
  209. <copy todir="${target.path}/modes/java/examples">
  210. <fileset dir="../java/examples">
  211. <exclude name="**/applet/**" />
  212. </fileset>
  213. </copy>
  214. -->
  215.  
  216. <copy todir="${target.path}/modes/javascript">
  217. <fileset dir="../javascript">
  218. <exclude name="**/._*" />
  219. </fileset>
  220. </copy>
  221.  
  222. <copy todir="${target.path}/modes/android">
  223. <fileset dir="../android">
  224. <include name="android-core.zip" />
  225. <include name="examples/**" />
  226. <include name="icons/**" />
  227. <include name="theme/**" />
  228. <include name="keywords.txt" />
  229. <!--
  230. <exclude name="**/bin/**" />
  231. <exclude name="**/src/**" />
  232. <exclude name="cmd" />
  233. <exclude name="reference.zip" />
  234. -->
  235. <exclude name="**/._*" />
  236. </fileset>
  237. </copy>
  238.  
  239. <!-- copy libraries -->
  240. <!--
  241. <copy todir="${target.path}/modes/java/libraries">
  242. <fileset dir="../java/libraries">
  243. <include name="**/library/**" />
  244. <include name="**/src/**" />
  245. </fileset>
  246. </copy>
  247. -->
  248.  
  249. <!-- copy shared library folder -->
  250. <!--
  251. <copy todir="${target.path}/modes/java/libraries">
  252. <fileset dir="shared/modes/java/libraries" />
  253. </copy>
  254. -->
  255.  
  256. <!-- copy libraries for dxf, pdf, etc. -->
  257. <!--
  258. <copy todir="${target.path}/modes/java/libraries/dxf">
  259. <fileset dir="../dxf" includes="library/**,src/**" />
  260. </copy>
  261. <copy todir="${target.path}/modes/java/libraries/net">
  262. <fileset dir="../net" includes="library/**,src/**" />
  263. </copy>
  264. <copy todir="${target.path}/modes/java/libraries/pdf">
  265. <fileset dir="../pdf" includes="library/**,src/**" />
  266. </copy>
  267. <copy todir="${target.path}/modes/java/libraries/serial">
  268. <fileset dir="../serial" includes="library/**,src/**" />
  269. </copy>
  270. <copy todir="${target.path}/modes/java/libraries/video">
  271. <fileset dir="../video" includes="library/**,src/**" />
  272. </copy>
  273. -->
  274.  
  275. <!-- Unzip documentation + examples -->
  276. <!--
  277. <unzip dest="${target.path}/modes/java"
  278. src="shared/modes/java/examples.zip"
  279. overwrite="false">
  280. <patternset>
  281. <exclude name="__MACOSX/**" />
  282. <exclude name="**/._*" />
  283. </patternset>
  284. </unzip>
  285. -->
  286. <unzip dest="${target.path}/modes/java"
  287. src="../java/reference.zip"
  288. overwrite="false">
  289. <patternset>
  290. <exclude name="__MACOSX/**" />
  291. <exclude name="**/._*" />
  292. </patternset>
  293. </unzip>
  294.  
  295. <!-- Write the revision file -->
  296. <!-- is there a good way to do this? -->
  297. <!--
  298. <echo file="${target.path}/lib/version.txt"
  299. message="${version}"
  300. if="${version}" />
  301. <delete file="${target.path}/lib/version.txt"
  302. unless="${version}" />
  303. -->
  304. </target>
  305.  
  306. <target name="version-clear">
  307. <delete file="${target.path}/lib/version.txt" />
  308. </target>
  309.  
  310. <target name="version-write" if="version">
  311. <echo file="${target.path}/lib/version.txt" message="${version}"/>
  312. </target>
  313.  
  314.  
  315. <!-- - - - - - - - - -->
  316. <!-- Revision check -->
  317. <!-- - - - - - - - - -->
  318. <target name="revision-check">
  319. <!-- figure out the revision number -->
  320. <loadfile srcfile="../todo.txt" property="revision">
  321. <filterchain>
  322. <headfilter lines="1"/>
  323. <tokenfilter>
  324. <stringtokenizer suppressdelims="true"/>
  325. <!-- grab the thing from the first line that's 4 digits -->
  326. <containsregex pattern="(\d\d\d\d)" />
  327. </tokenfilter>
  328. </filterchain>
  329. </loadfile>
  330. <!-- <echo message="revision is ${revision}." /> -->
  331.  
  332. <!-- figure out the revision number in base.java -->
  333. <loadfile srcfile="../app/src/processing/app/Base.java"
  334. property="revision.base">
  335. <filterchain>
  336. <tokenfilter>
  337. <linetokenizer />
  338. <containsregex pattern="String VERSION_NAME = "/>
  339. <replaceregex pattern="[^0-9]*" flags="g" replace=""/>
  340. </tokenfilter>
  341. </filterchain>
  342. </loadfile>
  343. <!-- <echo message="base revision is ${revision.base}." /> -->
  344.  
  345. <condition property="revision.correct">
  346. <!-- Using contains because I can't figure out how to get rid of the
  347. LF in revision.base. Please file a bug if you have a fix. -->
  348. <contains string="${revision.base}" substring="${revision}"/>
  349. </condition>
  350.  
  351. <!-- the revision.base property won't be set
  352. if $revision wasn't found... -->
  353. <fail unless="revision.correct"
  354. message="Fix revision number in Base.java" />
  355. </target>
  356.  
  357.  
  358. <!-- - - - - - - - -->
  359. <!-- Mac OS X -->
  360. <!-- - - - - - - - -->
  361.  
  362. <target name="macosx-clean" depends="subprojects-clean" description="Clean Mac OS X build">
  363. <delete dir="macosx/work" />
  364. <delete dir="macosx/working_dir" />
  365. <delete dir="macosx/working.dmg" />
  366. <delete file="macosx/processing-*.dmg" />
  367. </target>
  368.  
  369. <target name="macosx-checkos" unless="macosx">
  370. <echo>
  371. =======================================================
  372. Processing for Mac OS X can only be built on Mac OS X.
  373.  
  374. Bye.
  375. =======================================================
  376. </echo>
  377. <fail message="wrong platform (${os.name})" />
  378. </target>
  379.  
  380. <target name="macosx-build" if="macosx" depends="revision-check, macosx-checkos, subprojects-build" description="Build Mac OS X version">
  381. <mkdir dir="macosx/work" />
  382.  
  383. <!-- assemble the pde -->
  384. <copy todir="macosx/work">
  385. <fileset dir="macosx/" includes="template.app/**"/>
  386. </copy>
  387.  
  388. <move file="macosx/work/template.app"
  389. tofile="macosx/work/Processing.app" />
  390.  
  391. <chmod file="macosx/work/Processing.app/Contents/MacOS/JavaApplicationStub" perm="ugo+x" />
  392.  
  393. <copy todir="macosx/work/Processing.app/Contents/Resources/Java">
  394. <fileset dir=".." includes="core/library/**" />
  395. <fileset dir="shared" includes="launch4j/**" />
  396. <fileset dir="shared" includes="lib/**" />
  397. <fileset dir="shared" includes="modes/**" />
  398. <fileset file="shared/revisions.txt" />
  399. </copy>
  400.  
  401. <copy todir="macosx/work/Processing.app/Contents/Resources/Java/lib"
  402. flatten="true">
  403. <fileset refid="runtime.jars"/>
  404. </copy>
  405.  
  406. <property name="launch4j.dir" value="macosx/work/Processing.app/Contents/Resources/Java/launch4j" />
  407.  
  408. <!-- rename the version we need -->
  409. <move file="${launch4j.dir}/bin/windres-macosx"
  410. tofile="${launch4j.dir}/bin/windres" />
  411. <move file="${launch4j.dir}/bin/ld-macosx"
  412. tofile="${launch4j.dir}/bin/ld" />
  413.  
  414. <!-- make executable (ant doesn't preserve) -->
  415. <chmod perm="ugo+x" file="${launch4j.dir}/bin/windres" />
  416. <chmod perm="ugo+x" file="${launch4j.dir}/bin/ld" />
  417.  
  418. <!-- remove the others -->
  419. <delete>
  420. <fileset dir="${launch4j.dir}/bin" includes="ld-*" />
  421. <fileset dir="${launch4j.dir}/bin" includes="windres-*" />
  422. </delete>
  423.  
  424. <antcall target="assemble">
  425. <param name="target.path" value="macosx/work/Processing.app/Contents/Resources/Java" />
  426. </antcall>
  427. </target>
  428.  
  429. <target name="macosx-run" depends="macosx-build"
  430. description="Run Mac OS X version">
  431. <exec executable="open" dir="macosx/work" spawn="true">
  432. <arg value="-a" />
  433. <arg value="/Applications/Utilities/Terminal.app" />
  434. <arg value="Processing.app/Contents/MacOS/JavaApplicationStub" />
  435. </exec>
  436. </target>
  437.  
  438. <target name="macosx-dist-sign" if="codesign">
  439. <echo>
  440. It code signing fails, may need to use:
  441. export CODESIGN_ALLOCATE="/Applications/Xcode.app/Contents/Developer/usr/bin/codesign_allocate"
  442. </echo>
  443. <exec executable="codesign" dir="macosx/work">
  444. <arg value="--force" />
  445. <arg value="--sign" />
  446. <arg value="Developer ID Application" />
  447. <arg value="Processing.app" />
  448. </exec>
  449. </target>
  450.  
  451. <target name="macosx-dist" if="macosx"
  452. depends="macosx-build,android-dist-check"
  453. description="Create a downloadable .zip for the Mac OS X version">
  454.  
  455. <!-- The ant copy command does not preserve permissions. -->
  456. <chmod file="macosx/work/Processing.app/Contents/MacOS/JavaApplicationStub" perm="ugo+x" />
  457.  
  458. <replace file="macosx/work/Processing.app/Contents/Info.plist"
  459. token="VERSION" value="${version}" />
  460. <replace file="macosx/work/Processing.app/Contents/Info.plist"
  461. token="REVISION" value="${revision}" />
  462.  
  463. <antcall target="macosx-dist-sign" />
  464.  
  465. <exec executable="ditto" dir="macosx/work">
  466. <arg line="-c -k -rsrc . ../processing-${version}-macosx.zip" />
  467. </exec>
  468.  
  469. <echo>
  470. =======================================================
  471. Processing for Mac OS X was built. Grab it from
  472.  
  473. macosx/processing-${version}-macosx.zip
  474. =======================================================
  475. </echo>
  476. </target>
  477.  
  478. <target name="macosx-dist-old" if="macosx" depends="macosx-build" description="Create a .dmg of the Mac OS X version">
  479. <!-- now build the dmg -->
  480. <gunzip src="macosx/template.dmg.gz" dest="macosx/working.dmg" />
  481.  
  482. <mkdir dir="macosx/working_dir" />
  483. <exec executable="hdiutil">
  484. <arg line="attach macosx/working.dmg -noautoopen -mountpoint macosx/working_dir" />
  485. <!--<arg line="attach macosx/working.dmg -noautoopen -quiet -mountpoint macosx/working_dir" />-->
  486. </exec>
  487.  
  488. <copy todir="macosx/working_dir">
  489. <fileset dir="macosx/work" />
  490. </copy>
  491.  
  492. <!-- The ant copy command does not preserve permissions. -->
  493. <chmod file="macosx/working_dir/Processing.app/Contents/MacOS/JavaApplicationStub" perm="ugo+x" />
  494.  
  495. <!-- Pause briefly for the OS to catch up with the DMG changes.
  496. This prevents "hdiutil: couldn't eject "disk3" - Resource busy"
  497. errors when ejecting the disk in the next step.
  498. You may need to set this value higher for your system. -->
  499. <!-- <sleep seconds="5" />-->
  500.  
  501. <!-- while building 0182, had a lot of trouble with the disk eject -->
  502. <input message="Manually eject the Processing volume and hit return." />
  503.  
  504. <!-- used -quiet -force in the dist.sh version -->
  505. <!--
  506. <exec executable="hdiutil">
  507. <arg line="detach macosx/working_dir" />
  508. </exec>
  509. -->
  510.  
  511. <delete file="macosx/processing-*.dmg" />
  512. <exec executable="hdiutil">
  513. <arg line="convert macosx/working.dmg -format UDZO -imagekey zlib-level=9 -o macosx/processing-${version}.dmg" />
  514. </exec>
  515.  
  516. <!-- Clean up the interim files. -->
  517. <delete file="macosx/working.dmg" />
  518. <delete dir="macosx/working_dir" />
  519.  
  520. <echo>
  521. =======================================================
  522. Processing for Mac OS X was built. Grab the image from
  523.  
  524. macosx/processing-${version}.dmg
  525. =======================================================
  526. </echo>
  527. </target>
  528.  
  529.  
  530. <!-- - - - - - - - -->
  531. <!-- Linux -->
  532. <!-- - - - - - - - -->
  533.  
  534. <target name="linux-clean" depends="subprojects-clean" description="Clean linux version">
  535. <delete dir="linux/work" />
  536. </target>
  537.  
  538. <target name="linux-checkos" unless="linux">
  539. <echo>
  540. =======================================================
  541. Processing for Linux can only be built on on unix systems.
  542.  
  543. Bye.
  544. =======================================================
  545. </echo>
  546.  
  547. <fail message="wrong platform (${os.name})" />
  548. </target>
  549.  
  550. <target name="linux-build" depends="revision-check, linux-checkos, subprojects-build" description="Build linux version">
  551. <mkdir dir="linux/work" />
  552.  
  553. <copy todir="linux/work">
  554. <fileset dir=".." includes="core/library/**" />
  555. <fileset dir="shared" includes="launch4j/**" />
  556. <fileset dir="shared" includes="lib/**" />
  557. <fileset dir="shared" includes="modes/**" />
  558. <fileset file="shared/revisions.txt" />
  559. </copy>
  560.  
  561. <property name="launch4j.dir" value="linux/work/launch4j" />
  562.  
  563. <!-- rename the version we need -->
  564. <move file="${launch4j.dir}/bin/windres-linux${sun.arch.data.model}"
  565. tofile="${launch4j.dir}/bin/windres" />
  566. <move file="${launch4j.dir}/bin/ld-linux${sun.arch.data.model}"
  567. tofile="${launch4j.dir}/bin/ld" />
  568.  
  569. <!-- make executable (ant doesn't preserve) -->
  570. <chmod perm="ugo+x" file="${launch4j.dir}/bin/windres" />
  571. <chmod perm="ugo+x" file="${launch4j.dir}/bin/ld" />
  572.  
  573. <!-- remove the others -->
  574. <delete>
  575. <fileset dir="${launch4j.dir}/bin" includes="ld-*" />
  576. <fileset dir="${launch4j.dir}/bin" includes="windres-*" />
  577. </delete>
  578.  
  579. <copy todir="linux/work/lib" flatten="true">
  580. <fileset refid="runtime.jars" />
  581. </copy>
  582.  
  583. <antcall target="assemble">
  584. <param name="target.path" value="linux/work" />
  585. </antcall>
  586.  
  587. <copy file="linux/processing" todir="linux/work" />
  588. <chmod perm="ugo+x" file="linux/work/processing" />
  589.  
  590. <!-- copy command line tool -->
  591. <copy file="linux/processing" tofile="linux/work/processing-java" />
  592. <chmod perm="ugo+x" file="linux/work/processing-java" />
  593.  
  594. <property name="jre.file"
  595. value="jre-tools-6u37-linux${sun.arch.data.model}.tgz" />
  596.  
  597. <get src="http://processing.googlecode.com/files/${jre.file}"
  598. dest="linux/jre.tgz"
  599. usetimestamp="true" />
  600.  
  601. <!--
  602. Cannot use ant version of tar because it doesn't preserve properties.
  603. <untar compression="gzip"
  604. dest="linux/work"
  605. src="linux/jre.tgz"
  606. overwrite="false"/>
  607. -->
  608.  
  609. <!--
  610. http://www.gnu.org/software/tar/manual/html_section/transform.html
  611. -->
  612. <exec executable="tar">
  613. <arg value="-C" /> <!-- Change directory -->
  614. <arg value="linux/work" />
  615. <arg value="-xzpf" />
  616. <arg value="linux/jre.tgz"/>
  617. </exec>
  618.  
  619. </target>
  620.  
  621. <target name="linux-run" depends="linux-build"
  622. description="Run Linux version">
  623. <exec executable="./processing" dir="linux/work" spawn="true"/>
  624. </target>
  625.  
  626. <target name="linux-dist" depends="linux-build,android-dist-check"
  627. description="Build .tar.gz of linux version">
  628.  
  629. <!--
  630. <tar compression="gzip" destfile="linux/processing-${version}.tgz">
  631. <tarfileset dir="linux/work" prefix="processing-${version}" />
  632. </tar>
  633. -->
  634.  
  635. <!-- rename the work folder temporarily -->
  636. <move file="linux/work" tofile="linux/processing-${version}" />
  637.  
  638. <property name="linux.dist" value="linux/processing-${version}-linux${sun.arch.data.model}.tgz" />
  639.  
  640. <exec executable="tar">
  641. <arg value="--directory=linux" />
  642. <arg value="--file=${linux.dist}" />
  643. <arg value="-cpz" />
  644. <arg value="processing-${version}" />
  645. </exec>
  646.  
  647. <!-- put... the candle... back -->
  648. <!-- (rename the work processing-NNNN version to work) -->
  649. <move file="linux/processing-${version}" tofile="linux/work" />
  650.  
  651. <echo>
  652. =======================================================
  653. Processing for Linux was built. Grab the archive from
  654.  
  655. ${linux.dist}
  656. =======================================================
  657. </echo>
  658. </target>
  659.  
  660.  
  661. <!-- - - - - - - - -->
  662. <!-- Windows -->
  663. <!-- - - - - - - - -->
  664.  
  665. <target name="windows-clean" depends="subprojects-clean"
  666. description="Clean windows version">
  667. <delete dir="windows/work" />
  668. </target>
  669.  
  670. <target name="windows-checkos" unless="windows">
  671. <echo>
  672. =======================================================
  673. Processing for Windows can only be built on windows.
  674.  
  675. Bye.
  676. =======================================================
  677. </echo>
  678.  
  679. <fail message="wrong platform (${os.name})" />
  680. </target>
  681.  
  682. <target name="windows-build"
  683. depends="revision-check, windows-checkos, subprojects-build"
  684. description="Build windows version">
  685. <mkdir dir="windows/work" />
  686.  
  687. <!-- assemble the pde -->
  688. <mkdir dir="windows/work/lib" />
  689. <copy todir="windows/work/lib" flatten="true">
  690. <fileset refid="runtime.jars" />
  691. </copy>
  692.  
  693. <copy todir="windows/work">
  694. <fileset dir=".." includes="core/library/**" />
  695. <fileset dir="shared" includes="launch4j/**" />
  696. <fileset dir="shared" includes="lib/**" />
  697. <fileset dir="shared" includes="modes/**" />
  698. <fileset file="shared/revisions.txt" />
  699. </copy>
  700.  
  701. <fixcrlf srcdir="shared" eol="crlf" encoding="UTF-8"
  702. includes="revisions.txt" />
  703.  
  704. <property name="launch4j.dir" value="windows/work/launch4j" />
  705.  
  706. <!-- rename the version we need -->
  707. <move file="${launch4j.dir}/bin/windres-windows32.exe"
  708. tofile="${launch4j.dir}/bin/windres.exe" />
  709. <move file="${launch4j.dir}/bin/ld-windows32.exe"
  710. tofile="${launch4j.dir}/bin/ld.exe" />
  711.  
  712. <!-- remove the others -->
  713. <delete>
  714. <fileset dir="${launch4j.dir}/bin" includes="ld-*" />
  715. <fileset dir="${launch4j.dir}/bin" includes="windres-*" />
  716. </delete>
  717.  
  718. <antcall target="assemble">
  719. <param name="target.path" value="windows/work" />
  720. </antcall>
  721.  
  722. <taskdef name="launch4j"
  723. classname="net.sf.launch4j.ant.Launch4jTask"
  724. classpath="${launch4j.dir}/launch4j.jar; ${launch4j.dir}/lib/xstream.jar" />
  725.  
  726. <copy todir="windows/work">
  727. <fileset dir="windows/launcher"
  728. includes="about.bmp, application.ico, config.xml, config-cmd.xml"/>
  729. </copy>
  730.  
  731. <launch4j configFile="windows/work/config.xml" />
  732. <launch4j configFile="windows/work/config-cmd.xml" />
  733.  
  734. <delete dir="windows/work"
  735. includes="about.bmp, application.ico, config.xml, config-cmd.xml" />
  736.  
  737. <!--
  738. <launch4j>
  739. <config headerType="gui"
  740. outfile="windows/work/processing-java.exe"
  741. dontWrapJar="false"
  742. jarPath="../app/pde.jar">
  743. <classPath mainClass="processing.mode.java.Commander">
  744. <cp>lib/pde.jar</cp>
  745. <cp>lib/antlr.jar</cp>
  746. <cp>lib/jdt-core.jar</cp>
  747. <cp>lib/jna.jar</cp>
  748. <cp>lib/ant.jar</cp>
  749. <cp>lib/ant-launcher.jar</cp>
  750. <cp>core/library/core.jar</cp>
  751. <cp>%JAVA_HOME%/lib/tools.jar</cp>
  752. </classPath>
  753. <jre minVersion="1.6.0" jdkPreference="jdkOnly">
  754. </jre>
  755. </config>
  756. </launch4j>
  757. -->
  758.  
  759. <!-- cygwin requires html, dll, and exe to have the +x flag -->
  760. <chmod perm="ugo+x">
  761. <fileset dir="windows/work" includes="**/*.html, **/*.dll, **/*.exe" />
  762. </chmod>
  763.  
  764. <!-- starting with 2.0a7, require the local JRE + tools.jar -->
  765. <property name="jre.file"
  766. value="jre-tools-6u37-windows${sun.arch.data.model}.zip" />
  767.  
  768. <get src="http://processing.googlecode.com/files/${jre.file}"
  769. dest="windows/jre.zip"
  770. usetimestamp="true" />
  771.  
  772. <unzip dest="windows/work" src="windows/jre.zip" overwrite="false"/>
  773. </target>
  774.  
  775. <target name="windows-run" depends="windows-build"
  776. description="Run windows version">
  777. <exec executable="windows/work/processing.exe"
  778. dir="windows/work" spawn="true"/>
  779. </target>
  780.  
  781. <target name="windows-dist" depends="windows-build,android-dist-check"
  782. description="Create .zip files of windows version">
  783. <!--
  784. <zip basedir="windows/work"
  785. prefix="processing-${version}"
  786. destfile="windows/processing-${version}.zip" />
  787. <zip basedir="windows/work"
  788. prefix="processing-${version}"
  789. destfile="windows/processing-${version}-expert.zip"
  790. excludes="java/**" />
  791. -->
  792.  
  793. <property name="windows.dist" value="windows/processing-${version}-windows${sun.arch.data.model}.zip" />
  794.  
  795. <zip destfile="${windows.dist}">
  796. <zipfileset dir="windows/work"
  797. prefix="processing-${version}" />
  798. </zip>
  799.  
  800. <!-- Expert is too much of a headache. Just nix it for 2.0. -->
  801. <!--
  802. <zip destfile="windows/processing-${version}-windows-expert.zip">
  803. <zipfileset dir="windows/work"
  804. prefix="processing-${version}"
  805. excludes="java/**" />
  806. </zip>
  807. -->
  808.  
  809. <echo>
  810. =======================================================
  811. Processing for Windows was built. Grab the archive from
  812.  
  813. ${windows.dist}
  814. =======================================================
  815. </echo>
  816. </target>
  817.  
  818.  
  819. <!-- - - - - - - - - -->
  820. <!-- Developer Docs -->
  821. <!-- - - - - - - - - -->
  822.  
  823. <target name="doc">
  824.  
  825. <!-- build doc for core -->
  826. <exec executable="find" dir="javadoc" errorproperty="ignored">
  827. <arg line="core -type f -exec rm -rf {} ';'" />
  828. </exec>
  829.  
  830. <javadoc access="public" author="false" classpath="../core/library/jogl-all.jar:../core/bin:../core/library/gluegen-rt.jar" destdir="javadoc/core" nodeprecated="false" nodeprecatedlist="false" noindex="false" nonavbar="false" notree="false" source="1.6" splitindex="false" use="false" version="false">
  831.  
  832. <arg value="-notimestamp" />
  833.  
  834. <packageset dir="../core/src">
  835. <include name="processing/**" />
  836. </packageset>
  837.  
  838. </javadoc>
  839.  
  840. <!--
  841. <copy file="javadoc/stylesheet.css"
  842. tofile="javadoc/core/stylesheet.css" />
  843. <copy file="javadoc/index.html"
  844. tofile="javadoc/core/index.html" />
  845. -->
  846.  
  847. <!-- build everything else -->
  848. <exec executable="find" dir="javadoc" errorproperty="ignored">
  849. <arg line="everything -type f -exec rm -rf {} ';'" />
  850. </exec>
  851.  
  852. <javadoc access="public" author="false" classpath="../java/libraries/video/library/jna.jar:../java/libraries/serial/bin:lib/antlr.jar:../core/library/jogl-all.jar:../java/libraries/video/bin:lib/apple.jar:lib/jna.jar:lib/ant-launcher.jar:../java/libraries/pdf/bin:lib/ant.jar:../core/bin:../java/libraries/pdf/library/itext.jar:../java/libraries/video/library/gstreamer-java.jar:lib/org-netbeans-swing-outline.jar:../java/libraries/dxf/bin:bin:../java/libraries/net/bin:../java/libraries/serial/library/RXTXcomm.jar:../core/library/gluegen-rt.jar:${java.home}/lib/tools.jar" destdir="javadoc/everything" nodeprecated="false" nodeprecatedlist="false" noindex="false" nonavbar="false" notree="false" source="1.6" splitindex="false" use="false" version="false">
  853.  
  854. <arg value="-notimestamp" />
  855.  
  856. <packageset dir="../app/src">
  857. <include name="antlr/**" />
  858. <include name="processing/**" />
  859. </packageset>
  860.  
  861. <packageset dir="../app/generated">
  862. <include name="processing/**" />
  863. </packageset>
  864.  
  865. <packageset dir="../core/src">
  866. <include name="processing/**" />
  867. <include name="japplemenubar/**" />
  868. </packageset>
  869. </javadoc>
  870.  
  871. <!--
  872. <copy file="javadoc/stylesheet.css"
  873. tofile="javadoc/everything/stylesheet.css" />
  874. <copy file="javadoc/index.html"
  875. tofile="javadoc/everything/index.html" />
  876. -->
  877.  
  878. <!-- set the MIME type so that Google Code shows the files properly -->
  879. <exec executable="find" dir=".">
  880. <arg line="javadoc -name '*.html' -exec svn propset svn:mime-type text/html {} ';'" />
  881. </exec>
  882.  
  883. </target>
  884.  
  885. <!-- no longer necessary because it comes straight from Google Code -->
  886. <!--
  887. <target name="doc-upload">
  888. <exec executable="rsync" dir="javadoc" spawn="true">
  889. <arg value="-avz" />
  890. <arg value="- -delete" />
  891. <arg value="core/" />
  892. <arg value="fry@processing.org:dev/reference/core/javadoc/" />
  893. </exec>
  894.  
  895. <exec executable="rsync" dir="javadoc" spawn="true">
  896. <arg value="-avz" />
  897. <arg value="- -delete" />
  898. <arg value="everything/" />
  899. <arg value="fry@processing.org:dev/reference/core/everything/" />
  900. </exec>
  901.  
  902. rsync -avz - -delete core/ fry@processing.org:dev/reference/core/javadoc/
  903. rsync -avz - -delete everything/ fry@processing.org:dev/reference/everything/javadoc/
  904. </target>
  905. -->
  906.  
  907.  
  908. <!-- - - - - - - - -->
  909. <!-- Run It! -->
  910. <!-- - - - - - - - -->
  911.  
  912. <target name="clean" description="Perform a spring cleaning"
  913. depends="linux-clean, windows-clean, macosx-clean, subprojects-clean">
  914. </target>
  915.  
  916. </project>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement