Skip to content

Commit 87c87c2

Browse files
Delete core.a when building it fails
This prevents a half-finished core.a file from lingering around. Currently, this should not make a difference since core.a is rebuilt every time, but this prepares for skipping this build step if possible.
1 parent 57bdacc commit 87c87c2

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

app/src/processing/app/debug/Compiler.java

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -711,21 +711,26 @@ void compileCore()
711711
// Delete the .a file, to prevent any previous code from lingering
712712
afile.delete();
713713

714-
for (File file : coreObjectFiles) {
715-
716-
PreferencesMap dict = new PreferencesMap(prefs);
717-
dict.put("ide_version", "" + Base.REVISION);
718-
dict.put("archive_file", afile.getName());
719-
dict.put("object_file", file.getAbsolutePath());
720-
721-
String[] cmdArray;
722-
try {
723-
String cmd = prefs.get("recipe.ar.pattern");
724-
cmdArray = StringReplacer.formatAndSplit(cmd, dict, true);
725-
} catch (Exception e) {
726-
throw new RunnerException(e);
714+
try {
715+
for (File file : coreObjectFiles) {
716+
717+
PreferencesMap dict = new PreferencesMap(prefs);
718+
dict.put("ide_version", "" + Base.REVISION);
719+
dict.put("archive_file", afile.getName());
720+
dict.put("object_file", file.getAbsolutePath());
721+
722+
String[] cmdArray;
723+
try {
724+
String cmd = prefs.get("recipe.ar.pattern");
725+
cmdArray = StringReplacer.formatAndSplit(cmd, dict, true);
726+
} catch (Exception e) {
727+
throw new RunnerException(e);
728+
}
729+
execAsynchronously(cmdArray);
727730
}
728-
execAsynchronously(cmdArray);
731+
} catch (RunnerException e) {
732+
afile.delete();
733+
throw e;
729734
}
730735

731736
if (variantFolder != null)

0 commit comments

Comments
 (0)