Skip to content

Commit

Permalink
Merge branch 'osx-app-bundler' into ide-1.5.x
Browse files Browse the repository at this point in the history
Conflicts:
	build/build.xml
  • Loading branch information
cmaglie committed Jun 27, 2014
2 parents 403c96f + f21a92a commit d52e75f
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 39 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ build/windows/WinAVR-*.zip
build/macosx/arduino-*.zip
build/macosx/dist/gcc-*.tar.gz
build/macosx/libastylej*
build/macosx/appbundler*.jar
build/linux/work/
build/linux/dist/*.tar.gz
build/linux/*.tgz
Expand Down
5 changes: 5 additions & 0 deletions app/src/processing/app/macosx/Platform.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ public void setLookAndFeel() throws Exception {
UIManager.put("Component.visualMargin", new Insets(1, 1, 1, 1));
}

public Platform() {
// For more information see:
// http://mail.openjdk.java.net/pipermail/macosx-port-dev/2013-January/005261.html
Toolkit.getDefaultToolkit();
}

public void init(Base base) {
System.setProperty("apple.laf.useScreenMenuBar", "true");
Expand Down
102 changes: 63 additions & 39 deletions build/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<condition property="staging_folder" value="linux"><equals arg1="${platform}" arg2="linux32" /></condition>
<condition property="staging_folder" value="linux"><equals arg1="${platform}" arg2="linux64" /></condition>

<condition property="staging_hardware_folder" value="Arduino.app/Contents/Resources/Java/hardware"><equals arg1="${platform}" arg2="macosx" /></condition>
<condition property="staging_hardware_folder" value="Arduino.app/Contents/Java/hardware"><equals arg1="${platform}" arg2="macosx" /></condition>
<condition property="staging_hardware_folder" value="hardware"><equals arg1="${platform}" arg2="windows" /></condition>
<condition property="staging_hardware_folder" value="hardware"><equals arg1="${platform}" arg2="linux32" /></condition>
<condition property="staging_hardware_folder" value="hardware"><equals arg1="${platform}" arg2="linux64" /></condition>
Expand Down Expand Up @@ -155,7 +155,7 @@
<tokenfilter>
<linetokenizer includeDelims="false" />
<!-- grab the thing from the first line that's 4 digits -->
<containsregex pattern="ARDUINO (.*) " />
<containsregex pattern="ARDUINO ([^ ]*)" />
<replaceregex pattern="ARDUINO ([^ ]*).*" replace="\1" />
</tokenfilter>
<tokenfilter>
Expand Down Expand Up @@ -207,23 +207,48 @@
<target name="macosx-build" if="macosx" depends="revision-check, macosx-checkos, subprojects-build" description="Build Mac OS X version">
<mkdir dir="macosx/work" />

<!-- assemble the pde -->
<copy todir="macosx/work/Arduino.app">
<fileset dir="macosx/template.app" includes="**"/>
</copy>

<!-- <rename src="macosx/work/template.app"
dest="macosx/work/Arduino.app" />
<move file="macosx/work/template.app"
tofile="macosx/work/Arduino.app" />-->

<chmod file="macosx/work/Arduino.app/Contents/MacOS/JavaApplicationStub" perm="755" />

<copy todir="macosx/work/Arduino.app/Contents/Resources/Java" flatten="true">
<fileset refid="runtime.jars"/>
</copy>

<copy todir="macosx/work/Arduino.app/Contents/Resources/Java">
<get src="http://downloads.arduino.cc/appbundler-1.0-arduino.jar" dest="macosx" usetimestamp="true" skipexisting="true" />

<taskdef name="bundleapp" classname="com.oracle.appbundler.AppBundlerTask" classpath="macosx/appbundler-1.0-arduino.jar" />

<bundleapp outputdirectory="macosx/work"
name="Arduino"
displayname="Arduino"
shortversion="${version}"
icon="macosx/template.app/Contents/Resources/processing.icns"
identifier="cc.arduino.Arduino"
mainclassname="processing.app.Base">

<documentType name="Arduino Source File"
icon="macosx/template.app/Contents/Resources/pde.icns"
role="Editor">
<extension>ino</extension>
<extension>c</extension>
<extension>cpp</extension>
<extension>h</extension>
<mimeType>text/plain</mimeType>
<osType>TEXT</osType>
</documentType>

<classpath file="../app/pde.jar" />
<classpath file="../core/core.jar" />
<classpath dir="../app/lib" includes="*.jar"/>

<option value="-Djavaroot=$APP_ROOT/Contents/Java"/>
<option value="-Xms128M"/>
<option value="-Xmx256M"/>
<option value="-Dapple.laf.useScreenMenuBar=true"/>
<option value="-Dapple.awt.showGrowBox=false"/>
<option value="-Dcom.apple.smallTabs=true"/>
<option value="-Dapple.awt.Antialiasing=false"/>
<option value="-Dapple.awt.TextAntialiasing=true"/>
<option value="-Dcom.apple.hwaccel=true"/>
<option value="-Dapple.awt.use-file-dialog-packages=false"/>
<option value="-Dapple.awt.graphics.UseQuartz=true"/>
<option value="-Dapple.awt.application.name=Arduino"/>
</bundleapp>

<copy todir="macosx/work/Arduino.app/Contents/Java">
<fileset dir="shared" includes="lib/**" />
<fileset file="shared/revisions.txt" />
</copy>
Expand All @@ -238,7 +263,7 @@
<arg value="-q" />
<arg value="-n" />
<arg value="-d" />
<arg value="macosx/work/Arduino.app/Contents/Resources/Java/hardware" />
<arg value="macosx/work/${staging_hardware_folder}" />
<arg value="macosx/dist/tools-universal.zip" />
</exec>
Expand All @@ -247,14 +272,14 @@
</copy>
-->

<copy todir="macosx/work/Arduino.app/Contents/Resources/Java/hardware/tools/">
<copy todir="macosx/work/${staging_hardware_folder}/tools/">
<fileset file="macosx/dist/bossac" />
</copy>

<chmod file="macosx/work/Arduino.app/Contents/Resources/Java/hardware/tools/bossac" perm="+x" />
<chmod file="macosx/work/${staging_hardware_folder}/tools/bossac" perm="+x" />

<antcall target="assemble">
<param name="target.path" value="macosx/work/Arduino.app/Contents/Resources/Java" />
<param name="target.path" value="macosx/work/Arduino.app/Contents/Java" />
</antcall>

<antcall target="unzip-arm-toolchain">
Expand All @@ -264,24 +289,28 @@
</antcall>

<delete includeEmptyDirs="true" quiet="true">
<fileset dir="macosx/work/Arduino.app/Contents/Resources/Java/hardware/tools" includes="**/3.4.6/**/*"/>
<fileset dir="macosx/work/Arduino.app/Contents/Resources/Java/hardware/tools" includes="**/3.4.6"/>
<fileset dir="macosx/work/Arduino.app/Contents/Resources/Java/hardware/tools" includes="**/man/**/*"/>
<fileset dir="macosx/work/Arduino.app/Contents/Resources/Java/hardware/tools" includes="**/man"/>
<fileset dir="macosx/work/${staging_hardware_folder}/tools" includes="**/3.4.6/**/*"/>
<fileset dir="macosx/work/${staging_hardware_folder}/tools" includes="**/3.4.6"/>
<fileset dir="macosx/work/${staging_hardware_folder}/tools" includes="**/man/**/*"/>
<fileset dir="macosx/work/${staging_hardware_folder}/tools" includes="**/man"/>
</delete>

