(JavaBuild build, RunnerListener listener)
| 84 | |
| 85 | |
| 86 | public Runner(JavaBuild build, RunnerListener listener) throws SketchException { |
| 87 | this.listener = listener; |
| 88 | this.build = build; |
| 89 | |
| 90 | checkLocalHost(); |
| 91 | |
| 92 | if (listener instanceof RunnerListenerEdtAdapter) { |
| 93 | // RunnerListener gets wrapped so that it behaves on the EDT. |
| 94 | // Need to extract the wrapped Object and see if it's a Java Editor, |
| 95 | // in which case we'll be passing additional parameters to the PApplet. |
| 96 | // https://github.com/processing/processing/issues/5843 |
| 97 | RunnerListener wrapped = ((RunnerListenerEdtAdapter) listener).getWrapped(); |
| 98 | if (wrapped instanceof JavaEditor) { |
| 99 | editor = (JavaEditor) wrapped; |
| 100 | sketchErr = editor.getConsole().getErr(); |
| 101 | sketchOut = editor.getConsole().getOut(); |
| 102 | } |
| 103 | } |
| 104 | // If it's not a JavaEditor, then we don't redirect to a console. |
| 105 | if (editor == null) { |
| 106 | sketchErr = System.err; |
| 107 | sketchOut = System.out; |
| 108 | } |
| 109 | |
| 110 | // Make sure all the imported libraries will actually run with this setup. |
| 111 | // int bits = Platform.getNativeBits(); |
| 112 | String variant = Platform.getVariant(); |
| 113 | for (Library library : build.getImportedLibraries()) { |
| 114 | if (library.isUnsupported(variant)) { |
| 115 | sketchErr.println(library.getName() + " does not run on this architecture: " + variant); |
| 116 | } |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | |
| 121 | /** |
nothing calls this directly
no test coverage detected