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,6 +711,7 @@ 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();
try {
for (File file : coreObjectFiles) { for (File file : coreObjectFiles) {
PreferencesMap dict = new PreferencesMap(prefs); PreferencesMap dict = new PreferencesMap(prefs);
@ -727,6 +728,10 @@ public class Compiler implements MessageConsumer {
} }
execAsynchronously(cmdArray); execAsynchronously(cmdArray);
} }
} catch (RunnerException e) {
afile.delete();
throw e;
}
if (variantFolder != null) if (variantFolder != null)
objectFiles.addAll(compileFiles(buildFolder, variantFolder, true, objectFiles.addAll(compileFiles(buildFolder, variantFolder, true,