}\r
}\r
} catch (Exception e) {\r
- e.printStackTrace();\r
throw new BuildException(e.getMessage());\r
}\r
\r
//\r
// Global Data initialization\r
//\r
+ File workspacePath = new File(getProject().getProperty("WORKSPACE"));\r
+ getProject().setProperty("WORKSPACE_DIR", workspacePath.getPath().replaceAll("(\\\\)", "/"));\r
GlobalData.initInfo("Tools" + File.separatorChar + "Conf" + File.separatorChar + "FrameworkDatabase.db",\r
- getProject().getProperty("WORKSPACE_DIR"), toolsDefFilename);\r
+ workspacePath.getPath(), toolsDefFilename);\r
\r
\r
\r
//\r
File buildFile = null;\r
if (msaFiles.size() > 1) {\r
- throw new BuildException("More than one MSA file under current directory. It is not allowd. ");\r
+ throw new BuildException("Having more than one MSA file in a directory is not allowed!");\r
}\r
else if (msaFiles.size() == 1 && activePlatform == null) {\r
- throw new BuildException("If try to build a single module, please set ACTIVE_PLATFORM in file [Tool/Conf/target.txt]. ");\r
+ throw new BuildException("If trying to build a single module, please set ACTIVE_PLATFORM in file [Tool/Conf/target.txt]. ");\r
}\r
else if (msaFiles.size() == 1 && activePlatform != null) {\r
//\r
// If there is no build files or FPD files or MSA files, stop build\r
//\r
else {\r
- throw new BuildException("Can't find any FPD files or MSA files in current directory. ");\r
+ throw new BuildException("Can't find any FPD or MSA files in the current directory. ");\r
}\r
\r
//\r
// Build every FPD files (PLATFORM build)\r
//\r
if (buildFile.getName().endsWith(".fpd")) {\r
- System.out.println("Start to build FPD file [" + buildFile.getPath() + "] ..>> ");\r
+ System.out.println("Processing the FPD file [" + buildFile.getPath() + "] ..>> ");\r
FpdParserTask fpdParserTask = new FpdParserTask();\r
fpdParserTask.setType(type);\r
fpdParserTask.setProject(getProject());\r
// Build every MSA files (SINGLE MODULE BUILD)\r
//\r
else if (buildFile.getName().endsWith(".msa")) {\r
- System.out.println("Start to build MSA file [" + buildFile.getPath() + "] ..>> ");\r
+ File tmpFile = new File(GlobalData.getWorkspacePath() + File.separatorChar + activePlatform);\r
+ System.out.println("Using the FPD file [" + tmpFile.getPath() + "] for the active platform. ");\r
+ System.out.println("Processing the MSA file [" + buildFile.getPath() + "] ..>> ");\r
GenBuildTask genBuildTask = new GenBuildTask();\r
genBuildTask.setSingleModuleBuild(true);\r
genBuildTask.setType(type);\r
allFiles[index] = iter.next();\r
index++;\r
}\r
- System.out.println("Find " + allFiles.length + " FPD and MSA files: ");\r
+ System.out.println("Finding " + allFiles.length + " FPD and MSA files: ");\r
for (int i = 0; i < allFiles.length; i++) {\r
System.out.println("[" + (i + 1) + "]: " + allFiles[i].getName());\r
}\r
\r
boolean flag = true;\r
- System.out.print("Please select one file to build:[1] ");\r
+ System.out.print("Please select one of the following FPD files to build:[1] ");\r
do{\r
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\r
try {\r
GlobalData.setToolChainEnvInfo(envToolChainInfo);\r
\r
str = getValue("TOOL_CHAIN_CONF", targetFileInfo);\r
- if (str != null) {\r
+ if (str != null && str.trim().length() > 0) {\r
toolsDefFilename = str;\r
}\r
\r
str = getValue("ACTIVE_PLATFORM", targetFileInfo);\r
if (str != null && ! str.trim().equals("")) {\r
if ( ! str.endsWith(".fpd")) {\r
- throw new BuildException("FPD file's file extension must be \".fpd\"");\r
+ throw new BuildException("FPD file's extension must be \".fpd\"!");\r
}\r
activePlatform = str;\r
}\r