1) Applied ToolArg and FileArg class to represent tool arguments

2) Unified the tool output message and exception handling
3) Cleaned the coding style
4) Removed used code

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1535 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jwang36
2006-09-14 08:35:38 +00:00
parent 39e5e412f9
commit 0fdb42ac46
23 changed files with 1588 additions and 1712 deletions

View File

@@ -15,6 +15,7 @@ package org.tianocore.build.global;
import org.apache.tools.ant.types.DataType;
import org.apache.tools.ant.types.Path;
import org.apache.tools.ant.BuildException;
import java.io.File;
import java.io.FileReader;
@@ -77,7 +78,7 @@ public class DpFile extends DataType {
lineReader.close();
fileReader.close();
} catch (IOException e) {
System.out.println (e.getMessage());
throw new BuildException(e.getMessage());
}
}

View File

@@ -50,7 +50,7 @@ public class ConfigReader {
@return String[][] The variables defined in the config file
@throws EdkException
@throws GenBuildException
Config file's format is not valid
**/
public static synchronized String[][] parse(File configFile) throws GenBuildException {
@@ -78,7 +78,8 @@ public class ConfigReader {
//
int index;
if ((index = str.indexOf('=')) <= 0) {
throw new GenBuildException("ERROR Processing file [" + configFile.getAbsolutePath()
throw new GenBuildException("ERROR Processing file ["
+ configFile.getAbsolutePath()
+ "] (line " + lines + ").\n");
}
@@ -88,9 +89,12 @@ public class ConfigReader {
keyList.add(str.substring(0, index).trim());
valueList.add(str.substring(index + 1).trim());
}
} catch (Exception e) {
throw new GenBuildException("ERROR Processing file [" + configFile.getAbsolutePath()
+ "] (line " + lines + ").\n" + e.getMessage());
} catch (Exception ex) {
GenBuildException e = new GenBuildException("ERROR Processing file ["
+ configFile.getAbsolutePath()
+ "] (line " + lines + ").\n" + ex.getMessage());
e.setStackTrace(ex.getStackTrace());
throw e;
}
String[][] definitions = new String[2][keyList.size()];