<get src="http://downloads.arduino.cc/libastylej-2.03.zip" dest="macosx" usetimestamp="true" skipexisting="true"/>
<unzip src="macosx/libastylej-2.03.zip" dest="macosx" overwrite="true"/>
<copy file="macosx/libastylej/libastylej.jnilib" todir="macosx/work/Arduino.app/Contents/Resources/Java/lib/" />
<chmod perm="755" file="macosx/work/Arduino.app/Contents/Resources/Java/lib/libastylej.jnilib" />
<copy file="macosx/libastylej/libastylej.jnilib" todir="macosx/work/Arduino.app/Contents/Java/lib/" />
<chmod perm="755" file="macosx/work/Arduino.app/Contents/Java/lib/libastylej.jnilib" />
</target>

<target name="macosx-run" depends="macosx-build" description="Run Mac OS X version">
<exec executable="macosx/work/Arduino.app/Contents/MacOS/JavaApplicationStub" spawn="true"/>
<exec executable="open" dir="macosx/work">
<arg value="Arduino.app"/>
</exec>
</target>

<target name="macosx-debug" depends="macosx-build" description="Run Mac OS X version">
<exec executable="macosx/work/Arduino.app/Contents/MacOS/JavaApplicationStub" spawn="false"/>
<exec executable="open" dir="macosx/work" spawn="false">
<arg value="Arduino.app"/>
</exec>
</target>

<!-- - - - - - - - - - - - - - - - -->
Expand Down Expand Up @@ -343,16 +372,11 @@
<!-- The ant copy command does not preserve permissions. -->
<chmod file="macosx/work/Arduino.app/Contents/MacOS/JavaApplicationStub" perm="+x" />
<chmod perm="+x">
<fileset dir="macosx/work/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin" includes="**/*" />
<fileset dir="macosx/work/Arduino.app/Contents/Resources/Java/hardware/tools/avr/avr/bin" includes="**/*" />
<fileset dir="macosx/work/Arduino.app/Contents/Resources/Java/hardware/tools/avr/libexec/gcc/avr/4.8.1/" includes="*" />
<fileset dir="macosx/work/${staging_hardware_folder}/tools/avr/bin" includes="**/*" />
<fileset dir="macosx/work/${staging_hardware_folder}/tools/avr/avr/bin" includes="**/*" />
<fileset dir="macosx/work/${staging_hardware_folder}/tools/avr/libexec/gcc/avr/4.8.1/" includes="*" />
</chmod>

<replace file="macosx/work/Arduino.app/Contents/Info.plist"
token="VERSION" value="${version}" />
<replace file="macosx/work/Arduino.app/Contents/Info.plist"
token="REVISION" value="${revision}" />

<exec executable="zip" dir="macosx/work">
<arg line="-q -r ../arduino-${version}-${platform}.zip ." />
</exec>
Expand Down
2 changes: 2 additions & 0 deletions build/shared/revisions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ ARDUINO 1.5.7 BETA
* sam: Fix to Wire usage of TWI status register (bluesign2k)

[ide]
* Moved to appbundler for building releases for MacOSX. (Haavar Valeur)
This should remove dependency from Java 1.6 on recent MacOSX.
* Added support for '-' and '.' in filenames (Georg von Zengen)
* (re)Added 'arduino_debug.exe' in Windows build for debugging purposes
* Magic baudrate is no longer removed (it was a workaround for RXTX)
Expand Down

0 comments on commit d52e75f

Please sign in to comment.