@@ -1312,11 +1312,11 @@ public void prepare() throws IOException {
1312
1312
* @param buildPath Location to copy all the .java files
1313
1313
* @return null if compilation failed, main class name if not
1314
1314
*/
1315
- public String preprocess (String buildPath ) throws RunnerException {
1316
- return preprocess (buildPath , new PdePreprocessor ());
1315
+ public void preprocess (String buildPath ) throws RunnerException {
1316
+ preprocess (buildPath , new PdePreprocessor ());
1317
1317
}
1318
1318
1319
- public String preprocess (String buildPath , PdePreprocessor preprocessor ) throws RunnerException {
1319
+ public void preprocess (String buildPath , PdePreprocessor preprocessor ) throws RunnerException {
1320
1320
// make sure the user didn't hide the sketch folder
1321
1321
ensureExistence ();
1322
1322
@@ -1372,18 +1372,12 @@ public String preprocess(String buildPath, PdePreprocessor preprocessor) throws
1372
1372
// 2. run preproc on that code using the sugg class name
1373
1373
// to create a single .java file and write to buildpath
1374
1374
1375
- String primaryClassName = null ;
1376
-
1377
1375
try {
1378
1376
// Output file
1379
1377
File streamFile = new File (buildPath , name + ".cpp" );
1380
1378
FileOutputStream outputStream = new FileOutputStream (streamFile );
1381
1379
preprocessor .write (outputStream );
1382
1380
outputStream .close ();
1383
-
1384
- // store this for the compiler and the runtime
1385
- primaryClassName = name + ".cpp" ;
1386
-
1387
1381
} catch (FileNotFoundException fnfe ) {
1388
1382
fnfe .printStackTrace ();
1389
1383
String msg = _ ("Build folder disappeared or could not be written" );
@@ -1432,7 +1426,6 @@ public String preprocess(String buildPath, PdePreprocessor preprocessor) throws
1432
1426
sc .addPreprocOffset (headerOffset );
1433
1427
}
1434
1428
}
1435
- return primaryClassName ;
1436
1429
}
1437
1430
1438
1431
@@ -1538,7 +1531,8 @@ public String build(boolean verbose) throws RunnerException {
1538
1531
public String build (String buildPath , boolean verbose ) throws RunnerException {
1539
1532
// run the preprocessor
1540
1533
editor .status .progressUpdate (20 );
1541
- String primaryClassName = preprocess (buildPath );
1534
+ String primaryClassName = name + ".cpp" ;
1535
+ preprocess (buildPath );
1542
1536
1543
1537
// compile the program. errors will happen as a RunnerException
1544
1538
// that will bubble up to whomever called build().
0 commit comments