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:
Matthijs Kooijman 2014-04-10 14:53:05 +02:00
parent 57bdacc93c
commit 87c87c2897
1 changed files with 17 additions and 12 deletions

View File

@ -711,21 +711,26 @@ public class Compiler implements MessageConsumer {
// Delete the .a file, to prevent any previous code from lingering
afile.delete();
for (File file : coreObjectFiles) {
try {
for (File file : coreObjectFiles) {
PreferencesMap dict = new PreferencesMap(prefs);
dict.put("ide_version", "" + Base.REVISION);
dict.put("archive_file", afile.getName());
dict.put("object_file", file.getAbsolutePath());
PreferencesMap dict = new PreferencesMap(prefs);
dict.put("ide_version", "" + Base.REVISION);
dict.put("archive_file", afile.getName());
dict.put("object_file", file.getAbsolutePath());
String[] cmdArray;
try {
String cmd = prefs.get("recipe.ar.pattern");
cmdArray = StringReplacer.formatAndSplit(cmd, dict, true);
} catch (Exception e) {
throw new RunnerException(e);
String[] cmdArray;
try {
String cmd = prefs.get("recipe.ar.pattern");
cmdArray = StringReplacer.formatAndSplit(cmd, dict, true);
} catch (Exception e) {
throw new RunnerException(e);
}
execAsynchronously(cmdArray);
}
execAsynchronously(cmdArray);
} catch (RunnerException e) {
afile.delete();
throw e;
}
if (variantFolder != null)