+/** @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