+/** @file\r
+This file is to define Identification class.\r
+\r
+Copyright (c) 2006, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+**/\r
+\r
package org.tianocore.build.id;\r
\r
import org.tianocore.build.global.GlobalData;\r
+/** @file\r
+This file is to define ModuleIdentification class.\r
+\r
+Copyright (c) 2006, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+**/\r
+\r
package org.tianocore.build.id;\r
\r
import java.io.File;\r
+/** @file\r
+This file is to define PackageIdentification class.\r
+\r
+Copyright (c) 2006, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+**/\r
+\r
package org.tianocore.build.id;\r
import java.io.File;\r
\r
+/** @file\r
+This file is to define PlatformIdentification class.\r
+\r
+Copyright (c) 2006, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+**/\r
+\r
package org.tianocore.build.id;\r
import java.io.File;\r
\r
+/** @file\r
+This file is to define ToolChainAttribute class.\r
+\r
+Copyright (c) 2006, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+**/\r
+\r
package org.tianocore.build.toolchain;\r
+\r
/**\r
-* TODO: Add class description\r
-* \r
-* @author jwang36\r
-*/\r
+\r
+ ToolChainAttribute is used to define the enumeration value for the attributes\r
+ used in tool chain definition file. \r
+\r
+ **/\r
public class ToolChainAttribute {\r
private static int nextValue = 0;\r
\r
- //"NAME", "PATH", "DPATH", "SPATH", "EXT", "FAMILY", "FLAGS"\r
+ //\r
+ // "NAME", "PATH", "DPATH", "SPATH", "EXT", "FAMILY", "FLAGS"\r
+ // \r
public final static ToolChainAttribute NAME = new ToolChainAttribute("NAME");\r
public final static ToolChainAttribute PATH = new ToolChainAttribute("PATH");\r
public final static ToolChainAttribute DPATH = new ToolChainAttribute("DPATH");\r
/** @file\r
- ToolChainFactory class.\r
+ ToolChainConfig class.\r
\r
- ToolChainFactory class parse all config files and get STD_FLAGS, GLOBAL_FLAGS,\r
- and also command path + name.\r
+ ToolChainFactory class parse all config files and get tool chain information.\r
\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
\r
\r
/**\r
- This class parse all config files and get STD_FLAGS, GLOBAL_FLAGS, and also \r
- command path + name.\r
+ \r
+ ToolChainFactory class parse all config files and get tool chain information.\r
\r
- @since GenBuild 1.0\r
-**/\r
+ **/\r
public class ToolChainConfig {\r
- ///\r
- /// list of attributes\r
- ///\r
- private final static String[] attributes = {"NAME", "PATH", "DPATH", "SPATH", "EXT", "FAMILY", "FLAGS"};\r
- ///\r
- /// elements which are used to define one type of tool\r
- ///\r
- private final static String[] elements = {"TARGET", "TOOLCHAIN", "ARCH", "CMD", "ATTRIBUTE" };\r
-\r
///\r
/// tool chain definitions\r
///\r
private ToolChainMap config = null;\r
+ ///\r
+ /// tool chain information (how many targets, archs, etc.)\r
+ /// \r
private ToolChainInfo info = new ToolChainInfo();\r
\r
/**\r
Public construct method.\r
- **/\r
+ **/\r
public ToolChainConfig () {\r
}\r
\r
/**\r
Public construct method.\r
\r
- @param confPath the path of config files\r
- @param toolChainTag TOOL_CHAIN name\r
+ @param toolChainFile File object representing the tool chain configuration file\r
**/\r
public ToolChainConfig (File toolChainFile) {\r
try {\r
}\r
}\r
\r
- /// \r
- /// \r
- /// \r
- public void parseToolChainDefKey (Set<ToolChainKey> toolChainDefKey) {\r
+ /**\r
+ Collect target, tool chain tag, arch and command information from key part\r
+ of configuration\r
+ \r
+ @param toolChainDefKey The set of keys in tool chain configuration\r
+ **/\r
+ private void parseToolChainDefKey (Set<ToolChainKey> toolChainDefKey) {\r
Iterator it = toolChainDefKey.iterator();\r
while (it.hasNext()) {\r
ToolChainKey key = (ToolChainKey)it.next();\r
}\r
}\r
\r
-/**\r
- public Set<String> getTargets() {\r
- return info.getTargets();\r
- }\r
-\r
- public Set<String> getTagnames() {\r
- return info.getTagnames();\r
- }\r
-\r
- public Set<String> getArchs() {\r
- return info.getArchs();\r
- }\r
-\r
- public Set<String> getCommands() {\r
- return info.getCommands();\r
- }\r
-\r
- public String getValue(String key) {\r
- return config.get(key);\r
- }\r
-\r
- public String getValue(String[] keySet) {\r
- return config.get(keySet);\r
- }\r
-\r
- public String getValue(ToolChainKey key) {\r
- return config.get(key);\r
- }\r
- **/\r
-\r
+ /**\r
+ Return the tool chain configuration information in a Map form \r
+ \r
+ @return ToolChainMap Tool chain configurations in a ToolChainMap\r
+ **/\r
public ToolChainMap getConfig() {\r
return config;\r
}\r
\r
+ /**\r
+ Return the tool chain's target, arch, tag and commands information\r
+ \r
+ @return ToolChainInfo\r
+ **/\r
public ToolChainInfo getConfigInfo() {\r
return info;\r
}\r
\r
- ///\r
- /// override toString()\r
- /// \r
+ /**\r
+ override toString()\r
+ \r
+ @return String The converted configuration string in name=value form\r
+ **/\r
public String toString() {\r
StringBuffer ts = new StringBuffer(10240);\r
\r
while (it.hasNext()) {\r
ToolChainKey key = (ToolChainKey)it.next();\r
ts.append(key.toString() + " = ");\r
-// ts.append(config.get(key) + "\n");\r
+ ts.append(config.get(key) + "\n");\r
}\r
\r
return ts.toString();\r
+/** @file\r
+This file is to define ToolChainElement class.\r
+\r
+Copyright (c) 2006, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+**/\r
+\r
package org.tianocore.build.toolchain;\r
+\r
/**\r
-* TODO: Add class description\r
-* \r
-* @author jwang36\r
-*/\r
+\r
+ This class is an enumeration definition for key elements in tool chain definition\r
+ file.\r
+ \r
+ **/\r
public class ToolChainElement {\r
private static int nextValue = 0;\r
\r
- //"NAME", "PATH", "DPATH", "SPATH", "EXT", "FAMILY", "FLAGS"\r
+ //\r
+ // "TARGET", "TOOLCHAIN", "ARCH", "TOOLCODE", "ATTRIBUTE"\r
+ // \r
public final static ToolChainElement TARGET = new ToolChainElement("TARGET");\r
public final static ToolChainElement TOOLCHAIN = new ToolChainElement("TOOLCHAIN");\r
public final static ToolChainElement ARCH = new ToolChainElement("ARCH");\r
+/** @file\r
+This file is to define ToolChainInfo class.\r
+\r
+Copyright (c) 2006, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+**/\r
+\r
package org.tianocore.build.toolchain;\r
\r
import java.util.HashMap;\r
import java.util.Set;\r
\r
public class ToolChainInfo {\r
-\r
+ //\r
+ // build target set\r
+ // \r
private Set<String> targets = new LinkedHashSet<String>();\r
- \r
+ //\r
+ // tool chain tag name set\r
+ // \r
private Set<String> tagnames = new LinkedHashSet<String>();\r
- \r
+ //\r
+ // build archs set\r
+ // \r
private Set<String> archs = new LinkedHashSet<String>();\r
- \r
+ //\r
+ // build commands set\r
+ // \r
private Set<String> commands = new LinkedHashSet<String>();\r
-\r
+ //\r
+ // build commands for specific tool chain\r
+ // \r
private Map<String, Set<String>> commandMap = new HashMap<String, Set<String>>();\r
- \r
+ /**\r
+ Add a list of targets in the form of string separated by space\r
+\r
+ @param targetList target list string\r
+ **/\r
public void addTargets(String targetList) {\r
//\r
// targetList some targets separated by space " "\r
}\r
addTargets(targetList.split(" "));\r
}\r
- \r
+ /**\r
+ Add a list of targets in the form of string array\r
+ \r
+ @param targetArray target string array\r
+ **/\r
public void addTargets(String[] targetArray) {\r
if (targetArray == null ) {\r
return ;\r
targets.add(targetArray[i]);\r
}\r
}\r
- \r
+ /**\r
+ Add a list of target in the form of set\r
+ \r
+ @param targetSet target string set\r
+ **/\r
public void addTargets(Set<String> targetSet) {\r
targets.addAll(targetSet);\r
}\r
- \r
+ /**\r
+ Add a list of tool chain tag name in the form of string separated by space\r
+\r
+ @param tagnameList\r
+ **/\r
public void addTagnames(String tagnameList) {\r
//\r
// tagnameList some tagnames separated by space " "\r
result.addTargets(union(this.targets, info.targets));\r
result.addTagnames(union(this.tagnames, info.tagnames));\r
result.addArchs(union(this.archs, info.archs));\r
- //result.addCommands(union(this.getCommands(), info.getCommands()));\r
return result;\r
}\r
\r
public ToolChainInfo intersection(ToolChainInfo info) {\r
-// System.out.println(this + "\n" + info);\r
ToolChainInfo result = new ToolChainInfo();\r
result.addTargets(intersection(this.targets, info.targets));\r
result.addTagnames(intersection(this.tagnames, info.tagnames));\r
result.addArchs(intersection(this.archs, info.archs));\r
- // result.addCommands(union(this.commands, info.commands));\r
-// System.out.println("result: " + result);\r
return result;\r
}\r
\r
result.retainAll(set2);\r
}\r
\r
-// result.remove("*");\r
return result;\r
}\r
\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
-Module Name:\r
- ToolChainKey.java\r
-\r
-Abstract:\r
-\r
--*/\r
\r
package org.tianocore.build.toolchain;\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
-Module Name:\r
- ToolChainMap.java\r
-\r
-Abstract:\r
-\r
--*/\r
\r
package org.tianocore.build.toolchain;\r
**/\r
public void execute() throws BuildException {\r
String toolChain = getProject().getProperty(toolsEnv);\r
-// ToolChainConfig toolchain = new ToolChainConfig(new File(confPath + File.separatorChar + toolChain));\r
- //getProject().setProperty("TARGET", toolchain.getCurrentTarget());\r
}\r
\r
/**\r