MyTaskListManager myHandler = new MyTaskListManager();
long endTime;
boolean buildNextFresh;
+ File tempDir;
/**
* Clients call this before repeatCommand as a one-shot
setup(args);
myHandler.start();
long startTime = System.currentTimeMillis();
- Ajde.getDefault().getBuildManager().buildFresh();
- // System.err.println("compiling " + Arrays.asList(args));
- waitForCompletion(startTime);
- myHandler.finish(handler);
+ try {
+ Ajde.getDefault().getBuildManager().buildFresh();
+ // System.err.println("compiling " + Arrays.asList(args));
+ waitForCompletion(startTime);
+ } finally {
+ myHandler.finish(handler);
+ runCommandCleanup();
+ }
return !myHandler.hasError();
}
myHandler.finish(handler);
return !myHandler.hasError();
}
+ void runCommandCleanup() {
+ if (null != tempDir) {
+ FileUtil.deleteContents(tempDir);
+ tempDir.delete();
+ }
+ }
// set by build progress monitor when done
void setEndTime(long endTime) {
}
private File writeConfig(String[] args) {
- File result = new File(FileUtil.getTempDir("CompileCommand"), "config.lst");
+ tempDir = FileUtil.getTempDir("CompileCommand");
+ File result = new File(tempDir, "config.lst");
OutputStream out = null;
try {
out = new FileOutputStream(result);