diff --git a/app/src/processing/app/Library.java b/app/src/processing/app/Library.java index 1a3c62f05..73ec11d70 100644 --- a/app/src/processing/app/Library.java +++ b/app/src/processing/app/Library.java @@ -11,7 +11,15 @@ import processing.data.StringList; public class Library extends LocalContribution { - static final String[] platformNames = PConstants.platformNames; +// static final String[] platformNames = PConstants.platformNames; + + static StringDict newToOld = new StringDict(new String[][] { + { "macos-x86_64", "macosx" }, + { "windows-amd64", "windows64" }, + { "linux-amd64", "linux64" }, + { "linux-arm", "linux-armv6hf" }, + { "linux-aarch64", "linux-arm64" } + }); protected File libraryFolder; // shortname/library protected File examplesFolder; // shortname/examples @@ -30,14 +38,12 @@ public class Library extends LocalContribution { /** Per-platform exports for this library. */ Map exportList; - /** Applet exports (cross-platform by definition). */ - String[] appletExportList; - /** Android exports (single platform for now, may not exist). */ String[] androidExportList; - /** True if there are separate 32/64 bit for the specified platform index. */ - boolean[] multipleArch = new boolean[platformNames.length]; +// /** True if there are separate 32/64 bit for the specified platform index. */ +// boolean[] multipleArch = new boolean[platformNames.length]; +// Map multipleArch = new HashMap<>(); /** * For runtime, the native library path for this platform. e.g. on Windows 64, @@ -45,6 +51,9 @@ public class Library extends LocalContribution { */ String nativeLibraryPath; +// /** True if */ +// boolean variants; + static public final String propertiesFileName = "library.properties"; /** @@ -59,25 +68,24 @@ public class Library extends LocalContribution { * explicitly listing all possible architectures, and so that * macos-blah as well as and macosx will be handled properly. */ - static FilenameFilter standardFilter = new FilenameFilter() { - public boolean accept(File dir, String name) { - // skip .DS_Store files, .svn folders, etc - if (name.charAt(0) == '.') return false; - // ha, the sftp library still has one [fry 220121] - if (name.equals("CVS")) return false; - if (name.equals("export.txt")) return false; + static FilenameFilter libraryFolderFilter = (dir, name) -> { + // skip .DS_Store files, .svn folders, etc + if (name.charAt(0) == '.') return false; + // ha, the sftp library still has one [fry 220121] + if (name.equals("CVS")) return false; + if (name.equals("export.txt")) return false; - File file = new File(dir, name); - if (file.isDirectory()) { - if (name.startsWith("macos") || - name.startsWith("windows") || - name.startsWith("linux") || - name.startsWith("android")) { - return false; - } + File file = new File(dir, name); + if (file.isDirectory()) { + //noinspection RedundantIfStatement + if (name.startsWith("macos") || + name.startsWith("windows") || + name.startsWith("linux")) { + //name.startsWith("android")) { // no libraries use this + return false; } - return true; } + return true; }; static FilenameFilter jarFilter = (dir, name) -> { @@ -122,66 +130,94 @@ public class Library extends LocalContribution { * Handles all the Java-specific parsing for library handling. */ protected void handle() { + handleNative(); + handleExports(); + } + + + /** + * Identify nativeLibraryFolder location for the current platform. + */ + private void handleNative() { + String variant = Platform.getVariant(); + + // use the root of the library folder as the default + File nativeLibraryFolder = libraryFolder; + + /* + String hostPlatform = Platform.getName(); + // see if there's a 'windows', 'macosx', or 'linux' folder + File hostLibrary = new File(libraryFolder, hostPlatform); + if (hostLibrary.exists()) { + nativeLibraryFolder = hostLibrary; + } + */ + + // see if there's a {platform}-{arch} folder + File hostLibrary = new File(libraryFolder, variant); + if (hostLibrary.exists()) { + nativeLibraryFolder = hostLibrary; + + } else { + // if not found, try the old-style naming + String oldName = newToOld.get(variant); + if (oldName != null) { + hostLibrary = new File(libraryFolder, oldName); + if (hostLibrary.exists()) { + nativeLibraryFolder = hostLibrary; + } + } + } + + // save that folder for later use + nativeLibraryPath = nativeLibraryFolder.getAbsolutePath(); + } + + + private void handleExports() { + /* File exportSettings = new File(libraryFolder, "export.txt"); StringDict exportTable = exportSettings.exists() ? Util.readSettings(exportSettings) : new StringDict(); + */ exportList = new HashMap<>(); // get the list of files just in the library root - String[] baseList = libraryFolder.list(standardFilter); -// System.out.println("Loading " + name + "..."); -// PApplet.println(baseList); + String[] baseList = libraryFolder.list(libraryFolderFilter); - String appletExportStr = exportTable.get("applet"); - if (appletExportStr != null) { - appletExportList = PApplet.splitTokens(appletExportStr, ", "); - } else { - appletExportList = baseList; + for (String variant : Platform.getSupportedVariants().keys()) { + File variantFolder = new File(libraryFolder, variant); + if (!variantFolder.exists()) { + // check to see if old naming is in use + String oldName = newToOld.get(variant, null); + if (oldName != null) { + variantFolder = new File(libraryFolder, variant); + if (variantFolder.exists()) { + Messages.log("Please update " + getName() + " for Processing 4. " + + variantFolder + " is the older naming scheme."); + } + } + } + if (variantFolder.exists()) { + String[] entries = listPlatformEntries(libraryFolder, variant, baseList); + if (entries != null) { + exportList.put(variant, entries); + } + } } + /* + // not actually used in any libraries String androidExportStr = exportTable.get("android"); if (androidExportStr != null) { androidExportList = PApplet.splitTokens(androidExportStr, ", "); } else { androidExportList = baseList; } + */ - // for the host platform, need to figure out what's available - File nativeLibraryFolder = libraryFolder; - String hostPlatform = Platform.getName(); -// System.out.println("1 native lib folder now " + nativeLibraryFolder); - // see if there's a 'windows', 'macosx', or 'linux' folder - File hostLibrary = new File(libraryFolder, hostPlatform); - if (hostLibrary.exists()) { - nativeLibraryFolder = hostLibrary; - } -// System.out.println("2 native lib folder now " + nativeLibraryFolder); - // check for bit-specific version, e.g. on windows, check if there - // is a window32 or windows64 folder (on windows) - hostLibrary = - new File(libraryFolder, hostPlatform + Platform.getNativeBits()); - if (hostLibrary.exists()) { - nativeLibraryFolder = hostLibrary; - } -// System.out.println("3 native lib folder now " + nativeLibraryFolder); - - if (hostPlatform.equals("linux") && System.getProperty("os.arch").equals("arm")) { - hostLibrary = new File(libraryFolder, "linux-armv6hf"); - if (hostLibrary.exists()) { - nativeLibraryFolder = hostLibrary; - } - } - if (hostPlatform.equals("linux") && System.getProperty("os.arch").equals("aarch64")) { - hostLibrary = new File(libraryFolder, "linux-arm64"); - if (hostLibrary.exists()) { - nativeLibraryFolder = hostLibrary; - } - } - - // save that folder for later use - nativeLibraryPath = nativeLibraryFolder.getAbsolutePath(); - + /* // for each individual platform that this library supports, figure out what's around for (int i = 1; i < platformNames.length; i++) { String platformName = platformNames[i]; @@ -221,7 +257,8 @@ public class Library extends LocalContribution { } if (platformList32 != null || platformList64 != null || platformListArmv6hf != null || platformListArm64 != null) { - multipleArch[i] = true; + //multipleArch[i] = true; + multipleArch.put(platformName, true); } // if there aren't any relevant imports specified or in their own folders, @@ -249,6 +286,8 @@ public class Library extends LocalContribution { } } } + */ + // for (String p : exportList.keySet()) { // System.out.println(p + " -> "); // PApplet.println(exportList.get(p)); @@ -265,7 +304,7 @@ public class Library extends LocalContribution { static String[] listPlatformEntries(File libraryFolder, String folderName, String[] baseList) { File folder = new File(libraryFolder, folderName); if (folder.exists()) { - String[] entries = folder.list(standardFilter); + String[] entries = folder.list((dir, name) -> name.charAt(0) != '.'); if (entries != null) { String[] outgoing = new String[entries.length + baseList.length]; for (int i = 0; i < entries.length; i++) { @@ -349,12 +388,11 @@ public class Library extends LocalContribution { } - // this prepends a colon so that it can be appended to other paths safely + // the returned value begins with File.pathSeparatorChar + // so that it can be appended to other paths safely public String getClassPath() { StringBuilder cp = new StringBuilder(); -// PApplet.println(libraryFolder.getAbsolutePath()); -// PApplet.println(libraryFolder.list()); String[] jarHeads = libraryFolder.list(jarFilter); if (jarHeads != null) { for (String jar : jarHeads) { @@ -372,7 +410,6 @@ public class Library extends LocalContribution { } } } - //cp.setLength(cp.length() - 1); // remove the last separator return cp.toString(); } @@ -391,17 +428,16 @@ public class Library extends LocalContribution { } + /* public File[] getApplicationExports(int platform, String variant) { String[] list = getApplicationExportList(platform, variant); return wrapFiles(list); } - /** - * Returns the necessary exports for the specified platform. - * If no 32 or 64-bit version of the exports exists, it returns the version - * that doesn't specify bit depth. - */ +// * Returns the necessary exports for the specified platform. +// * If no 32 or 64-bit version of the exports exists, it returns the version +// * that doesn't specify bit depth. public String[] getApplicationExportList(int platform, String variant) { String platformName = PConstants.platformNames[platform]; if (variant.equals("32")) { @@ -419,6 +455,11 @@ public class Library extends LocalContribution { } return exportList.get(platformName); } + */ + + public String[] getApplicationExportList(String variant) { + return exportList.get(variant); + } @SuppressWarnings("unused") @@ -427,11 +468,15 @@ public class Library extends LocalContribution { } + /* public boolean hasMultipleArch(int platform) { - return multipleArch[platform]; + //return multipleArch[platform]; + return multipleArch.getOrDefault(platform, false); } + */ + /* public boolean supportsArch(int platform, String variant) { // If this is a universal library, or has no natives, then we're good. if (multipleArch[platform] == false) { @@ -440,10 +485,26 @@ public class Library extends LocalContribution { return getApplicationExportList(platform, variant) != null; } + public boolean isUnsupported(int platform, String variant) { + // If this is a universal library, or has no natives, then we're good. + if (!multipleArch.containsKey(platformNames[platform])) { + return false; + } + return getApplicationExportList(platform, variant) == null; + } + */ + + public boolean isUnsupported(String variant) { + return getApplicationExportList(variant) == null; + } + + + /* static public boolean hasMultipleArch(int platform, List libraries) { return libraries.stream().anyMatch(library -> library.hasMultipleArch(platform)); } + */ // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . diff --git a/app/src/processing/app/Platform.java b/app/src/processing/app/Platform.java index 59991bf7c..d71438ad4 100644 --- a/app/src/processing/app/Platform.java +++ b/app/src/processing/app/Platform.java @@ -35,6 +35,7 @@ import com.sun.jna.platform.FileUtils; import processing.app.platform.DefaultPlatform; import processing.core.PApplet; import processing.core.PConstants; +import processing.data.StringDict; public class Platform { @@ -181,13 +182,13 @@ public class Platform { // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - /** - * Return whether sketches will run as 32- or 64-bits based - * on the JVM that's in use. - */ - static public int getNativeBits() { - return nativeBits; - } +// /** +// * Return whether sketches will run as 32- or 64-bits based +// * on the JVM that's in use. +// */ +// static public int getNativeBits() { +// return nativeBits; +// } /** @@ -202,10 +203,29 @@ public class Platform { } + static public String getVariant() { + return getName() + "-" + getNativeArch(); + } + + + static StringDict supportedVariants = new StringDict(new String[][] { + { "macos-x86_64", "macOS (Intel 64-bit)" }, + { "macos-aarch64", "macOS (Apple Silicon)" }, + { "windows-amd64", "Windows (Intel 64-bit)" }, + { "linux-amd64", "Linux (Intel 64-bit)" }, + { "linux-arm", "Linux (Raspberry Pi 32-bit)" }, + { "linux-aarch64", "Linux (Raspberry Pi 64-bit)" } + }); + + static public StringDict getSupportedVariants() { + return supportedVariants; + } + +// /* +// * Return a string that identifies the variant of a platform +// * e.g. "32" or "64" on Intel +// */ /* - * Return a string that identifies the variant of a platform - * e.g. "32" or "64" on Intel - */ static public String getVariant() { return getVariant(PApplet.platform, getNativeArch(), getNativeBits()); } @@ -222,27 +242,33 @@ public class Platform { return Integer.toString(bits); // 32 or 64 } + */ + /** + * Returns one of macos, windows, linux, or other. + * Changed in 4.0b4 to return macos instead of macosx. + * Only used inside processing.app.java. + */ static public String getName() { return PConstants.platformNames[PApplet.platform]; } - /** - * Map a platform constant to its name. - * @param which PConstants.WINDOWS, PConstants.MACOSX, PConstants.LINUX - * @return one of "windows", "macosx", or "linux" - */ - static public String getName(int which) { - return platformNames.get(which); - } - - - static public int getIndex(String what) { - Integer entry = platformIndices.get(what); - return (entry == null) ? -1 : entry; - } +// /** +// * Map a platform constant to its name. +// * @param which PConstants.WINDOWS, PConstants.MACOSX, PConstants.LINUX +// * @return one of "windows", "macosx", or "linux" +// */ +// static public String getName(int which) { +// return platformNames.get(which); +// } +// +// +// static public int getIndex(String what) { +// Integer entry = platformIndices.get(what); +// return (entry == null) ? -1 : entry; +// } // These were changed to no longer rely on PApplet and PConstants because diff --git a/core/src/processing/core/PConstants.java b/core/src/processing/core/PConstants.java index cc93f5f1c..af17c1fbf 100644 --- a/core/src/processing/core/PConstants.java +++ b/core/src/processing/core/PConstants.java @@ -88,7 +88,7 @@ public interface PConstants { int MACOSX = 2; String[] platformNames = { - "other", "windows", "macosx", "linux" + "other", "windows", "macos", "linux" }; diff --git a/core/todo.txt b/core/todo.txt index bb7df7c26..ce0f1dad7 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -23,6 +23,11 @@ X PShader would have to change packages X that much messier to link back with projects that rely on JOGL +_ jogl build for m1 +_ https://github.com/processing/processing4/issues/128 +_ https://forum.jogamp.org/JOGL-for-Mac-ARM-Silicon-td4040887.html +_ https://github.com/jzy3d/jogl/blob/feature/macosx-arm64/HOW-TO-ADD-ARM64-TO-2.4.md + _ concurrent StringDict et al _ why no concurrent TreemMap? https://stackoverflow.com/a/17656453 _ https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ConcurrentSkipListMap.html diff --git a/java/src/processing/mode/java/Commander.java b/java/src/processing/mode/java/Commander.java index 2a329180c..26e191900 100644 --- a/java/src/processing/mode/java/Commander.java +++ b/java/src/processing/mode/java/Commander.java @@ -26,7 +26,7 @@ package processing.mode.java; import java.io.File; import java.io.IOException; import java.io.PrintStream; -import java.io.UnsupportedEncodingException; +import java.nio.charset.StandardCharsets; import processing.app.Base; import processing.app.Platform; @@ -37,6 +37,7 @@ import processing.app.SketchException; import processing.app.Util; import processing.app.contrib.ModeContribution; import processing.core.PApplet; +import processing.data.StringDict; import processing.mode.java.runner.Runner; @@ -54,12 +55,13 @@ public class Commander implements RunnerListener { static final String outputArg = "--output="; static final String exportApplicationArg = "--export"; static final String noJavaArg = "--no-java"; - static final String platformArg = "--platform="; - static final String bitsArg = "--bits="; +// static final String platformArg = "--platform="; +// static final String bitsArg = "--bits="; // static final String preferencesArg = "--preferences="; + static final String variantArg = "--variant="; static final int HELP = -1; - static final int PREPROCESS = 0; +// static final int PREPROCESS = 0; static final int BUILD = 1; static final int RUN = 2; static final int PRESENT = 3; @@ -80,27 +82,23 @@ public class Commander implements RunnerListener { boolean outputSet = false; // set an output folder boolean force = false; // replace that no good output folder // String preferencesPath = null; - int platform = PApplet.platform; // default to this platform +// int platform = PApplet.platform; // default to this platform // int platformBits = Base.getNativeBits(); + String variant = Platform.getVariant(); int task = HELP; boolean embedJava = true; - try { - if (Platform.isWindows()) { - // On Windows, it needs to use the default system encoding. - // https://github.com/processing/processing/issues/1633 - systemOut = new PrintStream(System.out, true); - systemErr = new PrintStream(System.err, true); - } else { - // On OS X, the output goes as MacRoman or something else useless. - // http://code.google.com/p/processing/issues/detail?id=1418 - // (Not sure about Linux, but this has worked since 2.0) - systemOut = new PrintStream(System.out, true, "UTF-8"); - systemErr = new PrintStream(System.err, true, "UTF-8"); - } - } catch (UnsupportedEncodingException e) { - e.printStackTrace(); - System.exit(1); + if (Platform.isWindows()) { + // On Windows, it needs to use the default system encoding. + // https://github.com/processing/processing/issues/1633 + systemOut = new PrintStream(System.out, true); + systemErr = new PrintStream(System.err, true); + } else { + // OS X formerly used MacRoman or something else useless. + // (Not sure about Linux, but this has worked since 2.0) + // https://github.com/processing/processing/issues/1456 + systemOut = new PrintStream(System.out, true, StandardCharsets.UTF_8); + systemErr = new PrintStream(System.err, true, StandardCharsets.UTF_8); } int argOffset = 0; @@ -135,13 +133,11 @@ public class Commander implements RunnerListener { } else if (arg.equals(noJavaArg)) { embedJava = false; - } else if (arg.startsWith(platformArg)) { - String platformStr = arg.substring(platformArg.length()); - platform = Platform.getIndex(platformStr); - if (platform == -1) { - complainAndQuit(platformStr + " should instead be " + - "'windows', 'macosx', or 'linux'.", true); - } + } else if (arg.startsWith("--platform")) { + complainAndQuit("Use --variant instead of --platform with Processing 4.", true); + + } else if (arg.startsWith(variantArg)) { + variant = arg.substring(variantArg.length()); } else if (arg.startsWith(sketchArg)) { sketchPath = arg.substring(sketchArg.length()); @@ -258,8 +254,7 @@ public class Commander implements RunnerListener { JavaBuild build = new JavaBuild(sketch); build.build(true); if (build != null) { - String variant = Platform.getVariant(); - success = build.exportApplication(outputFolder, platform, variant, embedJava); + success = build.exportApplication(outputFolder, variant, embedJava); } } } @@ -349,18 +344,46 @@ public class Commander implements RunnerListener { out.println("--present Preprocess, compile, and run a sketch in presentation mode."); out.println(); out.println("--export Export an application."); - out.println("--no-java Do not embed Java. Use at your own risk!"); - out.println("--platform Specify the platform (export to application only)."); - out.println(" Should be one of 'windows', 'macosx', or 'linux'."); - +// out.println("--platform Specify the platform (export to application only)."); +// out.println(" Should be one of 'windows', 'macosx', or 'linux'."); + out.println("--variant Specify the platform and architecture (Export only)."); + out.println("--no-java Do not embed Java."); out.println(); + + out.println("Starting with 4.0, the --platform option has been removed"); + out.println("because of the variety of platforms and architectures now available."); + out.println("Use the --variant option instead, for instance:"); + out.println(); + /* + out.println("platform variant"); + out.println("--------------------------- -------------"); + out.println("macOS (Intel 64-bit) macos-x86_64"); + out.println("macOS (Apple Silicon) macos-aarch64"); + out.println("Windows (Intel 64-bit) windows-amd64"); + out.println("Linux (Intel 64-bit) linux-amd64"); + out.println("Linux (Raspberry Pi 32-bit) linux-arm"); + out.println("Linux (Raspberry Pi 64-bit) linux-aarch64"); + */ + out.println("variant platform"); + out.println("------------- ---------------------------"); + + StringDict variants = Platform.getSupportedVariants(); + for (String key : variants.keys()) { + out.print(key); + int spaces = 15 - key.length(); // 13 dashes, two spaces + for (int i = 0; i < spaces; i++) { + System.out.print(" "); + } + System.out.println(variants.get(key)); + } + out.println(); + out.println("The --build, --run, --present, or --export must be the final parameter"); out.println("passed to Processing. Arguments passed following one of those four will"); out.println("be passed through to the sketch itself, and therefore available to the"); out.println("sketch via the 'args' field. To pass options understood by PApplet.main(),"); out.println("write a custom main() method so that the preprocessor does not add one."); out.println("https://github.com/processing/processing/wiki/Command-Line"); - out.println(); } diff --git a/java/src/processing/mode/java/JavaBuild.java b/java/src/processing/mode/java/JavaBuild.java index d157eeb48..3bbe2d326 100644 --- a/java/src/processing/mode/java/JavaBuild.java +++ b/java/src/processing/mode/java/JavaBuild.java @@ -574,7 +574,7 @@ public class JavaBuild { File folder = null; for (String platformName : PConstants.platformNames) { - int platform = Platform.getIndex(platformName); +// int platform = Platform.getIndex(platformName); // Can only embed Java on the native platform boolean embedJava = (platform == PApplet.platform) && @@ -633,20 +633,15 @@ public class JavaBuild { * Export to application without GUI. Also called by the Commander. */ protected boolean exportApplication(File destFolder, - int exportPlatform, String exportVariant, boolean embedJava) throws IOException, SketchException { - // TODO this should probably be a dialog box instead of a warning - // on the terminal. And the message should be written better than this. - // http://code.google.com/p/processing/issues/detail?id=884 for (Library library : importedLibraries) { - if (!library.supportsArch(exportPlatform, exportVariant)) { - String pn = PConstants.platformNames[exportPlatform]; + if (library.isUnsupported(exportVariant)) { Messages.showWarning("Quibbles 'n Bits", - "The application." + pn + exportVariant + - " folder will not be created\n" + - "because no " + exportVariant + " version of " + - library.getName() + " is available for " + pn, null); + "The application will not be exported for\n" + + Platform.getSupportedVariants().get(exportVariant) + + " because " + library.getName() + "\n" + + "does not support " + exportVariant + ".", null); return true; // don't cancel all exports for this, just move along } } diff --git a/java/src/processing/mode/java/JavaEditor.java b/java/src/processing/mode/java/JavaEditor.java index 049c7518f..31354936e 100644 --- a/java/src/processing/mode/java/JavaEditor.java +++ b/java/src/processing/mode/java/JavaEditor.java @@ -707,9 +707,9 @@ public class JavaEditor extends Editor { if (Platform.isMacOS()) { platformName = "macOS"; } else if (Platform.isWindows()) { - platformName = "Windows (" + Platform.getNativeBits() + "-bit)"; + platformName = "Windows"; } else if (Platform.isLinux()) { - platformName = "Linux (" + Platform.getNativeBits() + "-bit)"; + platformName = "Linux"; } final boolean embed = diff --git a/java/src/processing/mode/java/runner/Runner.java b/java/src/processing/mode/java/runner/Runner.java index 355ce65c2..ee424b4d9 100644 --- a/java/src/processing/mode/java/runner/Runner.java +++ b/java/src/processing/mode/java/runner/Runner.java @@ -108,20 +108,11 @@ public class Runner implements MessageConsumer { } // Make sure all the imported libraries will actually run with this setup. - int bits = Platform.getNativeBits(); +// int bits = Platform.getNativeBits(); String variant = Platform.getVariant(); - for (Library library : build.getImportedLibraries()) { - if (!library.supportsArch(PApplet.platform, variant)) { + if (library.isUnsupported(variant)) { sketchErr.println(library.getName() + " does not run on this architecture: " + variant); - int opposite = (bits == 32) ? 64 : 32; - if (Platform.isMacOS()) { - throw new SketchException("To use " + library.getName() + ", " + - "switch to " + opposite + "-bit mode in Preferences."); - } else { - throw new SketchException(library.getName() + " is only compatible " + - "with the " + opposite + "-bit download of Processing."); - } } } } @@ -466,7 +457,7 @@ public class Runner implements MessageConsumer { Point editorLocation = editor.getLocation(); params.append(PApplet.ARGS_EDITOR_LOCATION + "=" + editorLocation.x + "," + editorLocation.y); - } else { +// } else { // The sketch's main() will set a location centered on the new // display. It has to happen in main() because the width/height // of the sketch are not known here. @@ -743,7 +734,7 @@ public class Runner implements MessageConsumer { final PrintStream err) { if (exceptionClass.equals("java.lang.OutOfMemoryError")) { if (message.contains("exceeds VM budget")) { - // TODO this is a kludge for Android, since there's no memory preference + // TODO this is a kludge for Android, since there is no memory preference listener.statusError("OutOfMemoryError: This code attempts to use more memory than available."); err.println("An OutOfMemoryError means that your code is either using up too much memory"); err.println("because of a bug (e.g. creating an array that's too large, or unintentionally"); @@ -758,13 +749,8 @@ public class Runner implements MessageConsumer { err.println("you can increase the memory available to your sketch using the Preferences window."); } } else if (exceptionClass.equals("java.lang.UnsatisfiedLinkError")) { - listener.statusError("A library used by this sketch is not installed properly."); - if (PApplet.platform == PConstants.LINUX) { - err.println(message); - } - err.println("A library relies on native code that's not available."); - err.println("Or only works properly when the sketch is run as a " + - ((Platform.getNativeBits() == 32) ? "64-bit" : "32-bit") + " application."); + err.println("A library used by this sketch relies on native code that is not available."); + err.println(message); } else if (exceptionClass.equals("java.lang.StackOverflowError")) { listener.statusError("StackOverflowError: This sketch is attempting too much recursion."); @@ -791,9 +777,9 @@ public class Runner implements MessageConsumer { } - // TODO: This may be called more than one time per error in the VM, - // presumably because exceptions might be wrapped inside others, - // and this will fire for both. + // TODO This may be called more than one time per error in the VM, + // presumably because exceptions may be wrapped inside others, + // and this will fire for both. protected void reportException(String message, ObjectReference or, ThreadReference thread) { listener.statusError(findException(message, or, thread)); } diff --git a/todo.txt b/todo.txt index 5d81830fe..7ae32f040 100755 --- a/todo.txt +++ b/todo.txt @@ -80,9 +80,6 @@ known issues _ IDE cursor position is wrong if font size is changed in preferences on macOS _ probably related to second displays, need to hook one up and test _ https://github.com/processing/processing4/issues/194 -_ Export to Application not working with the current video library -_ https://github.com/processing/processing-video/issues/188 -_ docs are 3.x not 4.x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . @@ -173,9 +170,9 @@ _ https://fonts.google.com/specimen/Space+Grotesk windows/scaling -_ include JNA so that sketches can also scale properly? -_ what happens re: getting scaled/high-res graphics? -_ make that a preference? (and double the size by default?) +X include JNA so that sketches can also scale properly? +X what happens re: getting scaled/high-res graphics? +X make that a preference? (and double the size by default?) _ pixelDensity() not working in exported Windows applications _ https://github.com/processing/processing/issues/5414#issuecomment-841088518 _ was looking crunchy on low-dpi screen set to 125% @@ -205,10 +202,13 @@ _ https://github.com/processing/processing4/issues/304 before 4.x final +_ Export to Application not working with the current video library +_ https://github.com/processing/processing-video/issues/188 +_ docs are 3.x not 4.x _ Apple Silicon support _ https://github.com/processing/processing4/issues/128 _ clean up dist: 'bin' and 'src' from Java Mode are included, iml files, etc -_ SVG library, show a warning when using style instead of presentation attributes +_ loadShape(), show a warning when using style instead of presentation attributes _ Welcome screen or not? _ set a new preference for it, so people see it _ just skip the welcome screen on Windows hidpi dipslays? @@ -228,6 +228,7 @@ _ or at least avoid the multiple platforms +_ https://github.com/processing/processing4/wiki/Supported-Platforms _ final supported platforms _ as far as adoptium is concerned: _ macos-x64, macos-aarch64 (m1), windows-x64, linux-x64, linux-arm32 (rpi)