summaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorwisberg <wisberg>2003-05-09 22:57:24 +0000
committerwisberg <wisberg>2003-05-09 22:57:24 +0000
commit0b4a9bbfe1153c5ae326b4d05292e21a89cb3f40 (patch)
tree50ccdef80c16f377ec9da92de74c58de5d58ef6c /testing
parent84908b0fb71ad81f0a63f0b19f53af6bb9138558 (diff)
downloadaspectj-0b4a9bbfe1153c5ae326b4d05292e21a89cb3f40.tar.gz
aspectj-0b4a9bbfe1153c5ae326b4d05292e21a89cb3f40.zip
Deleting temporary dir and config file, like harness -killTemp option (ignores -keepTemp)
Diffstat (limited to 'testing')
-rw-r--r--testing/src/org/aspectj/testing/ajde/CompileCommand.java22
1 files changed, 17 insertions, 5 deletions
diff --git a/testing/src/org/aspectj/testing/ajde/CompileCommand.java b/testing/src/org/aspectj/testing/ajde/CompileCommand.java
index e9d75466a..a33ac06ce 100644
--- a/testing/src/org/aspectj/testing/ajde/CompileCommand.java
+++ b/testing/src/org/aspectj/testing/ajde/CompileCommand.java
@@ -38,6 +38,7 @@ public class CompileCommand implements ICommand {
MyTaskListManager myHandler = new MyTaskListManager();
long endTime;
boolean buildNextFresh;
+ File tempDir;
/**
* Clients call this before repeatCommand as a one-shot
@@ -53,10 +54,14 @@ public class CompileCommand implements ICommand {
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();
}
@@ -74,6 +79,12 @@ public class CompileCommand implements ICommand {
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) {
@@ -145,7 +156,8 @@ public class CompileCommand implements ICommand {
}
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);