(String[] args)
| 88 | |
| 89 | |
| 90 | public Commander(String[] args) { |
| 91 | String sketchPath = null; |
| 92 | File sketchFolder = null; |
| 93 | String pdePath = null; // path to the .pde file |
| 94 | String outputPath = null; |
| 95 | File outputFolder = null; |
| 96 | boolean outputSet = false; // set an output folder |
| 97 | boolean force = false; // replace that no good output folder |
| 98 | // String preferencesPath = null; |
| 99 | int platform = PApplet.platform; // default to this platform |
| 100 | // int platformBits = Base.getNativeBits(); |
| 101 | int task = HELP; |
| 102 | boolean embedJava = true; |
| 103 | |
| 104 | try { |
| 105 | if (Platform.isWindows()) { |
| 106 | // On Windows, it needs to use the default system encoding. |
| 107 | // https://github.com/processing/processing/issues/1633 |
| 108 | systemOut = new PrintStream(System.out, true); |
| 109 | systemErr = new PrintStream(System.err, true); |
| 110 | } else { |
| 111 | // On OS X, the output goes as MacRoman or something else useless. |
| 112 | // http://code.google.com/p/processing/issues/detail?id=1418 |
| 113 | // (Not sure about Linux, but this has worked since 2.0) |
| 114 | systemOut = new PrintStream(System.out, true, "UTF-8"); |
| 115 | systemErr = new PrintStream(System.err, true, "UTF-8"); |
| 116 | } |
| 117 | } catch (UnsupportedEncodingException e) { |
| 118 | e.printStackTrace(); |
| 119 | System.exit(1); |
| 120 | } |
| 121 | |
| 122 | int argOffset = 0; |
| 123 | for (String arg : args) { |
| 124 | argOffset++; |
| 125 | |
| 126 | if (arg.length() == 0) { |
| 127 | // ignore it, just the crappy shell script |
| 128 | |
| 129 | } else if (arg.equals(helpArg)) { |
| 130 | // mode already set to HELP |
| 131 | |
| 132 | // } else if (arg.equals(preprocArg)) { |
| 133 | // task = PREPROCESS; |
| 134 | |
| 135 | } else if (arg.equals(buildArg)) { |
| 136 | task = BUILD; |
| 137 | break; |
| 138 | |
| 139 | } else if (arg.equals(runArg)) { |
| 140 | task = RUN; |
| 141 | break; |
| 142 | |
| 143 | } else if (arg.equals(presentArg)) { |
| 144 | task = PRESENT; |
| 145 | break; |
| 146 | |
| 147 | } else if (arg.equals(exportApplicationArg)) { |
nothing calls this directly
no test coverage detected