mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-30 16:24:09 +03:00
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.
This commit is contained in:
@ -711,21 +711,26 @@ public class Compiler implements MessageConsumer {
|
|||||||
// Delete the .a file, to prevent any previous code from lingering
|
// Delete the .a file, to prevent any previous code from lingering
|
||||||
afile.delete();
|
afile.delete();
|
||||||
|
|
||||||
for (File file : coreObjectFiles) {
|
try {
|
||||||
|
for (File file : coreObjectFiles) {
|
||||||
|
|
||||||
PreferencesMap dict = new PreferencesMap(prefs);
|
PreferencesMap dict = new PreferencesMap(prefs);
|
||||||
dict.put("ide_version", "" + Base.REVISION);
|
dict.put("ide_version", "" + Base.REVISION);
|
||||||
dict.put("archive_file", afile.getName());
|
dict.put("archive_file", afile.getName());
|
||||||
dict.put("object_file", file.getAbsolutePath());
|
dict.put("object_file", file.getAbsolutePath());
|
||||||
|
|
||||||
String[] cmdArray;
|
String[] cmdArray;
|
||||||
try {
|
try {
|
||||||
String cmd = prefs.get("recipe.ar.pattern");
|
String cmd = prefs.get("recipe.ar.pattern");
|
||||||
cmdArray = StringReplacer.formatAndSplit(cmd, dict, true);
|
cmdArray = StringReplacer.formatAndSplit(cmd, dict, true);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RunnerException(e);
|
throw new RunnerException(e);
|
||||||
|
}
|
||||||
|
execAsynchronously(cmdArray);
|
||||||
}
|
}
|
||||||
execAsynchronously(cmdArray);
|
} catch (RunnerException e) {
|
||||||
|
afile.delete();
|
||||||
|
throw e;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (variantFolder != null)
|
if (variantFolder != null)
|
||||||
|
Reference in New Issue
Block a user