Skip to content

Commit 4b6e675

Browse files
committed
properly handle ARM for Export to Application on macOS
1 parent 80afb8a commit 4b6e675

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

java/application/Info.plist.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
<key>LSArchitecturePriority</key>
4747
<array>
48-
<string>x86_64</string>
48+
<string>@@lsarchitecturepriority@@</string>
4949
</array>
5050

5151
<key>LSEnvironment</key>

java/src/processing/mode/java/JavaBuild.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,7 @@ protected boolean exportApplication(File destFolder,
849849
// compared to the machine being used to build/export the sketch
850850
// https://github.com/processing/processing/pull/4406
851851
if (Preferences.getBoolean("run.options.memory") &&
852-
!exportVariant.equals("arm")) {
852+
!exportVariant.contains("arm")) {
853853
runOptions.append("-Xms" + Preferences.get("run.options.memory.initial") + "m");
854854
runOptions.append("-Xmx" + Preferences.get("run.options.memory.maximum") + "m");
855855
}
@@ -870,7 +870,8 @@ protected boolean exportApplication(File destFolder,
870870
}
871871
}
872872

873-
/// macosx: write out Info.plist (template for classpath, etc)
873+
874+
/// macOS: write out Info.plist (template for classpath, etc)
874875

875876
if (exportPlatform == PConstants.MACOS) {
876877
StringBuilder runOptionsXML = new StringBuilder();
@@ -911,6 +912,10 @@ protected boolean exportApplication(File destFolder,
911912
sb.replace(index, index + "@@lsuipresentationmode@@".length(),
912913
Preferences.getBoolean("export.application.present") ? "4" : "0");
913914
}
915+
while ((index = sb.indexOf("@@lsarchitecturepriority@@")) != -1) {
916+
sb.replace(index, index + "@@lsarchitecturepriority@@".length(),
917+
exportVariant.substring("macos-".length()));
918+
}
914919

915920
lines[i] = sb.toString();
916921
}

todo.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
1284 (4.0b9)
22
X bump to Java 17.0.3+7
3+
X fix Export to Application on macOS with Apple Silicon
4+
X gets rid of "Unable to start Java Runtime"
35

46
contrib
57
X add flatlaf.jar to the Windows config.xml

0 commit comments

Comments
 (0)