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