Skip to content

Commit dc2e909

Browse files
committed
Copy Hex File as Path and Show compilation folder: Sketch functions required for these 2 menu items
woops, forget again about the dependencies in the last commit :/
1 parent 248fb2f commit dc2e909

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

Diff for: app/src/processing/app/Sketch.java

+25-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
*/
5353
public class Sketch {
5454
static private File tempBuildFolder;
55-
55+
private String lastPrimaryClassName;
5656
private Editor editor;
5757

5858
/** main pde file for this sketch. */
@@ -1620,6 +1620,7 @@ public String build(String buildPath, boolean verbose)
16201620
// run the preprocessor
16211621
editor.status.progressUpdate(20);
16221622
String primaryClassName = preprocess(buildPath);
1623+
lastPrimaryClassName = primaryClassName;
16231624

16241625
// compile the program. errors will happen as a RunnerException
16251626
// that will bubble up to whomever called build().
@@ -1720,7 +1721,29 @@ protected String upload(String buildPath, String suggestedClassName, boolean usi
17201721

17211722
return success ? suggestedClassName : null;
17221723
}
1723-
1724+
1725+
/**
1726+
* Uses last primary class name to try to get the hex file path.
1727+
*/
1728+
public String getSketchHexFilePath(boolean verifyFileExists)
1729+
{
1730+
String s = "";
1731+
1732+
if(lastPrimaryClassName!=null)
1733+
if(lastPrimaryClassName.length()>0)
1734+
s = tempBuildFolder.getAbsolutePath() + File.separator + lastPrimaryClassName + ".hex";
1735+
1736+
return s;
1737+
}
1738+
1739+
/**
1740+
* Retrieves the temporal build folder
1741+
*/
1742+
public File getTempBuildFolder()
1743+
{
1744+
return tempBuildFolder.getAbsoluteFile();
1745+
}
1746+
17241747
/**
17251748
* Replace all commented portions of a given String as spaces.
17261749
* Utility function used here and in the preprocessor.

0 commit comments

Comments
 (0)