summaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorjwang36 <jwang36@6f19259b-4bc3-4df7-8a09-765794883524>2006-07-13 10:27:03 +0000
committerjwang36 <jwang36@6f19259b-4bc3-4df7-8a09-765794883524>2006-07-13 10:27:03 +0000
commit5f42a4badadec3d4928c6483aea22d3073ac5441 (patch)
treeb6795afdafed5a42f65770aff8253a8db99b01f8 /Tools
parenta45e9a400d98d0af8ba5508a9abacc93ee5601d8 (diff)
downloadedk2-platforms-5f42a4badadec3d4928c6483aea22d3073ac5441.tar.xz
Added copyright&license header.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@973 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Tools')
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/id/Identification.java13
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/id/ModuleIdentification.java13
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/id/PackageIdentification.java13
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/id/PlatformIdentification.java13
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainAttribute.java27
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainConfig.java90
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainElement.java27
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainInfo.java62
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainKey.java5
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainMap.java5
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainTask.java2
11 files changed, 177 insertions, 93 deletions
diff --git a/Tools/Source/GenBuild/org/tianocore/build/id/Identification.java b/Tools/Source/GenBuild/org/tianocore/build/id/Identification.java
index abf5c1bade..8315358b2f 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/id/Identification.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/id/Identification.java
@@ -1,3 +1,16 @@
+/** @file
+This file is to define Identification class.
+
+Copyright (c) 2006, Intel Corporation
+All rights reserved. This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+**/
+
package org.tianocore.build.id;
import org.tianocore.build.global.GlobalData;
diff --git a/Tools/Source/GenBuild/org/tianocore/build/id/ModuleIdentification.java b/Tools/Source/GenBuild/org/tianocore/build/id/ModuleIdentification.java
index 5681251ec5..7f146b6050 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/id/ModuleIdentification.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/id/ModuleIdentification.java
@@ -1,3 +1,16 @@
+/** @file
+This file is to define ModuleIdentification class.
+
+Copyright (c) 2006, Intel Corporation
+All rights reserved. This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+**/
+
package org.tianocore.build.id;
import java.io.File;
diff --git a/Tools/Source/GenBuild/org/tianocore/build/id/PackageIdentification.java b/Tools/Source/GenBuild/org/tianocore/build/id/PackageIdentification.java
index 8d4994dd9b..530e4e7907 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/id/PackageIdentification.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/id/PackageIdentification.java
@@ -1,3 +1,16 @@
+/** @file
+This file is to define PackageIdentification class.
+
+Copyright (c) 2006, Intel Corporation
+All rights reserved. This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+**/
+
package org.tianocore.build.id;
import java.io.File;
diff --git a/Tools/Source/GenBuild/org/tianocore/build/id/PlatformIdentification.java b/Tools/Source/GenBuild/org/tianocore/build/id/PlatformIdentification.java
index e1048808c9..530ecedc86 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/id/PlatformIdentification.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/id/PlatformIdentification.java
@@ -1,3 +1,16 @@
+/** @file
+This file is to define PlatformIdentification class.
+
+Copyright (c) 2006, Intel Corporation
+All rights reserved. This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+**/
+
package org.tianocore.build.id;
import java.io.File;
diff --git a/Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainAttribute.java b/Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainAttribute.java
index 7fa0bb3f7c..fad10da40b 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainAttribute.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainAttribute.java
@@ -1,13 +1,30 @@
+/** @file
+This file is to define ToolChainAttribute class.
+
+Copyright (c) 2006, Intel Corporation
+All rights reserved. This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+**/
+
package org.tianocore.build.toolchain;
+
/**
-* TODO: Add class description
-*
-* @author jwang36
-*/
+
+ ToolChainAttribute is used to define the enumeration value for the attributes
+ used in tool chain definition file.
+
+ **/
public class ToolChainAttribute {
private static int nextValue = 0;
- //"NAME", "PATH", "DPATH", "SPATH", "EXT", "FAMILY", "FLAGS"
+ //
+ // "NAME", "PATH", "DPATH", "SPATH", "EXT", "FAMILY", "FLAGS"
+ //
public final static ToolChainAttribute NAME = new ToolChainAttribute("NAME");
public final static ToolChainAttribute PATH = new ToolChainAttribute("PATH");
public final static ToolChainAttribute DPATH = new ToolChainAttribute("DPATH");
diff --git a/Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainConfig.java b/Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainConfig.java
index 232046c590..891035ca1e 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainConfig.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainConfig.java
@@ -1,8 +1,7 @@
/** @file
- ToolChainFactory class.
+ ToolChainConfig class.
- ToolChainFactory class parse all config files and get STD_FLAGS, GLOBAL_FLAGS,
- and also command path + name.
+ ToolChainFactory class parse all config files and get tool chain information.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
@@ -27,38 +26,30 @@ import java.util.Set;
/**
- This class parse all config files and get STD_FLAGS, GLOBAL_FLAGS, and also
- command path + name.
+
+ ToolChainFactory class parse all config files and get tool chain information.
- @since GenBuild 1.0
-**/
+ **/
public class ToolChainConfig {
///
- /// list of attributes
- ///
- private final static String[] attributes = {"NAME", "PATH", "DPATH", "SPATH", "EXT", "FAMILY", "FLAGS"};
- ///
- /// elements which are used to define one type of tool
- ///
- private final static String[] elements = {"TARGET", "TOOLCHAIN", "ARCH", "CMD", "ATTRIBUTE" };
-
- ///
/// tool chain definitions
///
private ToolChainMap config = null;
+ ///
+ /// tool chain information (how many targets, archs, etc.)
+ ///
private ToolChainInfo info = new ToolChainInfo();
/**
Public construct method.
- **/
+ **/
public ToolChainConfig () {
}
/**
Public construct method.
- @param confPath the path of config files
- @param toolChainTag TOOL_CHAIN name
+ @param toolChainFile File object representing the tool chain configuration file
**/
public ToolChainConfig (File toolChainFile) {
try {
@@ -70,10 +61,13 @@ public class ToolChainConfig {
}
}
- ///
- ///
- ///
- public void parseToolChainDefKey (Set<ToolChainKey> toolChainDefKey) {
+ /**
+ Collect target, tool chain tag, arch and command information from key part
+ of configuration
+
+ @param toolChainDefKey The set of keys in tool chain configuration
+ **/
+ private void parseToolChainDefKey (Set<ToolChainKey> toolChainDefKey) {
Iterator it = toolChainDefKey.iterator();
while (it.hasNext()) {
ToolChainKey key = (ToolChainKey)it.next();
@@ -85,47 +79,29 @@ public class ToolChainConfig {
}
}
-/**
- public Set<String> getTargets() {
- return info.getTargets();
- }
-
- public Set<String> getTagnames() {
- return info.getTagnames();
- }
-
- public Set<String> getArchs() {
- return info.getArchs();
- }
-
- public Set<String> getCommands() {
- return info.getCommands();
- }
-
- public String getValue(String key) {
- return config.get(key);
- }
-
- public String getValue(String[] keySet) {
- return config.get(keySet);
- }
-
- public String getValue(ToolChainKey key) {
- return config.get(key);
- }
- **/
-
+ /**
+ Return the tool chain configuration information in a Map form
+
+ @return ToolChainMap Tool chain configurations in a ToolChainMap
+ **/
public ToolChainMap getConfig() {
return config;
}
+ /**
+ Return the tool chain's target, arch, tag and commands information
+
+ @return ToolChainInfo
+ **/
public ToolChainInfo getConfigInfo() {
return info;
}
- ///
- /// override toString()
- ///
+ /**
+ override toString()
+
+ @return String The converted configuration string in name=value form
+ **/
public String toString() {
StringBuffer ts = new StringBuffer(10240);
@@ -133,7 +109,7 @@ public class ToolChainConfig {
while (it.hasNext()) {
ToolChainKey key = (ToolChainKey)it.next();
ts.append(key.toString() + " = ");
-// ts.append(config.get(key) + "\n");
+ ts.append(config.get(key) + "\n");
}
return ts.toString();
diff --git a/Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainElement.java b/Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainElement.java
index a383cc8a84..17c79c6fb0 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainElement.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainElement.java
@@ -1,13 +1,30 @@
+/** @file
+This file is to define ToolChainElement class.
+
+Copyright (c) 2006, Intel Corporation
+All rights reserved. This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+**/
+
package org.tianocore.build.toolchain;
+
/**
-* TODO: Add class description
-*
-* @author jwang36
-*/
+
+ This class is an enumeration definition for key elements in tool chain definition
+ file.
+
+ **/
public class ToolChainElement {
private static int nextValue = 0;
- //"NAME", "PATH", "DPATH", "SPATH", "EXT", "FAMILY", "FLAGS"
+ //
+ // "TARGET", "TOOLCHAIN", "ARCH", "TOOLCODE", "ATTRIBUTE"
+ //
public final static ToolChainElement TARGET = new ToolChainElement("TARGET");
public final static ToolChainElement TOOLCHAIN = new ToolChainElement("TOOLCHAIN");
public final static ToolChainElement ARCH = new ToolChainElement("ARCH");
diff --git a/Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainInfo.java b/Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainInfo.java
index 146f6e5a13..7bf9dd6b8f 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainInfo.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainInfo.java
@@ -1,3 +1,16 @@
+/** @file
+This file is to define ToolChainInfo class.
+
+Copyright (c) 2006, Intel Corporation
+All rights reserved. This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+**/
+
package org.tianocore.build.toolchain;
import java.util.HashMap;
@@ -6,17 +19,31 @@ import java.util.Map;
import java.util.Set;
public class ToolChainInfo {
-
+ //
+ // build target set
+ //
private Set<String> targets = new LinkedHashSet<String>();
-
+ //
+ // tool chain tag name set
+ //
private Set<String> tagnames = new LinkedHashSet<String>();
-
+ //
+ // build archs set
+ //
private Set<String> archs = new LinkedHashSet<String>();
-
+ //
+ // build commands set
+ //
private Set<String> commands = new LinkedHashSet<String>();
-
+ //
+ // build commands for specific tool chain
+ //
private Map<String, Set<String>> commandMap = new HashMap<String, Set<String>>();
-
+ /**
+ Add a list of targets in the form of string separated by space
+
+ @param targetList target list string
+ **/
public void addTargets(String targetList) {
//
// targetList some targets separated by space " "
@@ -27,7 +54,11 @@ public class ToolChainInfo {
}
addTargets(targetList.split(" "));
}
-
+ /**
+ Add a list of targets in the form of string array
+
+ @param targetArray target string array
+ **/
public void addTargets(String[] targetArray) {
if (targetArray == null ) {
return ;
@@ -36,11 +67,19 @@ public class ToolChainInfo {
targets.add(targetArray[i]);
}
}
-
+ /**
+ Add a list of target in the form of set
+
+ @param targetSet target string set
+ **/
public void addTargets(Set<String> targetSet) {
targets.addAll(targetSet);
}
-
+ /**
+ Add a list of tool chain tag name in the form of string separated by space
+
+ @param tagnameList
+ **/
public void addTagnames(String tagnameList) {
//
// tagnameList some tagnames separated by space " "
@@ -142,18 +181,14 @@ public class ToolChainInfo {
result.addTargets(union(this.targets, info.targets));
result.addTagnames(union(this.tagnames, info.tagnames));
result.addArchs(union(this.archs, info.archs));
- //result.addCommands(union(this.getCommands(), info.getCommands()));
return result;
}
public ToolChainInfo intersection(ToolChainInfo info) {
-// System.out.println(this + "\n" + info);
ToolChainInfo result = new ToolChainInfo();
result.addTargets(intersection(this.targets, info.targets));
result.addTagnames(intersection(this.tagnames, info.tagnames));
result.addArchs(intersection(this.archs, info.archs));
- // result.addCommands(union(this.commands, info.commands));
-// System.out.println("result: " + result);
return result;
}
@@ -182,7 +217,6 @@ public class ToolChainInfo {
result.retainAll(set2);
}
-// result.remove("*");
return result;
}
diff --git a/Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainKey.java b/Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainKey.java
index 5504e54951..f6e1e067f8 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainKey.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainKey.java
@@ -9,11 +9,6 @@ http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-Module Name:
- ToolChainKey.java
-
-Abstract:
-
--*/
package org.tianocore.build.toolchain;
diff --git a/Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainMap.java b/Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainMap.java
index baddd95a98..1bcaf0ece0 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainMap.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainMap.java
@@ -9,11 +9,6 @@ http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-Module Name:
- ToolChainMap.java
-
-Abstract:
-
--*/
package org.tianocore.build.toolchain;
diff --git a/Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainTask.java b/Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainTask.java
index 974be515f4..5af54ba7a0 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainTask.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainTask.java
@@ -50,8 +50,6 @@ public class ToolChainTask extends Task{
**/
public void execute() throws BuildException {
String toolChain = getProject().getProperty(toolsEnv);
-// ToolChainConfig toolchain = new ToolChainConfig(new File(confPath + File.separatorChar + toolChain));
- //getProject().setProperty("TARGET", toolchain.getCurrentTarget());
}
/**