mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-15 00:02:49 +03:00
Macosx: new appbundler, new macosx builds. Use platform=macosx and platform=oldmacosx
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@ -29,6 +29,8 @@ build/macosx/dist/*.tar.gz
|
|||||||
build/macosx/dist/*.tar.bz2
|
build/macosx/dist/*.tar.bz2
|
||||||
build/macosx/libastylej*
|
build/macosx/libastylej*
|
||||||
build/macosx/appbundler*.jar
|
build/macosx/appbundler*.jar
|
||||||
|
build/macosx/appbundler*.zip
|
||||||
|
build/macosx/appbundler
|
||||||
build/linux/work/
|
build/linux/work/
|
||||||
build/linux/dist/*.tar.gz
|
build/linux/dist/*.tar.gz
|
||||||
build/linux/dist/*.tar.bz2
|
build/linux/dist/*.tar.bz2
|
||||||
|
@ -2025,6 +2025,8 @@ public class Editor extends JFrame implements RunnerListener {
|
|||||||
// As of Processing 1.0.10, this always happens immediately.
|
// As of Processing 1.0.10, this always happens immediately.
|
||||||
// http://dev.processing.org/bugs/show_bug.cgi?id=1456
|
// http://dev.processing.org/bugs/show_bug.cgi?id=1456
|
||||||
|
|
||||||
|
toFront();
|
||||||
|
|
||||||
String prompt = I18n.format(_("Save changes to \"{0}\"? "), sketch.getName());
|
String prompt = I18n.format(_("Save changes to \"{0}\"? "), sketch.getName());
|
||||||
|
|
||||||
if (!OSUtils.isMacOS()) {
|
if (!OSUtils.isMacOS()) {
|
||||||
|
@ -7,13 +7,7 @@ import java.io.FileInputStream;
|
|||||||
import java.io.FileWriter;
|
import java.io.FileWriter;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.LinkedList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
@ -170,19 +164,13 @@ public class BaseNoGui {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static public File getContentFile(String name) {
|
static public File getContentFile(String name) {
|
||||||
String path = System.getProperty("user.dir");
|
File path = new File(System.getProperty("user.dir"));
|
||||||
|
|
||||||
// Get a path to somewhere inside the .app folder
|
|
||||||
if (OSUtils.isMacOS()) {
|
if (OSUtils.isMacOS()) {
|
||||||
// <key>javaroot</key>
|
path = new File(BaseNoGui.class.getProtectionDomain().getCodeSource().getLocation().getPath()).getParentFile();
|
||||||
// <string>$JAVAROOT</string>
|
|
||||||
String javaroot = System.getProperty("javaroot");
|
|
||||||
if (javaroot != null) {
|
|
||||||
path = javaroot;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
File working = new File(path);
|
|
||||||
return new File(working, name);
|
return new File(path, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
static public TargetPlatform getCurrentTargetPlatformFromPackage(String pack) {
|
static public TargetPlatform getCurrentTargetPlatformFromPackage(String pack) {
|
||||||
|
179
build/build.xml
179
build/build.xml
@ -6,11 +6,19 @@
|
|||||||
|
|
||||||
<!-- Sets properties for macosx/windows/linux depending on current system -->
|
<!-- Sets properties for macosx/windows/linux depending on current system -->
|
||||||
<condition property="platform" value="macosx"><os family="mac" /></condition>
|
<condition property="platform" value="macosx"><os family="mac" /></condition>
|
||||||
|
<condition property="platform" value="oldmacosx">
|
||||||
|
<and>
|
||||||
|
<os family="mac" />
|
||||||
|
<matches string="${os.version}" pattern="^10.[56]." />
|
||||||
|
</and>
|
||||||
|
</condition>
|
||||||
<condition property="platform" value="windows"><os family="windows" /></condition>
|
<condition property="platform" value="windows"><os family="windows" /></condition>
|
||||||
<condition property="platform" value="linux32"><os family="unix" arch="i386" /></condition>
|
<condition property="platform" value="linux32"><os family="unix" arch="i386" /></condition>
|
||||||
<condition property="platform" value="linux64"><os family="unix" arch="amd64" /></condition>
|
<condition property="platform" value="linux64"><os family="unix" arch="amd64" /></condition>
|
||||||
|
|
||||||
<condition property="macosx"><equals arg1="${platform}" arg2="macosx" /></condition>
|
<condition property="macosx"><equals arg1="${platform}" arg2="macosx" /></condition>
|
||||||
|
<condition property="macosx"><equals arg1="${platform}" arg2="oldmacosx" /></condition>
|
||||||
|
<condition property="oldmacosx"><equals arg1="${platform}" arg2="oldmacosx" /></condition>
|
||||||
<condition property="windows"><equals arg1="${platform}" arg2="windows" /></condition>
|
<condition property="windows"><equals arg1="${platform}" arg2="windows" /></condition>
|
||||||
<condition property="linux32"><equals arg1="${platform}" arg2="linux32" /></condition>
|
<condition property="linux32"><equals arg1="${platform}" arg2="linux32" /></condition>
|
||||||
<condition property="linux64"><equals arg1="${platform}" arg2="linux64" /></condition>
|
<condition property="linux64"><equals arg1="${platform}" arg2="linux64" /></condition>
|
||||||
@ -18,11 +26,13 @@
|
|||||||
<condition property="linux"><equals arg1="${platform}" arg2="linux64" /></condition>
|
<condition property="linux"><equals arg1="${platform}" arg2="linux64" /></condition>
|
||||||
|
|
||||||
<condition property="staging_folder" value="macosx"><equals arg1="${platform}" arg2="macosx" /></condition>
|
<condition property="staging_folder" value="macosx"><equals arg1="${platform}" arg2="macosx" /></condition>
|
||||||
|
<condition property="staging_folder" value="macosx"><equals arg1="${platform}" arg2="oldmacosx" /></condition>
|
||||||
<condition property="staging_folder" value="windows"><equals arg1="${platform}" arg2="windows" /></condition>
|
<condition property="staging_folder" value="windows"><equals arg1="${platform}" arg2="windows" /></condition>
|
||||||
<condition property="staging_folder" value="linux"><equals arg1="${platform}" arg2="linux32" /></condition>
|
<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_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="Arduino.app/Contents/Resources/Java/hardware"><equals arg1="${platform}" arg2="oldmacosx" /></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="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="linux32" /></condition>
|
||||||
<condition property="staging_hardware_folder" value="hardware"><equals arg1="${platform}" arg2="linux64" /></condition>
|
<condition property="staging_hardware_folder" value="hardware"><equals arg1="${platform}" arg2="linux64" /></condition>
|
||||||
@ -180,6 +190,8 @@
|
|||||||
<!-- Mac OS X -->
|
<!-- Mac OS X -->
|
||||||
<!-- - - - - - - - -->
|
<!-- - - - - - - - -->
|
||||||
|
|
||||||
|
<target name="oldmacosx-clean" depends="macosx-clean" description="Clean Mac OS X build"/>
|
||||||
|
|
||||||
<target name="macosx-clean" depends="subprojects-clean" description="Clean Mac OS X build">
|
<target name="macosx-clean" depends="subprojects-clean" description="Clean Mac OS X build">
|
||||||
<delete dir="macosx/work" />
|
<delete dir="macosx/work" />
|
||||||
<delete dir="macosx/working_dir" />
|
<delete dir="macosx/working_dir" />
|
||||||
@ -201,7 +213,7 @@
|
|||||||
<fail message="wrong platform (${os.name})" />
|
<fail message="wrong platform (${os.name})" />
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="macosx-build" if="macosx" depends="revision-check, macosx-checkos, subprojects-build" description="Build Mac OS X version">
|
<target name="oldmacosx-build" if="macosx" depends="revision-check, macosx-checkos, subprojects-build" description="Build Mac OS X version">
|
||||||
<mkdir dir="macosx/work" />
|
<mkdir dir="macosx/work" />
|
||||||
|
|
||||||
<!-- assemble the pde -->
|
<!-- assemble the pde -->
|
||||||
@ -220,6 +232,92 @@
|
|||||||
<fileset file="shared/revisions.txt" />
|
<fileset file="shared/revisions.txt" />
|
||||||
</copy>
|
</copy>
|
||||||
|
|
||||||
|
<antcall target="macosx-build-common"/>
|
||||||
|
|
||||||
|
<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}" />
|
||||||
|
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="macosx-build" if="macosx" depends="revision-check, macosx-checkos, subprojects-build" description="Build Mac OS X version">
|
||||||
|
<antcall target="unzip">
|
||||||
|
<param name="archive_file" value="${staging_folder}/appbundler-1.0ea.jar.zip" />
|
||||||
|
<param name="archive_url" value="http://arduino.cc/download.php?f=/appbundler-1.0ea.jar.zip" />
|
||||||
|
<param name="final_folder" value="${staging_folder}/appbundler" />
|
||||||
|
<param name="dest_folder" value="${staging_folder}/appbundler" />
|
||||||
|
</antcall>
|
||||||
|
|
||||||
|
<mkdir dir="${staging_folder}/work" />
|
||||||
|
|
||||||
|
<taskdef name="bundleapp" classname="com.oracle.appbundler.AppBundlerTask" classpath="${staging_folder}/appbundler/appbundler-1.0ea.jar"/>
|
||||||
|
|
||||||
|
<bundleapp outputDirectory="${staging_folder}/work"
|
||||||
|
name="Arduino"
|
||||||
|
displayName="Arduino"
|
||||||
|
executableName="Arduino"
|
||||||
|
identifier="cc.arduino.Arduino"
|
||||||
|
signature="Pde1"
|
||||||
|
icon="macosx/template.app/Contents/Resources/processing.icns"
|
||||||
|
copyright="Arduino LLC"
|
||||||
|
getInfo="${version}"
|
||||||
|
shortVersion="${version}"
|
||||||
|
version="${revision}"
|
||||||
|
mainClassName="processing.app.Base"
|
||||||
|
minimumsystem="10.7"
|
||||||
|
highresolutioncapable="true">
|
||||||
|
|
||||||
|
<arch name="x86_64"/>
|
||||||
|
<arch name="i386"/>
|
||||||
|
|
||||||
|
<classpath refid="runtime.jars"/>
|
||||||
|
<classpath file="./macosx/template.app/Contents/Resources/Java/quaqua.jar"/>
|
||||||
|
|
||||||
|
<option value="-Dapple.awt.application.name=Arduino" />
|
||||||
|
<option value="-Dapple.laf.useScreenMenuBar=true"/>
|
||||||
|
<option value="-Dcom.apple.macos.use-file-dialog-packages=true"/>
|
||||||
|
<option value="-Dcom.apple.smallTabs=true"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<option value="-Dapple.awt.showGrowBox=false"/>
|
||||||
|
<option value="-Dapple.awt.Antialiasing=false"/>
|
||||||
|
<option value="-Dapple.awt.TextAntialiasing=true"/>
|
||||||
|
<option value="-Dcom.apple.hwaccel=true"/>
|
||||||
|
<option value="-Dapple.awt.graphics.UseQuartz=true"/>
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!--<option value="-Dcom.apple.macos.useScreenMenuBar=true"/>-->
|
||||||
|
|
||||||
|
<!-- Workaround since the icon parameter for bundleapp doesn't work -->
|
||||||
|
<option value="-Xdock:icon=Contents/Resources/processing.icns"/>
|
||||||
|
<option value="-Dcom.apple.mrj.application.apple.menu.about.name=Arduino"/>
|
||||||
|
<option value="-Dfile.encoding=UTF-8"/>
|
||||||
|
|
||||||
|
<option value="-Xms128M"/>
|
||||||
|
<option value="-Xmx256M"/>
|
||||||
|
|
||||||
|
<bundledocument extensions="ino,c,cpp,h"
|
||||||
|
icon="macosx/template.app/Contents/Resources/pde.icns"
|
||||||
|
name="Arduino Source File"
|
||||||
|
role="Editor">
|
||||||
|
</bundledocument>
|
||||||
|
|
||||||
|
</bundleapp>
|
||||||
|
|
||||||
|
<copy todir="${staging_folder}/work/${staging_hardware_folder}/../">
|
||||||
|
<fileset dir="shared" includes="lib/**" />
|
||||||
|
<fileset file="shared/revisions.txt" />
|
||||||
|
<file file="macosx/template.app/Contents/Resources/Java/quaqua.jar"/>
|
||||||
|
<fileset file="macosx/template.app/Contents/Resources/Java/libquaqua*" />
|
||||||
|
</copy>
|
||||||
|
|
||||||
|
<antcall target="macosx-build-common"/>
|
||||||
|
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="macosx-build-common">
|
||||||
|
|
||||||
<!-- Unzip AVR tools -->
|
<!-- Unzip AVR tools -->
|
||||||
<antcall target="unzip">
|
<antcall target="unzip">
|
||||||
<param name="archive_file" value="${staging_folder}/avr-toolchain-mac32-gcc-4.8.1.zip" />
|
<param name="archive_file" value="${staging_folder}/avr-toolchain-mac32-gcc-4.8.1.zip" />
|
||||||
@ -228,20 +326,6 @@
|
|||||||
<param name="dest_folder" value="${staging_folder}/work/${staging_hardware_folder}/tools/avr" />
|
<param name="dest_folder" value="${staging_folder}/work/${staging_hardware_folder}/tools/avr" />
|
||||||
</antcall>
|
</antcall>
|
||||||
|
|
||||||
<!--
|
|
||||||
<exec executable="unzip">
|
|
||||||
<arg value="-q" />
|
|
||||||
<arg value="-n" />
|
|
||||||
<arg value="-d" />
|
|
||||||
<arg value="macosx/work/${staging_hardware_folder}" />
|
|
||||||
<arg value="macosx/dist/tools-universal.zip" />
|
|
||||||
</exec>
|
|
||||||
|
|
||||||
<copy todir="macosx/work/Arduino.app/Contents/Resources/Java/hardware/tools/avr/avr/include/avr">
|
|
||||||
<fileset file="macosx/dist/eeprom.h" />
|
|
||||||
</copy>
|
|
||||||
-->
|
|
||||||
|
|
||||||
<copy todir="macosx/work/${staging_hardware_folder}/tools/">
|
<copy todir="macosx/work/${staging_hardware_folder}/tools/">
|
||||||
<fileset file="macosx/dist/bossac" />
|
<fileset file="macosx/dist/bossac" />
|
||||||
</copy>
|
</copy>
|
||||||
@ -249,7 +333,7 @@
|
|||||||
<chmod file="macosx/work/${staging_hardware_folder}/tools/bossac" perm="+x" />
|
<chmod file="macosx/work/${staging_hardware_folder}/tools/bossac" perm="+x" />
|
||||||
|
|
||||||
<antcall target="assemble">
|
<antcall target="assemble">
|
||||||
<param name="target.path" value="macosx/work/Arduino.app/Contents/Resources/Java" />
|
<param name="target.path" value="macosx/work/${staging_hardware_folder}/../" />
|
||||||
</antcall>
|
</antcall>
|
||||||
|
|
||||||
<antcall target="untar">
|
<antcall target="untar">
|
||||||
@ -272,17 +356,42 @@
|
|||||||
<param name="final_folder" value="${staging_folder}/libastylej" />
|
<param name="final_folder" value="${staging_folder}/libastylej" />
|
||||||
<param name="dest_folder" value="${staging_folder}" />
|
<param name="dest_folder" value="${staging_folder}" />
|
||||||
</antcall>
|
</antcall>
|
||||||
<copy file="macosx/libastylej/libastylej.jnilib" todir="macosx/work/Arduino.app/Contents/Resources/Java/lib/" />
|
<copy file="macosx/libastylej/libastylej.jnilib" todir="macosx/work/${staging_hardware_folder}/../lib/" />
|
||||||
<chmod perm="755" file="macosx/work/Arduino.app/Contents/Resources/Java/lib/libastylej.jnilib" />
|
<chmod perm="755" file="macosx/work/${staging_hardware_folder}/../lib/libastylej.jnilib" />
|
||||||
|
<copy file="macosx/libastylej/libastylej.jnilib" tofile="macosx/work/${staging_hardware_folder}/../lib/libastylej.dylib" />
|
||||||
|
<chmod perm="755" file="macosx/work/${staging_hardware_folder}/../lib/libastylej.dylib" />
|
||||||
|
|
||||||
|
<chmod perm="+x">
|
||||||
|
<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>
|
||||||
|
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="oldmacosx-run" depends="oldmacosx-build" description="Run Mac OS X version">
|
||||||
|
<antcall target="macosx-run-common"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="macosx-run" depends="macosx-build" description="Run Mac OS X version">
|
<target name="macosx-run" depends="macosx-build" description="Run Mac OS X version">
|
||||||
|
<antcall target="macosx-run-common"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="oldmacosx-debug" depends="oldmacosx-build" description="Run Mac OS X version">
|
||||||
|
<antcall target="macosx-debug-common"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="macosx-debug" depends="macosx-build" description="Run Mac OS X version">
|
||||||
|
<antcall target="macosx-debug-common"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="macosx-run-common">
|
||||||
<exec executable="open" dir="macosx/work">
|
<exec executable="open" dir="macosx/work">
|
||||||
<arg value="Arduino.app"/>
|
<arg value="Arduino.app"/>
|
||||||
</exec>
|
</exec>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="macosx-debug" depends="macosx-build" description="Run Mac OS X version">
|
<target name="macosx-debug-common">
|
||||||
<exec executable="open" dir="macosx/work" spawn="false">
|
<exec executable="open" dir="macosx/work" spawn="false">
|
||||||
<arg value="Arduino.app"/>
|
<arg value="Arduino.app"/>
|
||||||
</exec>
|
</exec>
|
||||||
@ -343,32 +452,28 @@
|
|||||||
<!-- - - - - - - - - - - - - - - - - - - -->
|
<!-- - - - - - - - - - - - - - - - - - - -->
|
||||||
<!-- Build distribution file for MacOSX. -->
|
<!-- Build distribution file for MacOSX. -->
|
||||||
<!-- - - - - - - - - - - - - - - - - - - -->
|
<!-- - - - - - - - - - - - - - - - - - - -->
|
||||||
|
<target name="oldmacosx-dist" if="macosx" depends="oldmacosx-build" description="Create a downloadable .zip for the Mac OS X version">
|
||||||
|
<antcall target="macosx-dist-common">
|
||||||
|
<param name="custom_platform" value="macosx"/>
|
||||||
|
</antcall>
|
||||||
|
</target>
|
||||||
|
|
||||||
<target name="macosx-dist" if="macosx" depends="macosx-build" description="Create a downloadable .zip for the Mac OS X version">
|
<target name="macosx-dist" if="macosx" depends="macosx-build" description="Create a downloadable .zip for the Mac OS X version">
|
||||||
<!-- The ant copy command does not preserve permissions. -->
|
<antcall target="macosx-dist-common">
|
||||||
<chmod file="macosx/work/Arduino.app/Contents/MacOS/JavaApplicationStub" perm="+x" />
|
<param name="custom_platform" value="macosx-new"/>
|
||||||
<chmod perm="+x">
|
</antcall>
|
||||||
<fileset dir="macosx/work/${staging_hardware_folder}/tools/avr/bin" includes="**/*" />
|
</target>
|
||||||
<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}" />
|
|
||||||
|
|
||||||
|
<target name="macosx-dist-common">
|
||||||
<exec executable="zip" dir="macosx/work">
|
<exec executable="zip" dir="macosx/work">
|
||||||
<arg line="-q -r ../arduino-${version}-${platform}.zip ." />
|
<arg line="-q -r ../arduino-${version}-${custom_platform}.zip ." />
|
||||||
</exec>
|
</exec>
|
||||||
<!-- <exec executable="ditto" dir="macosx/work">
|
|
||||||
<arg line="-c -k -rsrc . ../arduino-${version}-macosx.zip" />
|
|
||||||
</exec> -->
|
|
||||||
|
|
||||||
<echo>
|
<echo>
|
||||||
=======================================================
|
=======================================================
|
||||||
Arduino for Mac OS X was built. Grab the image from
|
Arduino for Mac OS X was built. Grab the image from
|
||||||
|
|
||||||
macosx/arduino-${version}-${platform}.zip
|
macosx/arduino-${version}-${custom_platform}.zip
|
||||||
=======================================================
|
=======================================================
|
||||||
</echo>
|
</echo>
|
||||||
</target>
|
</target>
|
||||||
|
1
build/macosx/appbundler-1.0ea.jar.zip.sha
Normal file
1
build/macosx/appbundler-1.0ea.jar.zip.sha
Normal file
@ -0,0 +1 @@
|
|||||||
|
28b3ccde1631791575a11f73e5fd0097df566fe2
|
Reference in New Issue
Block a user