(JavaBuild build, RunnerListener listener)
| 84 | |
| 85 | |
| 86 | public Runner(JavaBuild build, RunnerListener listener) throws SketchException { |
| 87 | this.listener = listener; |
| 88 | // this.sketch = sketch; |
| 89 | this.build = build; |
| 90 | |
| 91 | checkLocalHost(); |
| 92 | |
| 93 | if (listener instanceof JavaEditor) { |
| 94 | this.editor = (JavaEditor) listener; |
| 95 | sketchErr = editor.getConsole().getErr(); |
| 96 | sketchOut = editor.getConsole().getOut(); |
| 97 | } else { |
| 98 | sketchErr = System.err; |
| 99 | sketchOut = System.out; |
| 100 | } |
| 101 | |
| 102 | // Make sure all the imported libraries will actually run with this setup. |
| 103 | int bits = Platform.getNativeBits(); |
| 104 | String variant = Platform.getVariant(); |
| 105 | |
| 106 | for (Library library : build.getImportedLibraries()) { |
| 107 | if (!library.supportsArch(PApplet.platform, variant)) { |
| 108 | sketchErr.println(library.getName() + " does not run on this architecture: " + variant); |
| 109 | int opposite = (bits == 32) ? 64 : 32; |
| 110 | if (Platform.isMacOS()) { |
| 111 | //if (library.supportsArch(PConstants.MACOSX, opposite)) { // should always be true |
| 112 | throw new SketchException("To use " + library.getName() + ", " + |
| 113 | "switch to " + opposite + "-bit mode in Preferences."); |
| 114 | //} |
| 115 | } else { |
| 116 | throw new SketchException(library.getName() + " is only compatible " + |
| 117 | "with the " + opposite + "-bit download of Processing."); |
| 118 | //throw new SketchException(library.getName() + " does not run in " + bits + "-bit mode."); |
| 119 | // "To use this library, switch to 32-bit mode in Preferences." (OS X) |
| 120 | // "To use this library, you must use the 32-bit version of Processing." |
| 121 | } |
| 122 | } |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | |
| 127 | /** |
nothing calls this directly
no test coverage detected