@@ -254,7 +254,7 @@ public void handleDeleteCode() throws IOException {
254
254
editor .base .handleClose (editor );
255
255
} else {
256
256
// delete the file
257
- if (!current .delete (BaseNoGui . getBuildFolder ( sketch ).toPath ())) {
257
+ if (!current .delete (sketch . getBuildPath ( ).toPath ())) {
258
258
Base .showMessage (tr ("Couldn't do it" ),
259
259
I18n .format (tr ("Could not delete \" {0}\" ." ), current .getFileName ()));
260
260
return ;
@@ -615,43 +615,6 @@ private void importLibrary(File jarPath) throws IOException {
615
615
editor .getCurrentTab ().setSelection (0 , 0 ); // scroll to start
616
616
}
617
617
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
-
655
618
/**
656
619
* Preprocess and compile all the code for this sketch.
657
620
*
@@ -661,7 +624,7 @@ public String build(boolean verbose, boolean save) throws RunnerException, Prefe
661
624
*
662
625
* @return null if compilation failed, main class name if not
663
626
*/
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 {
665
628
// run the preprocessor
666
629
editor .status .progressUpdate (20 );
667
630
@@ -679,7 +642,7 @@ private String build(String buildPath, boolean verbose, boolean save) throws Run
679
642
}
680
643
681
644
try {
682
- return new Compiler (pathToSketch , sketch , buildPath ).build (progressListener , save );
645
+ return new Compiler (pathToSketch , sketch ).build (progressListener , save );
683
646
} finally {
684
647
// Make sure we clean up any temporary sketch copy
685
648
if (deleteTemp )
@@ -698,20 +661,13 @@ private File saveSketchInTempFolder() throws IOException {
698
661
return Paths .get (tempFolder .getAbsolutePath (), sketch .getPrimaryFile ().getFileName ()).toFile ();
699
662
}
700
663
701
- protected boolean exportApplet (boolean usingProgrammer ) throws Exception {
702
- return exportApplet (BaseNoGui .getBuildFolder (sketch ).getAbsolutePath (), usingProgrammer );
703
- }
704
-
705
-
706
664
/**
707
665
* Handle export to applet.
708
666
*/
709
- private boolean exportApplet (String appletPath , boolean usingProgrammer )
710
- throws Exception {
711
-
667
+ protected boolean exportApplet (boolean usingProgrammer ) throws Exception {
712
668
// build the sketch
713
669
editor .status .progressNotice (tr ("Compiling sketch..." ));
714
- String foundName = build (appletPath , false , false );
670
+ String foundName = build (false , false );
715
671
// (already reported) error during export, exit this function
716
672
if (foundName == null ) return false ;
717
673
@@ -725,12 +681,12 @@ private boolean exportApplet(String appletPath, boolean usingProgrammer)
725
681
// }
726
682
727
683
editor .status .progressNotice (tr ("Uploading..." ));
728
- boolean success = upload (appletPath , foundName , usingProgrammer );
684
+ boolean success = upload (foundName , usingProgrammer );
729
685
editor .status .progressUpdate (100 );
730
686
return success ;
731
687
}
732
688
733
- private boolean upload (String buildPath , String suggestedClassName , boolean usingProgrammer ) throws Exception {
689
+ private boolean upload (String suggestedClassName , boolean usingProgrammer ) throws Exception {
734
690
735
691
Uploader uploader = new UploaderUtils ().getUploaderByPreferences (false );
736
692
@@ -751,7 +707,7 @@ private boolean upload(String buildPath, String suggestedClassName, boolean usin
751
707
752
708
List <String > warningsAccumulator = new LinkedList <>();
753
709
try {
754
- success = new UploaderUtils ().upload (sketch , uploader , buildPath , suggestedClassName , usingProgrammer , false , warningsAccumulator );
710
+ success = new UploaderUtils ().upload (sketch , uploader , suggestedClassName , usingProgrammer , false , warningsAccumulator );
755
711
} finally {
756
712
if (uploader .requiresAuthorization () && !success ) {
757
713
PreferencesData .remove (uploader .getAuthorizationKey ());
0 commit comments