import java.util.Map;\r
import java.util.Set;\r
\r
+import org.apache.tools.ant.Project;\r
import org.apache.xmlbeans.XmlException;\r
import org.apache.xmlbeans.XmlObject;\r
import org.apache.xmlbeans.XmlOptions;\r
@throws BuildException\r
Framework Dababase or SPD or MSA file is not valid\r
**/\r
- public synchronized static void initInfo(String workspaceDatabaseFile, String workspaceDir, String toolsDefFilename ) throws EdkException {\r
+ public synchronized static void initInfo(Project prj, String workspaceDatabaseFile, String workspaceDir, String toolsDefFilename ) throws EdkException {\r
//\r
// ensure this method will be revoked only once\r
//\r
//\r
File toolsDefFile = new File(workspaceDir + File.separatorChar + toolsDefFilename);\r
EdkLog.log("Init", EdkLog.EDK_ALWAYS, "Using tool definition file [" + toolsDefFile.getPath() + "].");\r
- toolsDef = new ToolChainConfig(toolsDefFile);\r
+ toolsDef = new ToolChainConfig(prj, toolsDefFile);\r
\r
//\r
// Parse Framework Database\r
PackageIdentification packageId = null;\r
Iterator iter = packageList.iterator();\r
while (iter.hasNext()) {\r
- packageId = (PackageIdentification)iter.next();\r
- moduleId.setPackage(packageId);\r
- Spd spd = spdTable.get(packageId);\r
+ PackageIdentification pid = (PackageIdentification)iter.next();\r
+ moduleId.setPackage(pid);\r
+ Spd spd = spdTable.get(pid);\r
File tempMsaFile = null;\r
if ((tempMsaFile = spd.getModuleFile(moduleId)) != null ) {\r
if (tempMsaFile.getParent().equalsIgnoreCase(moduleId.getMsaFile().getParent())) {\r
+ packageId = pid;\r
break ;\r
}\r
tempMsaFile = null;\r
}\r
}\r
if (packageId == null){\r
- throw new EdkException("Can't find Module [" + moduleId.getName() + "] in any SPD package!");\r
+ throw new EdkException("Can't find Module [" + moduleId.getName() + "] in any package!");\r
} else {\r
return packageId;\r
}\r
return moduleId;\r
}\r
}\r
- throw new EdkException("Can't find module GUID value " + moduleId.toGuidString() + " in " + packageId + " under the current workspace!");\r
+ throw new EdkException("Can't find " + moduleId + " under the current workspace!");\r
}\r
\r
public synchronized static Set<PackageIdentification> getPackageList(){\r
///\r
/// Tool Chain Related, try to refine and put some logic process to ToolChainFactory\r
///\r
- public synchronized static ToolChainInfo getToolChainInfo() throws EdkException {\r
+ public synchronized static ToolChainInfo getToolChainInfo() {\r
if (toolChainInfo == null) {\r
toolChainInfo = toolsDef.getConfigInfo().intersection(toolChainEnvInfo);\r
if (toolChainPlatformInfo != null) {\r
toolChainInfo.addCommands(toolsDef.getConfigInfo().getCommands());\r
toolChainInfo.normalize();\r
\r
- if (toolChainInfo.getTargets().length == 0) {\r
- throw new EdkException("No valid target specified! Please check your TARGET definition in Tools/Conf/target.txt.");\r
- }\r
-\r
- if (toolChainInfo.getTagnames().length == 0) {\r
- throw new EdkException("No valid tool chain specified! Please check your TOOL_CHAIN_TAG definition in Tools/Conf/target.txt.");\r
- }\r
-\r
- if (toolChainInfo.getArchs().length == 0) {\r
- throw new EdkException("No valid ARCH specified! Please check your TARGET_ARCH definition in Tools/Conf/target.txt.");\r
- }\r
-\r
- if (toolChainInfo.getCommands().length == 0) {\r
- throw new EdkException("No valid COMMAND specified! Please check your TARGET definition in Tools/Conf/tools_def.txt.");\r
- }\r
-\r
EdkLog.log("Init", EdkLog.EDK_ALWAYS, "Current build tool chain information summary: ");\r
EdkLog.log("Init", EdkLog.EDK_ALWAYS, toolChainInfo + "");\r
}\r