add some features:

1. display current settings in target.txt by ContextTool
2. display help information with arguments, such as: ContextTool -h, arguments include -h, /h, -?, /?, -help, /help
3. display current setting by ContextTool -x
4. display possible setting by ContextTool -x ?
5. clean current setting by ContextTool -x 0
6. merge new setting to current setting by ContextTool -x new
x is the setting argument, such as p, a, n, m, t, c.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1746 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jjin9 2006-10-14 08:22:12 +00:00
parent 9c0e70cb4a
commit f337986f8e
4 changed files with 328 additions and 77 deletions

View File

@ -16,11 +16,28 @@ public class ContextMain {
public static void main(String[] args) { public static void main(String[] args) {
if (TargetFile.validateFilename("target.txt") == false) {
System.out.printf("%n%s", "Target.txt can't be found in WorkSpace. Please check it!");
System.exit(0);
}
if(ParseParameter.checkParameter(args) == false){ if(ParseParameter.checkParameter(args) == false){
System.exit(0); System.exit(0);
} }
if (TargetFile.parsePath("target.txt") == false) { if (TargetFile.readFile() == false){
System.exit(0);
}
if (ParseParameter.standardizeParameter(args) > 0){
System.exit(0);
}
if (TargetFile.createTempFile("target.txt") == false){
System.exit(0);
}
if (TargetFile.readwriteFile() == false){
System.exit(0); System.exit(0);
} }

View File

@ -102,7 +102,7 @@ public class HelpInfo {
private static final String AString = "-a <list of Arch>"; private static final String AString = "-a <list of Arch>";
private static final String AStringInfo = "what kind of architechure is the binary target, such as IA32, IA64, X64, EBC, or ARM. Multiple values can be specified on a single line, using space to separate the values."; private static final String AStringInfo = "What kind of architechure is the binary target, such as IA32, IA64, X64, EBC, or ARM. Multiple values can be specified on a single line, using space to separate the values.";
private static final String CString = "-c <tool_definition_file.txt>"; private static final String CString = "-c <tool_definition_file.txt>";
@ -122,7 +122,7 @@ public class HelpInfo {
private static final String MString = "-m <num of Threads>"; private static final String MString = "-m <num of Threads>";
private static final String MStringInfo = "number should GE 0. 0 clears both MULTIPLE_THREAD and MAX_CONCURRENT_THREAD_NUMBER, others enable MULTIPLE_THREAD and set MAX_CONCURRENT_THREAD_NUMBER."; private static final String MStringInfo = "The number of concurrent threads. Default is 2. Recommend to set this value to one more than the number of your compurter cores or CPUs. 0 will disable MULTIPLE_THREAD and clean MAX_CONCURRENT_THREAD_NUMBER.";
private static final String[] UsageString = { HString, AString, CString, private static final String[] UsageString = { HString, AString, CString,
NString, PString, TString, MString }; NString, PString, TString, MString };

View File

@ -24,24 +24,31 @@ public class ParseParameter {
public static boolean checkParameter(String[] args) { public static boolean checkParameter(String[] args) {
if(args.length == 0){ if(args.length == 0){
HelpInfo.outputUsageInfo(); TargetFile.readFile();
outputCurSetting();
return false; return false;
} else { } else {
if( args[0].charAt(0) != '-' ){ if( (args[0].compareToIgnoreCase("-h") == 0) || (args[0].compareToIgnoreCase("/h") == 0) ||
(args[0].compareToIgnoreCase("-?") == 0) || (args[0].compareToIgnoreCase("/?") == 0) ||
(args[0].compareToIgnoreCase("-help") == 0) || (args[0].compareToIgnoreCase("/help") == 0) ){
HelpInfo.outputUsageInfo(); HelpInfo.outputUsageInfo();
return false; return false;
} }
if( args[0].charAt(0) != '-' ){
System.out.printf("%s\n", "Error arguments! Please type \"ContextTool -h\" for helpinfo.");
return false;
}
for(int i=0; i<args.length; i++){ for(int i=0; i<args.length; i++){
if( (args[i].compareToIgnoreCase("-h") == 0) || if( (args[i].startsWith("-") &&
(args[i].startsWith("-") && ((args[i].charAt(1) != 'a') && (args[i].charAt(1) != 'c') ((args[i].compareTo("-a") != 0) && (args[i].compareTo("-c") != 0) &&
&& (args[i].charAt(1) != 'n') && (args[i].charAt(1) != 'p') && (args[i].charAt(1) != 't') && (args[i].charAt(1) != 'm')))){ (args[i].compareTo("-n") != 0) && (args[i].compareTo("-p") != 0) &&
HelpInfo.outputUsageInfo(); (args[i].compareTo("-t") != 0) && (args[i].compareTo("-m") != 0)))){
System.out.printf("%s\n", "Error arguments! Please type \"ContextTool -h\" for helpinfo.");
return false; return false;
} }
} }
} }
standardizeParameter(args);
return true; return true;
} }
@ -50,12 +57,8 @@ public class ParseParameter {
* @param args -- user's input * @param args -- user's input
* @return no return value * @return no return value
**/ **/
private static void standardizeParameter(String[] args) { public static int standardizeParameter(String[] args) {
//
// the parameters's length are same.
//
length = pstr.length();
StringBuffer InputData = new StringBuffer(); StringBuffer InputData = new StringBuffer();
for (int i = 0; i < args.length; i++) { for (int i = 0; i < args.length; i++) {
@ -70,34 +73,138 @@ public class ParseParameter {
j = InputData.length(); j = InputData.length();
String argstr = InputData.substring(i, j); String argstr = InputData.substring(i, j);
i = j;
if (argstr.charAt(1) == 'p') { if (argstr.charAt(1) == 'p') {
pstr += argstr.substring(2); //
// pstr += "\n"; // argstr is "-p ", display current setting
//
if(argstr.length() < 4 && argstr.charAt(2) == ' '){
System.out.printf("%s\n", curpstr);
return 1;
}
//
//argstr is "-p ?", display possible setting
//
if(argstr.length() < 6 && argstr.charAt(3) == '?'){
System.out.printf( "%s\n", "assign the platform FPD file's relative path to WORKSPACE" );
return 2;
}
//
//argstr is "-p 0", clean current setting
//
if(argstr.length() < 6 && argstr.charAt(3) == '0'){
curpstr = pstr;
continue;
}
curpstr = mergeSetting(curpstr, argstr);
} else if (argstr.charAt(1) == 't') { } else if (argstr.charAt(1) == 't') {
tstr += argstr.substring(2); if(argstr.length() < 4 && argstr.charAt(2) == ' '){
// tstr += "\n"; System.out.printf("%s\n", curtstr);
return 1;
}
if(argstr.length() < 6 && argstr.charAt(3) == '?'){
System.out.printf( "%s\n", "What kind of the version is the binary target, such as DEBUG, RELEASE" );
return 2;
}
if(argstr.length() < 6 && argstr.charAt(3) == '0'){
curtstr = tstr;
continue;
}
curtstr = mergeSetting(curtstr, argstr);
} else if (argstr.charAt(1) == 'a') { } else if (argstr.charAt(1) == 'a') {
astr += argstr.substring(2); if(argstr.length() < 4 && argstr.charAt(2) == ' '){
// astr += "\n"; System.out.printf("%s\n", curastr);
return 1;
}
if(argstr.length() < 6 && argstr.charAt(3) == '?'){
System.out.printf( "%s\n", "What kind of architechure is the binary target, such as IA32, IA64, X64, EBC, or ARM" );
return 2;
}
if(argstr.length() < 6 && argstr.charAt(3) == '0'){
curastr = astr;
continue;
}
curastr = mergeSetting(curastr, argstr);
} else if (argstr.charAt(1) == 'c') { } else if (argstr.charAt(1) == 'c') {
cstr += argstr.substring(2); if(argstr.length() < 4 && argstr.charAt(2) == ' '){
// cstr += "\n"; System.out.printf("%s\n", curcstr);
return 1;
}
if(argstr.length() < 6 && argstr.charAt(3) == '?'){
System.out.printf( "%s\n", "Assign a txt file with the relative path to WORKSPACE, which specify the tools to use for the build and must be located in the path: WORKSPACE/Tools/Conf/" );
return 2;
}
if(argstr.length() < 6 && argstr.charAt(3) == '0'){
curcstr = cstr;
continue;
}
curcstr = mergeSetting(curcstr, argstr);
} else if (argstr.charAt(1) == 'n') { } else if (argstr.charAt(1) == 'n') {
nstr += argstr.substring(2); if(argstr.length() < 4 && argstr.charAt(2) == ' '){
// nstr += "\n"; System.out.printf("%s\n", curnstr);
return 1;
}
if(argstr.length() < 6 && argstr.charAt(3) == '?'){
System.out.printf( "%s\n", "Specify the TagName, such as GCC, MSFT" );
return 2;
}
if(argstr.length() < 6 && argstr.charAt(3) == '0'){
curnstr = nstr;
continue;
}
curnstr = mergeSetting(curnstr, argstr);
} else if (argstr.charAt(1) == 'm') { } else if (argstr.charAt(1) == 'm') {
if(argstr.length() < 4 && argstr.charAt(2) == ' '){
System.out.printf("%s\n", curmstr);
return 1;
}
if(argstr.length() < 6 && argstr.charAt(3) == '?'){
System.out.printf( "%s\n", "The number of concurrent threads. Default is 2. Recommend to set this value to one more than the number of your compurter cores or CPUs." );
return 2;
}
mstr += argstr.substring(2); mstr += argstr.substring(2);
// mstr += "\n"; curmstr = mstr;
if (argstr.charAt(3) == '0'){ if (argstr.charAt(3) == '0'){
mestr += " Disable"; mestr += " Disable";
} else { } else {
mestr += " Enable"; mestr += " Enable";
} }
} curmestr = mestr;
i = j; }
} }
return 0;
}
public static String mergeSetting( String S1, String S2){
String[] S = S2.split(" ");
if(S1 == null){
S1 = tstr.concat(S2.substring(2));
}else{
for(int i = 1; i < S.length; i++){
if( S1.contains(S[i]) == false ){
S1 = S1.concat(S[i]).concat(" ");
}
}
}
return S1;
}
public static boolean outputCurSetting(){
System.out.printf( "%s\n", "The current setting is:" );
System.out.printf( "%s\n", curpstr );
System.out.printf( "%s\n", curtstr );
System.out.printf( "%s\n", curastr );
System.out.printf( "%s\n", curcstr );
System.out.printf( "%s\n", curnstr );
System.out.printf( "%s\n", curmstr );
System.out.printf( "%s\n", curmestr );
return true;
} }
public static int length = 0; public static int length = 0;
@ -108,5 +215,21 @@ public class ParseParameter {
public static String nstr = new String("TOOL_CHAIN_TAG = "); public static String nstr = new String("TOOL_CHAIN_TAG = ");
public static String mstr = new String("MAX_CONCURRENT_THREAD_NUMBER = "); public static String mstr = new String("MAX_CONCURRENT_THREAD_NUMBER = ");
public static String mestr = new String("MULTIPLE_THREAD = "); public static String mestr = new String("MULTIPLE_THREAD = ");
public static String curpstr = null;
public static String curtstr = null;
public static String curastr = null;
public static String curcstr = null;
public static String curnstr = null;
public static String curmstr = null;
public static String curmestr = null;
public static int plength = 0;
public static int tlength = 0;
public static int alength = 0;
public static int clength = 0;
public static int nlength = 0;
public static int mlength = 0;
public static int melength = 0;
} }

View File

@ -30,7 +30,7 @@ public class TargetFile {
* @param String filename : the name of target file * @param String filename : the name of target file
* @return true or false * @return true or false
**/ **/
public static boolean parsePath(String filename) { public static boolean setFile(String filename) {
String workspacePath = System.getenv("WORKSPACE"); String workspacePath = System.getenv("WORKSPACE");
@ -55,17 +55,37 @@ public class TargetFile {
TargetFile.writeFile(Fd); TargetFile.writeFile(Fd);
return true; return true;
} }
/**
* validate the filename
* @param String filename : the name of target file
*
* @return true or false
**/
public static boolean validateFilename(String filename) {
String workspacePath = System.getenv("WORKSPACE");
Fd = new File(workspacePath + File.separator + "Tools" + File.separator + "Conf" + File.separator + filename);
if (Fd.exists() == true && Fd.canRead() == true)
return true;
else
return false;
}
/** /**
* create a empty temp file, which is located at the same directory with target file * create a empty temp file, which is located at the same directory with target file
* @param String filename : the name of target temp file * @param String filename : the name of target temp file
* @return true or false * @return true or false
**/ **/
private static boolean createTempFile(String filename) { public static boolean createTempFile(String filename) {
String workspacePath = System.getenv("WORKSPACE"); String workspacePath = System.getenv("WORKSPACE");
TempFd = new File(workspacePath + File.separator + "Tools" + File.separator + "Conf" + File.separator + filename); TempFd = new File(workspacePath + File.separator + "Tools" + File.separator + "Conf" + File.separator + filename + "tmp");
if (TempFd.exists() == true) { if (TempFd.exists() == true) {
if (TempFd.delete() == false) { if (TempFd.delete() == false) {
@ -89,7 +109,7 @@ public class TargetFile {
* @param no paremeter * @param no paremeter
* @return true or false * @return true or false
**/ **/
private static boolean readwriteFile() { public static boolean readwriteFile() {
if (Fd.canRead() != true) if (Fd.canRead() != true)
return false; return false;
@ -137,15 +157,15 @@ public class TargetFile {
if (textLine.indexOf("ACTIVE_PLATFORM") != -1) { if (textLine.indexOf("ACTIVE_PLATFORM") != -1) {
if(pflag == true){ if(pflag == true){
if(textLine.trim().charAt(0) == '#'){ if(textLine.trim().charAt(0) == '#'){
if(ParseParameter.pstr.length() > ParseParameter.length) { if(ParseParameter.curpstr.length() >= ParseParameter.plength) {
bw.write(ParseParameter.pstr); bw.write(ParseParameter.curpstr);
bw.newLine(); bw.newLine();
pflag = false; pflag = false;
} }
continue; continue;
} }
if(ParseParameter.pstr.length() > ParseParameter.length) { if(ParseParameter.curpstr.length() >= ParseParameter.plength) {
bw.write(ParseParameter.pstr); bw.write(ParseParameter.curpstr);
} else { } else {
bw.write(textLine); bw.write(textLine);
} }
@ -155,15 +175,15 @@ public class TargetFile {
} else if (textLine.indexOf("TARGET_ARCH") != -1) { } else if (textLine.indexOf("TARGET_ARCH") != -1) {
if(aflag == true){ if(aflag == true){
if(textLine.trim().charAt(0) == '#'){ if(textLine.trim().charAt(0) == '#'){
if(ParseParameter.astr.length() > ParseParameter.length) { if(ParseParameter.curastr.length() >= ParseParameter.alength) {
bw.write(ParseParameter.astr); bw.write(ParseParameter.curastr);
bw.newLine(); bw.newLine();
aflag = false; aflag = false;
} }
continue; continue;
} }
if(ParseParameter.astr.length() > ParseParameter.length) { if(ParseParameter.curastr.length() >= ParseParameter.alength) {
bw.write(ParseParameter.astr); bw.write(ParseParameter.curastr);
} else { } else {
bw.write(textLine); bw.write(textLine);
} }
@ -173,15 +193,15 @@ public class TargetFile {
} else if (textLine.indexOf("TARGET") != -1) { } else if (textLine.indexOf("TARGET") != -1) {
if(tflag == true){ if(tflag == true){
if(textLine.trim().charAt(0) == '#'){ if(textLine.trim().charAt(0) == '#'){
if(ParseParameter.tstr.length() > ParseParameter.length) { if(ParseParameter.curtstr.length() >= ParseParameter.tlength) {
bw.write(ParseParameter.tstr); bw.write(ParseParameter.curtstr);
bw.newLine(); bw.newLine();
tflag = false; tflag = false;
} }
continue; continue;
} }
if(ParseParameter.tstr.length() > ParseParameter.length) { if(ParseParameter.curtstr.length() >= ParseParameter.tlength) {
bw.write(ParseParameter.tstr); bw.write(ParseParameter.curtstr);
} else { } else {
bw.write(textLine); bw.write(textLine);
} }
@ -191,15 +211,15 @@ public class TargetFile {
} else if (textLine.indexOf("TOOL_CHAIN_CONF") != -1) { } else if (textLine.indexOf("TOOL_CHAIN_CONF") != -1) {
if(cflag == true){ if(cflag == true){
if(textLine.trim().charAt(0) == '#'){ if(textLine.trim().charAt(0) == '#'){
if(ParseParameter.cstr.length() > ParseParameter.length) { if(ParseParameter.curcstr.length() >= ParseParameter.clength) {
bw.write(ParseParameter.cstr); bw.write(ParseParameter.curcstr);
bw.newLine(); bw.newLine();
cflag = false; cflag = false;
} }
continue; continue;
} }
if(ParseParameter.cstr.length() > ParseParameter.length) { if(ParseParameter.curcstr.length() >= ParseParameter.clength) {
bw.write(ParseParameter.cstr); bw.write(ParseParameter.curcstr);
} else { } else {
bw.write(textLine); bw.write(textLine);
} }
@ -209,15 +229,15 @@ public class TargetFile {
} else if (textLine.indexOf("TOOL_CHAIN_TAG") != -1) { } else if (textLine.indexOf("TOOL_CHAIN_TAG") != -1) {
if(nflag == true){ if(nflag == true){
if(textLine.trim().charAt(0) == '#'){ if(textLine.trim().charAt(0) == '#'){
if(ParseParameter.nstr.length() > ParseParameter.length) { if(ParseParameter.curnstr.length() >= ParseParameter.nlength) {
bw.write(ParseParameter.nstr); bw.write(ParseParameter.curnstr);
bw.newLine(); bw.newLine();
nflag = false; nflag = false;
} }
continue; continue;
} }
if(ParseParameter.nstr.length() > ParseParameter.length) { if(ParseParameter.curnstr.length() >= ParseParameter.nlength) {
bw.write(ParseParameter.nstr); bw.write(ParseParameter.curnstr);
} else { } else {
bw.write(textLine); bw.write(textLine);
} }
@ -227,15 +247,15 @@ public class TargetFile {
} else if (textLine.indexOf("MAX_CONCURRENT_THREAD_NUMBER") != -1) { } else if (textLine.indexOf("MAX_CONCURRENT_THREAD_NUMBER") != -1) {
if(mflag == true){ if(mflag == true){
if(textLine.trim().charAt(0) == '#'){ if(textLine.trim().charAt(0) == '#'){
if(ParseParameter.mstr.length() > ParseParameter.length) { if(ParseParameter.curmstr.length() >= ParseParameter.mlength) {
bw.write(ParseParameter.mstr); bw.write(ParseParameter.curmstr);
bw.newLine(); bw.newLine();
mflag = false; mflag = false;
} }
continue; continue;
} }
if(ParseParameter.mstr.length() > ParseParameter.length) { if(ParseParameter.curmstr.length() >= ParseParameter.mlength) {
bw.write(ParseParameter.mstr); bw.write(ParseParameter.curmstr);
} else { } else {
bw.write(textLine); bw.write(textLine);
} }
@ -245,15 +265,15 @@ public class TargetFile {
}else if (textLine.indexOf("MULTIPLE_THREAD") != -1) { }else if (textLine.indexOf("MULTIPLE_THREAD") != -1) {
if(meflag == true){ if(meflag == true){
if(textLine.trim().charAt(0) == '#'){ if(textLine.trim().charAt(0) == '#'){
if(ParseParameter.mestr.length() > ParseParameter.length) { if(ParseParameter.curmestr.length() >= ParseParameter.melength) {
bw.write(ParseParameter.mestr); bw.write(ParseParameter.curmestr);
bw.newLine(); bw.newLine();
meflag = false; meflag = false;
} }
continue; continue;
} }
if(ParseParameter.mestr.length() > ParseParameter.length) { if(ParseParameter.curmestr.length() >= ParseParameter.melength) {
bw.write(ParseParameter.mestr); bw.write(ParseParameter.curmestr);
} else { } else {
bw.write(textLine); bw.write(textLine);
} }
@ -266,26 +286,26 @@ public class TargetFile {
// //
//user maybe delete the line *ACTIVE_PLATFORM*=* //user maybe delete the line *ACTIVE_PLATFORM*=*
// //
if( (pflag == true) && (ParseParameter.pstr.length() > ParseParameter.length) ){ if( (pflag == true) && (ParseParameter.curpstr.length() >= ParseParameter.plength) ){
bw.write(ParseParameter.pstr); bw.write(ParseParameter.curpstr);
bw.newLine(); bw.newLine();
} else if ( (tflag == true) && (ParseParameter.tstr.length() > ParseParameter.length) ){ } else if ( (tflag == true) && (ParseParameter.curtstr.length() >= ParseParameter.tlength) ){
bw.write(ParseParameter.tstr); bw.write(ParseParameter.curtstr);
bw.newLine(); bw.newLine();
} else if ( (aflag == true) && (ParseParameter.astr.length() > ParseParameter.length) ){ } else if ( (aflag == true) && (ParseParameter.curastr.length() >= ParseParameter.alength) ){
bw.write(ParseParameter.astr); bw.write(ParseParameter.curastr);
bw.newLine(); bw.newLine();
} else if ( (cflag == true) && (ParseParameter.cstr.length() > ParseParameter.length) ){ } else if ( (cflag == true) && (ParseParameter.curcstr.length() >= ParseParameter.clength) ){
bw.write(ParseParameter.cstr); bw.write(ParseParameter.curcstr);
bw.newLine(); bw.newLine();
} else if ( (nflag == true) && (ParseParameter.nstr.length() > ParseParameter.length) ){ } else if ( (nflag == true) && (ParseParameter.curnstr.length() >= ParseParameter.nlength) ){
bw.write(ParseParameter.nstr); bw.write(ParseParameter.curnstr);
bw.newLine(); bw.newLine();
} else if ( (meflag == true) && (ParseParameter.mestr.length() > ParseParameter.length) ){ } else if ( (meflag == true) && (ParseParameter.curmestr.length() >= ParseParameter.melength) ){
bw.write(ParseParameter.mestr); bw.write(ParseParameter.curmestr);
bw.newLine(); bw.newLine();
} else if ( (mflag == true) && (ParseParameter.mstr.length() > ParseParameter.length) ){ } else if ( (mflag == true) && (ParseParameter.curmstr.length() >= ParseParameter.mlength) ){
bw.write(ParseParameter.mstr); bw.write(ParseParameter.curmstr);
bw.newLine(); bw.newLine();
} }
} catch (IOException e) { } catch (IOException e) {
@ -313,6 +333,97 @@ public class TargetFile {
return true; return true;
} }
/**
* read the file and output the lines which include setting
* @param File fd : the File of the target file
* @return String: the current setting
**/
public static boolean readFile() {
BufferedReader br = null;
String textLine = null;
try {
br = new BufferedReader(new FileReader(Fd));
} catch (FileNotFoundException e) {
System.out
.println("\n# create the BufferedReader failed, because can't find the file:target.txt!");
return false;
}
try {
while ((textLine = br.readLine()) != null) {
//
// the line is composed of Space
//
if (textLine.trim().compareToIgnoreCase("") == 0) {
continue;
}
//
// the line starts with "#"
//
else if ((textLine.trim().charAt(0) == '#')){
continue;
} else {
if (textLine.indexOf("ACTIVE_PLATFORM") != -1) {
ParseParameter.curpstr = textLine;
ParseParameter.plength = textLine.indexOf('=');
} else if (textLine.indexOf("TARGET_ARCH") != -1) {
ParseParameter.curastr = textLine;
ParseParameter.alength = textLine.indexOf('=');
} else if (textLine.indexOf("TARGET") != -1) {
ParseParameter.curtstr = textLine;
ParseParameter.tlength = textLine.indexOf('=');
} else if (textLine.indexOf("TOOL_CHAIN_CONF") != -1) {
ParseParameter.curcstr = textLine;
ParseParameter.clength = textLine.indexOf('=');
} else if (textLine.indexOf("TOOL_CHAIN_TAG") != -1) {
ParseParameter.curnstr = textLine;
ParseParameter.nlength = textLine.indexOf('=');
} else if (textLine.indexOf("MAX_CONCURRENT_THREAD_NUMBER") != -1) {
ParseParameter.curmstr = textLine;
ParseParameter.mlength = textLine.indexOf('=');
} else if (textLine.indexOf("MULTIPLE_THREAD") != -1) {
ParseParameter.curmestr = textLine;
ParseParameter.melength = textLine.indexOf('=');
}
}
}
} catch (IOException e) {
System.out.println("\n# read file error!");
return false;
}
try {
br.close();
} catch (IOException e) {
System.out
.println("\n# close BufferedReader error");
return false;
}
return true;
}
private static String convertStr(String str){
String convertStr = null;
if( str.compareTo("-p") == 0 ){
convertStr = "ACTIVE_PLATFORM";
}else if( str.compareTo("-a") == 0){
convertStr = "TARGET_ARCH";
}else if( str.compareTo("-t") == 0){
convertStr = "TARGET";
}else if( str.compareTo("-c") == 0){
convertStr = "TOOL_CHAIN_CONF";
}else if( str.compareTo("-n") == 0){
convertStr = "TOOL_CHAIN_TAG";
}else if( str.compareTo("-m") == 0){
convertStr = "MAX_CONCURRENT_THREAD_NUMBER";
}
return convertStr;
}
/** /**
* according to user's input args, write the file directly * according to user's input args, write the file directly