@@ -253,7 +253,7 @@ public void handleDeleteCode() throws IOException {
253253 editor .base .handleClose (editor );
254254 } else {
255255 // delete the file
256- if (!current .delete (BaseNoGui . getBuildFolder ( sketch ).toPath ())) {
256+ if (!current .delete (sketch . getBuildPath ( ).toPath ())) {
257257 Base .showMessage (tr ("Couldn't do it" ),
258258 I18n .format (tr ("Could not delete \" {0}\" ." ), current .getFileName ()));
259259 return ;
@@ -614,43 +614,6 @@ public void importLibrary(UserLibrary lib) throws IOException {
614614 editor .getCurrentTab ().setSelection (0 , 0 ); // scroll to start
615615 }
616616
617- /**
618- * Preprocess, Compile, and Run the current code.
619- * <P>
620- * There are three main parts to this process:
621- * <PRE>
622- * (0. if not java, then use another 'engine'.. i.e. python)
623- *
624- * 1. do the p5 language preprocessing
625- * this creates a working .java file in a specific location
626- * better yet, just takes a chunk of java code and returns a
627- * new/better string editor can take care of saving this to a
628- * file location
629- *
630- * 2. compile the code from that location
631- * catching errors along the way
632- * placing it in a ready classpath, or .. ?
633- *
634- * 3. run the code
635- * needs to communicate location for window
636- * and maybe setup presentation space as well
637- * run externally if a code folder exists,
638- * or if more than one file is in the project
639- *
640- * X. afterwards, some of these steps need a cleanup function
641- * </PRE>
642- */
643- //protected String compile() throws RunnerException {
644-
645- /**
646- * Run the build inside the temporary build folder.
647- * @return null if compilation failed, main class name if not
648- * @throws RunnerException
649- */
650- public String build (boolean verbose , boolean save ) throws RunnerException , PreferencesMapException , IOException {
651- return build (BaseNoGui .getBuildFolder (sketch ).getAbsolutePath (), verbose , save );
652- }
653-
654617 /**
655618 * Preprocess and compile all the code for this sketch.
656619 *
@@ -660,7 +623,7 @@ public String build(boolean verbose, boolean save) throws RunnerException, Prefe
660623 *
661624 * @return null if compilation failed, main class name if not
662625 */
663- private String build (String buildPath , boolean verbose , boolean save ) throws RunnerException , PreferencesMapException , IOException {
626+ public String build (boolean verbose , boolean save ) throws RunnerException , PreferencesMapException , IOException {
664627 // run the preprocessor
665628 editor .status .progressUpdate (20 );
666629
@@ -678,7 +641,7 @@ private String build(String buildPath, boolean verbose, boolean save) throws Run
678641 }
679642
680643 try {
681- return new Compiler (pathToSketch , sketch , buildPath ).build (progressListener , save );
644+ return new Compiler (pathToSketch , sketch ).build (progressListener , save );
682645 } finally {
683646 // Make sure we clean up any temporary sketch copy
684647 if (deleteTemp )
@@ -697,20 +660,13 @@ private File saveSketchInTempFolder() throws IOException {
697660 return Paths .get (tempFolder .getAbsolutePath (), sketch .getPrimaryFile ().getFileName ()).toFile ();
698661 }
699662
700- protected boolean exportApplet (boolean usingProgrammer ) throws Exception {
701- return exportApplet (BaseNoGui .getBuildFolder (sketch ).getAbsolutePath (), usingProgrammer );
702- }
703-
704-
705663 /**
706664 * Handle export to applet.
707665 */
708- private boolean exportApplet (String appletPath , boolean usingProgrammer )
709- throws Exception {
710-
666+ protected boolean exportApplet (boolean usingProgrammer ) throws Exception {
711667 // build the sketch
712668 editor .status .progressNotice (tr ("Compiling sketch..." ));
713- String foundName = build (appletPath , false , false );
669+ String foundName = build (false , false );
714670 // (already reported) error during export, exit this function
715671 if (foundName == null ) return false ;
716672
@@ -724,12 +680,12 @@ private boolean exportApplet(String appletPath, boolean usingProgrammer)
724680// }
725681
726682 editor .status .progressNotice (tr ("Uploading..." ));
727- boolean success = upload (appletPath , foundName , usingProgrammer );
683+ boolean success = upload (foundName , usingProgrammer );
728684 editor .status .progressUpdate (100 );
729685 return success ;
730686 }
731687
732- private boolean upload (String buildPath , String suggestedClassName , boolean usingProgrammer ) throws Exception {
688+ private boolean upload (String suggestedClassName , boolean usingProgrammer ) throws Exception {
733689
734690 UploaderUtils uploaderInstance = new UploaderUtils ();
735691 Uploader uploader = uploaderInstance .getUploaderByPreferences (false );
@@ -751,7 +707,7 @@ private boolean upload(String buildPath, String suggestedClassName, boolean usin
751707
752708 List <String > warningsAccumulator = new LinkedList <>();
753709 try {
754- success = uploaderInstance .upload (sketch , uploader , buildPath , suggestedClassName , usingProgrammer , false , warningsAccumulator );
710+ success = uploaderInstance .upload (sketch , uploader , suggestedClassName , usingProgrammer , false , warningsAccumulator );
755711 } finally {
756712 if (uploader .requiresAuthorization () && !success ) {
757713 PreferencesData .remove (uploader .getAuthorizationKey ());
0 commit comments