diff options
author | qouyang <qouyang@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-09-20 06:21:04 +0000 |
---|---|---|
committer | qouyang <qouyang@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-09-20 06:21:04 +0000 |
commit | 34a0c84476d23d14ddfea559276b2960b6c68c08 (patch) | |
tree | 342cbf6ebdabff19b1cf3fe6009c1c73cb54a001 /Tools | |
parent | 76c86b3ac42df05d2116346bb95cf9462eb2729c (diff) | |
download | edk2-platforms-34a0c84476d23d14ddfea559276b2960b6c68c08.tar.xz |
Delete the midterm temporary file which created by GenFFSFile task.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1576 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Tools')
-rw-r--r-- | Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/Tool.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/Tool.java b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/Tool.java index 0ef2a6ea7c..a7d28f5e7f 100644 --- a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/Tool.java +++ b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/Tool.java @@ -34,6 +34,7 @@ public class Tool implements EfiDefine, Section { private String toolName = "";
private ToolArg toolArgList = new ToolArg();
private Input inputFiles = new Input();
+ private Input tempInputFile = new Input();
private String outputPath;
private File outputFile ;
private List<Section> gensectList = new ArrayList<Section>();
@@ -93,6 +94,7 @@ public class Tool implements EfiDefine, Section { if (fs != null) {
fs.close();
}
+ outputFile.delete();
} catch (Exception e) {
EdkLog.log("WARNING: Cannot close " + outputFile.getPath());
}
@@ -133,7 +135,7 @@ public class Tool implements EfiDefine, Section { throw new BuildException ("GenSection failed at Tool!");
}
Do.close();
- this.inputFiles.insFile(outputFile.getPath());
+ this.tempInputFile.insFile(outputFile.getPath());
}
} catch (IOException e){
throw new BuildException ("Gensection failed at tool!");
@@ -142,13 +144,20 @@ public class Tool implements EfiDefine, Section { try {
outputFile = File.createTempFile("temp", null, new File(outputPath));
argument = toolArgList + inputFiles.toStringWithSinglepPrefix(" -i ")
- + " -o " + outputFile.getPath();
+ + tempInputFile.toString(" ")+ " -o " + outputFile.getPath();
EdkLog.log(this, EdkLog.EDK_VERBOSE, command + " " + argument);
///
/// execute command line
///
Process process = Runtime.getRuntime().exec(command + " " + argument);
process.waitFor();
+ Iterator tempFile = tempInputFile.getNameList().iterator();
+ while (tempFile.hasNext()){
+ File file = new File((String)tempFile.next());
+ if (file.exists()) {
+ file.delete();
+ }
+ }
} catch (Exception e) {
EdkLog.log(e.getMessage());
throw new BuildException("Execution of externalTool task failed!\n");
|