|
6 | 6 |
|
7 | 7 | <!-- Sets properties for macosx/windows/linux depending on current system -->
|
8 | 8 | <condition property="platform" value="macosx"><os family="mac" /></condition>
|
| 9 | + <condition property="platform" value="oldmacosx"> |
| 10 | + <and> |
| 11 | + <os family="mac" /> |
| 12 | + <matches string="${os.version}" pattern="^10.[56]." /> |
| 13 | + </and> |
| 14 | + </condition> |
9 | 15 | <condition property="platform" value="windows"><os family="windows" /></condition>
|
10 | 16 | <condition property="platform" value="linux32"><os family="unix" arch="i386" /></condition>
|
11 | 17 | <condition property="platform" value="linux64"><os family="unix" arch="amd64" /></condition>
|
12 | 18 |
|
13 | 19 | <condition property="macosx"><equals arg1="${platform}" arg2="macosx" /></condition>
|
| 20 | + <condition property="macosx"><equals arg1="${platform}" arg2="oldmacosx" /></condition> |
| 21 | + <condition property="oldmacosx"><equals arg1="${platform}" arg2="oldmacosx" /></condition> |
14 | 22 | <condition property="windows"><equals arg1="${platform}" arg2="windows" /></condition>
|
15 | 23 | <condition property="linux32"><equals arg1="${platform}" arg2="linux32" /></condition>
|
16 | 24 | <condition property="linux64"><equals arg1="${platform}" arg2="linux64" /></condition>
|
17 | 25 | <condition property="linux"><equals arg1="${platform}" arg2="linux32" /></condition>
|
18 | 26 | <condition property="linux"><equals arg1="${platform}" arg2="linux64" /></condition>
|
19 | 27 |
|
20 | 28 | <condition property="staging_folder" value="macosx"><equals arg1="${platform}" arg2="macosx" /></condition>
|
| 29 | + <condition property="staging_folder" value="macosx"><equals arg1="${platform}" arg2="oldmacosx" /></condition> |
21 | 30 | <condition property="staging_folder" value="windows"><equals arg1="${platform}" arg2="windows" /></condition>
|
22 | 31 | <condition property="staging_folder" value="linux"><equals arg1="${platform}" arg2="linux32" /></condition>
|
23 | 32 | <condition property="staging_folder" value="linux"><equals arg1="${platform}" arg2="linux64" /></condition>
|
24 | 33 |
|
25 |
| - <condition property="staging_hardware_folder" value="Arduino.app/Contents/Resources/Java/hardware"><equals arg1="${platform}" arg2="macosx" /></condition> |
| 34 | + <condition property="staging_hardware_folder" value="Arduino.app/Contents/Java/hardware"><equals arg1="${platform}" arg2="macosx" /></condition> |
| 35 | + <condition property="staging_hardware_folder" value="Arduino.app/Contents/Resources/Java/hardware"><equals arg1="${platform}" arg2="oldmacosx" /></condition> |
26 | 36 | <condition property="staging_hardware_folder" value="hardware"><equals arg1="${platform}" arg2="windows" /></condition>
|
27 | 37 | <condition property="staging_hardware_folder" value="hardware"><equals arg1="${platform}" arg2="linux32" /></condition>
|
28 | 38 | <condition property="staging_hardware_folder" value="hardware"><equals arg1="${platform}" arg2="linux64" /></condition>
|
|
180 | 190 | <!-- Mac OS X -->
|
181 | 191 | <!-- - - - - - - - -->
|
182 | 192 |
|
| 193 | + <target name="oldmacosx-clean" depends="macosx-clean" description="Clean Mac OS X build"/> |
| 194 | + |
183 | 195 | <target name="macosx-clean" depends="subprojects-clean" description="Clean Mac OS X build">
|
184 | 196 | <delete dir="macosx/work" />
|
185 | 197 | <delete dir="macosx/working_dir" />
|
|
201 | 213 | <fail message="wrong platform (${os.name})" />
|
202 | 214 | </target>
|
203 | 215 |
|
204 |
| - <target name="macosx-build" if="macosx" depends="revision-check, macosx-checkos, subprojects-build" description="Build Mac OS X version"> |
| 216 | + <target name="oldmacosx-build" if="macosx" depends="revision-check, macosx-checkos, subprojects-build" description="Build Mac OS X version"> |
205 | 217 | <mkdir dir="macosx/work" />
|
206 | 218 |
|
207 | 219 | <!-- assemble the pde -->
|
|
220 | 232 | <fileset file="shared/revisions.txt" />
|
221 | 233 | </copy>
|
222 | 234 |
|
| 235 | + <antcall target="macosx-build-common"/> |
| 236 | + |
| 237 | + <replace file="macosx/work/Arduino.app/Contents/Info.plist" |
| 238 | + token="VERSION" value="${version}" /> |
| 239 | + <replace file="macosx/work/Arduino.app/Contents/Info.plist" |
| 240 | + token="REVISION" value="${revision}" /> |
| 241 | + |
| 242 | + </target> |
| 243 | + |
| 244 | + <target name="macosx-build" if="macosx" depends="revision-check, macosx-checkos, subprojects-build" description="Build Mac OS X version"> |
| 245 | + <antcall target="unzip"> |
| 246 | + <param name="archive_file" value="${staging_folder}/appbundler-1.0ea.jar.zip" /> |
| 247 | + <param name="archive_url" value="http://arduino.cc/download.php?f=/appbundler-1.0ea.jar.zip" /> |
| 248 | + <param name="final_folder" value="${staging_folder}/appbundler" /> |
| 249 | + <param name="dest_folder" value="${staging_folder}/appbundler" /> |
| 250 | + </antcall> |
| 251 | + |
| 252 | + <mkdir dir="${staging_folder}/work" /> |
| 253 | + |
| 254 | + <taskdef name="bundleapp" classname="com.oracle.appbundler.AppBundlerTask" classpath="${staging_folder}/appbundler/appbundler-1.0ea.jar"/> |
| 255 | + |
| 256 | + <bundleapp outputDirectory="${staging_folder}/work" |
| 257 | + name="Arduino" |
| 258 | + displayName="Arduino" |
| 259 | + executableName="Arduino" |
| 260 | + identifier="cc.arduino.Arduino" |
| 261 | + signature="Pde1" |
| 262 | + icon="macosx/template.app/Contents/Resources/processing.icns" |
| 263 | + copyright="Arduino LLC" |
| 264 | + getInfo="${version}" |
| 265 | + shortVersion="${version}" |
| 266 | + version="${revision}" |
| 267 | + mainClassName="processing.app.Base" |
| 268 | + minimumsystem="10.7" |
| 269 | + highresolutioncapable="true"> |
| 270 | + |
| 271 | + <arch name="x86_64"/> |
| 272 | + <arch name="i386"/> |
| 273 | + |
| 274 | + <classpath refid="runtime.jars"/> |
| 275 | + <classpath file="./macosx/template.app/Contents/Resources/Java/quaqua.jar"/> |
| 276 | + |
| 277 | + <option value="-Dapple.awt.application.name=Arduino" /> |
| 278 | + <option value="-Dapple.laf.useScreenMenuBar=true"/> |
| 279 | + <option value="-Dcom.apple.macos.use-file-dialog-packages=true"/> |
| 280 | + <option value="-Dcom.apple.smallTabs=true"/> |
| 281 | + |
| 282 | + <!-- |
| 283 | + <option value="-Dapple.awt.showGrowBox=false"/> |
| 284 | + <option value="-Dapple.awt.Antialiasing=false"/> |
| 285 | + <option value="-Dapple.awt.TextAntialiasing=true"/> |
| 286 | + <option value="-Dcom.apple.hwaccel=true"/> |
| 287 | + <option value="-Dapple.awt.graphics.UseQuartz=true"/> |
| 288 | + --> |
| 289 | + |
| 290 | + <!--<option value="-Dcom.apple.macos.useScreenMenuBar=true"/>--> |
| 291 | + |
| 292 | + <!-- Workaround since the icon parameter for bundleapp doesn't work --> |
| 293 | + <option value="-Xdock:icon=Contents/Resources/processing.icns"/> |
| 294 | + <option value="-Dcom.apple.mrj.application.apple.menu.about.name=Arduino"/> |
| 295 | + <option value="-Dfile.encoding=UTF-8"/> |
| 296 | + |
| 297 | + <option value="-Xms128M"/> |
| 298 | + <option value="-Xmx256M"/> |
| 299 | + |
| 300 | + <bundledocument extensions="ino,c,cpp,h" |
| 301 | + icon="macosx/template.app/Contents/Resources/pde.icns" |
| 302 | + name="Arduino Source File" |
| 303 | + role="Editor"> |
| 304 | + </bundledocument> |
| 305 | + |
| 306 | + </bundleapp> |
| 307 | + |
| 308 | + <copy todir="${staging_folder}/work/${staging_hardware_folder}/../"> |
| 309 | + <fileset dir="shared" includes="lib/**" /> |
| 310 | + <fileset file="shared/revisions.txt" /> |
| 311 | + <file file="macosx/template.app/Contents/Resources/Java/quaqua.jar"/> |
| 312 | + <fileset file="macosx/template.app/Contents/Resources/Java/libquaqua*" /> |
| 313 | + </copy> |
| 314 | + |
| 315 | + <antcall target="macosx-build-common"/> |
| 316 | + |
| 317 | + </target> |
| 318 | + |
| 319 | + <target name="macosx-build-common"> |
| 320 | + |
223 | 321 | <!-- Unzip AVR tools -->
|
224 | 322 | <antcall target="unzip">
|
225 | 323 | <param name="archive_file" value="${staging_folder}/avr-toolchain-mac32-gcc-4.8.1.zip" />
|
|
228 | 326 | <param name="dest_folder" value="${staging_folder}/work/${staging_hardware_folder}/tools/avr" />
|
229 | 327 | </antcall>
|
230 | 328 |
|
231 |
| -<!-- |
232 |
| - <exec executable="unzip"> |
233 |
| - <arg value="-q" /> |
234 |
| - <arg value="-n" /> |
235 |
| - <arg value="-d" /> |
236 |
| - <arg value="macosx/work/${staging_hardware_folder}" /> |
237 |
| - <arg value="macosx/dist/tools-universal.zip" /> |
238 |
| - </exec> |
239 |
| -
|
240 |
| - <copy todir="macosx/work/Arduino.app/Contents/Resources/Java/hardware/tools/avr/avr/include/avr"> |
241 |
| - <fileset file="macosx/dist/eeprom.h" /> |
242 |
| - </copy> |
243 |
| ---> |
244 |
| - |
245 | 329 | <copy todir="macosx/work/${staging_hardware_folder}/tools/">
|
246 | 330 | <fileset file="macosx/dist/bossac" />
|
247 | 331 | </copy>
|
248 | 332 |
|
249 | 333 | <chmod file="macosx/work/${staging_hardware_folder}/tools/bossac" perm="+x" />
|
250 | 334 |
|
251 | 335 | <antcall target="assemble">
|
252 |
| - <param name="target.path" value="macosx/work/Arduino.app/Contents/Resources/Java" /> |
| 336 | + <param name="target.path" value="macosx/work/${staging_hardware_folder}/../" /> |
253 | 337 | </antcall>
|
254 | 338 |
|
255 | 339 | <antcall target="untar">
|
|
272 | 356 | <param name="final_folder" value="${staging_folder}/libastylej" />
|
273 | 357 | <param name="dest_folder" value="${staging_folder}" />
|
274 | 358 | </antcall>
|
275 |
| - <copy file="macosx/libastylej/libastylej.jnilib" todir="macosx/work/Arduino.app/Contents/Resources/Java/lib/" /> |
276 |
| - <chmod perm="755" file="macosx/work/Arduino.app/Contents/Resources/Java/lib/libastylej.jnilib" /> |
| 359 | + <copy file="macosx/libastylej/libastylej.jnilib" todir="macosx/work/${staging_hardware_folder}/../lib/" /> |
| 360 | + <chmod perm="755" file="macosx/work/${staging_hardware_folder}/../lib/libastylej.jnilib" /> |
| 361 | + <copy file="macosx/libastylej/libastylej.jnilib" tofile="macosx/work/${staging_hardware_folder}/../lib/libastylej.dylib" /> |
| 362 | + <chmod perm="755" file="macosx/work/${staging_hardware_folder}/../lib/libastylej.dylib" /> |
| 363 | + |
| 364 | + <chmod perm="+x"> |
| 365 | + <fileset dir="macosx/work/${staging_hardware_folder}/tools/avr/bin" includes="**/*" /> |
| 366 | + <fileset dir="macosx/work/${staging_hardware_folder}/tools/avr/avr/bin" includes="**/*" /> |
| 367 | + <fileset dir="macosx/work/${staging_hardware_folder}/tools/avr/libexec/gcc/avr/4.8.1/" includes="*" /> |
| 368 | + </chmod> |
| 369 | + |
| 370 | + </target> |
| 371 | + |
| 372 | + <target name="oldmacosx-run" depends="oldmacosx-build" description="Run Mac OS X version"> |
| 373 | + <antcall target="macosx-run-common"/> |
277 | 374 | </target>
|
278 | 375 |
|
279 | 376 | <target name="macosx-run" depends="macosx-build" description="Run Mac OS X version">
|
| 377 | + <antcall target="macosx-run-common"/> |
| 378 | + </target> |
| 379 | + |
| 380 | + <target name="oldmacosx-debug" depends="oldmacosx-build" description="Run Mac OS X version"> |
| 381 | + <antcall target="macosx-debug-common"/> |
| 382 | + </target> |
| 383 | + |
| 384 | + <target name="macosx-debug" depends="macosx-build" description="Run Mac OS X version"> |
| 385 | + <antcall target="macosx-debug-common"/> |
| 386 | + </target> |
| 387 | + |
| 388 | + <target name="macosx-run-common"> |
280 | 389 | <exec executable="open" dir="macosx/work">
|
281 | 390 | <arg value="Arduino.app"/>
|
282 | 391 | </exec>
|
283 | 392 | </target>
|
284 | 393 |
|
285 |
| - <target name="macosx-debug" depends="macosx-build" description="Run Mac OS X version"> |
| 394 | + <target name="macosx-debug-common"> |
286 | 395 | <exec executable="open" dir="macosx/work" spawn="false">
|
287 | 396 | <arg value="Arduino.app"/>
|
288 | 397 | </exec>
|
|
343 | 452 | <!-- - - - - - - - - - - - - - - - - - - -->
|
344 | 453 | <!-- Build distribution file for MacOSX. -->
|
345 | 454 | <!-- - - - - - - - - - - - - - - - - - - -->
|
346 |
| - <target name="macosx-dist" if="macosx" depends="macosx-build" description="Create a downloadable .zip for the Mac OS X version"> |
347 |
| - <!-- The ant copy command does not preserve permissions. --> |
348 |
| - <chmod file="macosx/work/Arduino.app/Contents/MacOS/JavaApplicationStub" perm="+x" /> |
349 |
| - <chmod perm="+x"> |
350 |
| - <fileset dir="macosx/work/${staging_hardware_folder}/tools/avr/bin" includes="**/*" /> |
351 |
| - <fileset dir="macosx/work/${staging_hardware_folder}/tools/avr/avr/bin" includes="**/*" /> |
352 |
| - <fileset dir="macosx/work/${staging_hardware_folder}/tools/avr/libexec/gcc/avr/4.8.1/" includes="*" /> |
353 |
| - </chmod> |
| 455 | + <target name="oldmacosx-dist" if="macosx" depends="oldmacosx-build" description="Create a downloadable .zip for the Mac OS X version"> |
| 456 | + <antcall target="macosx-dist-common"> |
| 457 | + <param name="custom_platform" value="macosx"/> |
| 458 | + </antcall> |
| 459 | + </target> |
354 | 460 |
|
355 |
| - <replace file="macosx/work/Arduino.app/Contents/Info.plist" |
356 |
| - token="VERSION" value="${version}" /> |
357 |
| - <replace file="macosx/work/Arduino.app/Contents/Info.plist" |
358 |
| - token="REVISION" value="${revision}" /> |
| 461 | + <target name="macosx-dist" if="macosx" depends="macosx-build" description="Create a downloadable .zip for the Mac OS X version"> |
| 462 | + <antcall target="macosx-dist-common"> |
| 463 | + <param name="custom_platform" value="macosx-new"/> |
| 464 | + </antcall> |
| 465 | + </target> |
359 | 466 |
|
| 467 | + <target name="macosx-dist-common"> |
360 | 468 | <exec executable="zip" dir="macosx/work">
|
361 |
| - <arg line="-q -r ../arduino-${version}-${platform}.zip ." /> |
| 469 | + <arg line="-q -r ../arduino-${version}-${custom_platform}.zip ." /> |
362 | 470 | </exec>
|
363 |
| - <!-- <exec executable="ditto" dir="macosx/work"> |
364 |
| - <arg line="-c -k -rsrc . ../arduino-${version}-macosx.zip" /> |
365 |
| - </exec> --> |
366 | 471 |
|
367 | 472 | <echo>
|
368 | 473 | =======================================================
|
369 | 474 | Arduino for Mac OS X was built. Grab the image from
|
370 | 475 |
|
371 |
| - macosx/arduino-${version}-${platform}.zip |
| 476 | + macosx/arduino-${version}-${custom_platform}.zip |
372 | 477 | =======================================================
|
373 | 478 | </echo>
|
374 | 479 | </target>
|
|
0 commit comments