1. only show ModuleName, version, PackageName, version, supported Arch, path in table of FrameworkModules.

2. adding multiple entries per module for different archs. 

3. show ModuleSaOptions.
4. change "library Class consumed" to "library Class uninstantiated"

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1046 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jlin16 2006-07-19 10:03:37 +00:00
parent aa0e74b1ce
commit bf5abaffcc
5 changed files with 299 additions and 294 deletions

View File

@ -104,7 +104,7 @@ public class FpdFileContents {
continue; continue;
} }
String ModuleInfo = msa.getModuleGuid() + " " + msa.getModuleVersion() + String ModuleInfo = msa.getModuleGuid() + " " + msa.getModuleVersion() +
" " + msa.getPackageGuid() + " " + msa.getPackageVersion(); " " + msa.getPackageGuid() + " " + msa.getPackageVersion() + " " + listToString(msa.getSupArchList());
List<PcdBuildDefinitionDocument.PcdBuildDefinition.PcdData> lp = msa.getPcdBuildDefinition().getPcdDataList(); List<PcdBuildDefinitionDocument.PcdBuildDefinition.PcdData> lp = msa.getPcdBuildDefinition().getPcdDataList();
ListIterator<PcdBuildDefinitionDocument.PcdBuildDefinition.PcdData> lpi = lp.listIterator(); ListIterator<PcdBuildDefinitionDocument.PcdBuildDefinition.PcdData> lpi = lp.listIterator();
while (lpi.hasNext()) { while (lpi.hasNext()) {
@ -194,16 +194,28 @@ public class FpdFileContents {
int i = 0; int i = 0;
while(li.hasNext()) { while(li.hasNext()) {
ModuleSADocument.ModuleSA msa = (ModuleSADocument.ModuleSA)li.next(); ModuleSADocument.ModuleSA msa = (ModuleSADocument.ModuleSA)li.next();
saa[i][1] = msa.getModuleGuid(); saa[i][0] = msa.getModuleGuid();
saa[i][2] = msa.getModuleVersion(); saa[i][1] = msa.getModuleVersion();
saa[i][3] = msa.getPackageGuid(); saa[i][2] = msa.getPackageGuid();
saa[i][4] = msa.getPackageVersion(); saa[i][3] = msa.getPackageVersion();
// saa[i][4] = listToString(msa.getSupArchList()); saa[i][4] = listToString(msa.getSupArchList());
++i; ++i;
} }
} }
public void getFrameworkModuleInfo(int i, String[] sa) {
ModuleSADocument.ModuleSA msa = getModuleSA(i);
if (msa == null) {
return;
}
sa[0] = msa.getModuleGuid();
sa[1] = msa.getModuleVersion();
sa[2] = msa.getPackageGuid();
sa[3] = msa.getPackageVersion();
sa[4] = listToString(msa.getSupArchList());
}
public ModuleSADocument.ModuleSA getModuleSA(String key) { public ModuleSADocument.ModuleSA getModuleSA(String key) {
String[] s = key.split(" "); String[] s = key.split(" ");
if (getfpdFrameworkModules().getModuleSAList() == null) { if (getfpdFrameworkModules().getModuleSAList() == null) {
@ -223,11 +235,31 @@ public class FpdFileContents {
continue; continue;
} }
} }
//ToDo add arch check for s[4]
if (msa.getSupArchList() != null) {
if (!listToString(msa.getSupArchList()).equals(s[4])) {
continue;
}
}
return msa; return msa;
} }
} }
return null; return null;
} }
private ModuleSADocument.ModuleSA getModuleSA(int i) {
ModuleSADocument.ModuleSA msa = null;
XmlCursor cursor = getfpdFrameworkModules().newCursor();
if (cursor.toFirstChild()) {
for (int j = 0; j < i; ++j) {
cursor.toNextSibling();
}
msa = (ModuleSADocument.ModuleSA)cursor.getObject();
}
cursor.dispose();
return msa;
}
public void removeModuleSA(int i) { public void removeModuleSA(int i) {
XmlObject o = getfpdFrameworkModules(); XmlObject o = getfpdFrameworkModules();
if (o == null) { if (o == null) {
@ -244,7 +276,7 @@ public class FpdFileContents {
// //
ModuleSADocument.ModuleSA moduleSa = (ModuleSADocument.ModuleSA)cursor.getObject(); ModuleSADocument.ModuleSA moduleSa = (ModuleSADocument.ModuleSA)cursor.getObject();
String moduleInfo = moduleSa.getModuleGuid() + " " + moduleSa.getModuleVersion() + " " + String moduleInfo = moduleSa.getModuleGuid() + " " + moduleSa.getModuleVersion() + " " +
moduleSa.getPackageGuid()+ " " + moduleSa.getPackageVersion(); moduleSa.getPackageGuid()+ " " + moduleSa.getPackageVersion() + " " + listToString(moduleSa.getSupArchList());
PcdBuildDefinitionDocument.PcdBuildDefinition pcdBuildDef = moduleSa.getPcdBuildDefinition(); PcdBuildDefinitionDocument.PcdBuildDefinition pcdBuildDef = moduleSa.getPcdBuildDefinition();
if (pcdBuildDef != null && pcdBuildDef.getPcdDataList() != null) { if (pcdBuildDef != null && pcdBuildDef.getPcdDataList() != null) {
ListIterator<PcdBuildDefinitionDocument.PcdBuildDefinition.PcdData> li = pcdBuildDef.getPcdDataList().listIterator(); ListIterator<PcdBuildDefinitionDocument.PcdBuildDefinition.PcdData> li = pcdBuildDef.getPcdDataList().listIterator();
@ -272,6 +304,10 @@ public class FpdFileContents {
for(int i = 0; i < al.size(); ++i){ for(int i = 0; i < al.size(); ++i){
String consumer = al.get(i); String consumer = al.get(i);
if (consumer.contains(s[0]) && consumer.contains(s[2])){ if (consumer.contains(s[0]) && consumer.contains(s[2])){
String[] consumerPart = consumer.split(" ");
if (!consumerPart[4].equals(s[4])) {
continue;
}
al.remove(consumer); al.remove(consumer);
break; break;
} }
@ -285,22 +321,10 @@ public class FpdFileContents {
} }
// //
// key for ModuleSA : "ModuleGuid ModuleVer PackageGuid PackageVer" // key for ModuleSA : "ModuleGuid ModuleVer PackageGuid PackageVer Arch"
// //
public int getPcdDataCount(int i){ public int getPcdDataCount(int i){
if (getfpdFrameworkModules().getModuleSAList() == null || getfpdFrameworkModules().getModuleSAList().size() == 0) { ModuleSADocument.ModuleSA msa = getModuleSA(i);
return 0;
}
XmlCursor cursor = getfpdFrameworkModules().newCursor();
ModuleSADocument.ModuleSA msa = null;
if (cursor.toFirstChild()) {
for (int j = 0; j < i; ++j) {
cursor.toNextSibling();
}
msa = (ModuleSADocument.ModuleSA)cursor.getObject();
}
cursor.dispose();
if (msa == null || msa.getPcdBuildDefinition() == null || msa.getPcdBuildDefinition().getPcdDataList() == null){ if (msa == null || msa.getPcdBuildDefinition() == null || msa.getPcdBuildDefinition().getPcdDataList() == null){
return 0; return 0;
@ -310,19 +334,7 @@ public class FpdFileContents {
} }
public void getPcdData(int i, String[][] saa) { public void getPcdData(int i, String[][] saa) {
if (getfpdFrameworkModules().getModuleSAList() == null || getfpdFrameworkModules().getModuleSAList().size() == 0) { ModuleSADocument.ModuleSA msa = getModuleSA(i);
return;
}
XmlCursor cursor = getfpdFrameworkModules().newCursor();
ModuleSADocument.ModuleSA msa = null;
if (cursor.toFirstChild()) {
for (int j = 0; j < i; ++j) {
cursor.toNextSibling();
}
msa = (ModuleSADocument.ModuleSA)cursor.getObject();
}
cursor.dispose();
if (msa == null || msa.getPcdBuildDefinition() == null || msa.getPcdBuildDefinition().getPcdDataList() == null){ if (msa == null || msa.getPcdBuildDefinition() == null || msa.getPcdBuildDefinition().getPcdDataList() == null){
return; return;
@ -463,7 +475,7 @@ public class FpdFileContents {
} }
} }
// //
// key for ModuleSA : "ModuleGuid ModuleVer PackageGuid PackageVer" // key for ModuleSA : "ModuleGuid ModuleVer PackageGuid PackageVer Arch"
// //
public int getLibraryInstancesCount(String key) { public int getLibraryInstancesCount(String key) {
ModuleSADocument.ModuleSA msa = getModuleSA(key); ModuleSADocument.ModuleSA msa = getModuleSA(key);
@ -581,7 +593,7 @@ public class FpdFileContents {
msa.addNewModuleSaBuildOptions().setFfsFormatKey(ffsKey); msa.addNewModuleSaBuildOptions().setFfsFormatKey(ffsKey);
return; return;
} }
msa.getModuleSaBuildOptions().setFvBinding(ffsKey); msa.getModuleSaBuildOptions().setFfsFormatKey(ffsKey);
} }
public void getModuleSAOptions(String moduleKey, String[][] saa) { public void getModuleSAOptions(String moduleKey, String[][] saa) {
@ -600,12 +612,14 @@ public class FpdFileContents {
saa[i][0] = listToString(opt.getBuildTargets()); saa[i][0] = listToString(opt.getBuildTargets());
} }
saa[i][1] = opt.getToolChainFamily(); saa[i][1] = opt.getToolChainFamily();
saa[i][2] = opt.getTagName();
saa[i][3] = opt.getToolCode();
if (opt.getSupArchList() != null){ if (opt.getSupArchList() != null){
saa[i][2] = listToString(opt.getSupArchList()); saa[i][4] = listToString(opt.getSupArchList());
} }
saa[i][3] = opt.getToolCode();
saa[i][4] = opt.getTagName();
saa[i][5] = opt.getStringValue(); saa[i][5] = opt.getStringValue();
++i; ++i;
@ -670,12 +684,12 @@ public class FpdFileContents {
* @param mi * @param mi
* @param moduleSa if null, generate a new ModuleSA. * @param moduleSa if null, generate a new ModuleSA.
*/ */
public void addFrameworkModulesPcdBuildDefs(ModuleIdentification mi, ModuleSADocument.ModuleSA moduleSa) throws Exception { public void addFrameworkModulesPcdBuildDefs(ModuleIdentification mi, String arch, ModuleSADocument.ModuleSA moduleSa) throws Exception {
//ToDo add Arch filter //ToDo add Arch filter
try { try {
if (moduleSa == null) { if (moduleSa == null) {
moduleSa = genModuleSA(mi); moduleSa = genModuleSA(mi, arch);
} }
ModuleSurfaceAreaDocument.ModuleSurfaceArea msa = (ModuleSurfaceAreaDocument.ModuleSurfaceArea)GlobalData.getModuleXmlObject(mi); ModuleSurfaceAreaDocument.ModuleSurfaceArea msa = (ModuleSurfaceAreaDocument.ModuleSurfaceArea)GlobalData.getModuleXmlObject(mi);
@ -747,13 +761,18 @@ public class FpdFileContents {
return null; return null;
} }
private ModuleSADocument.ModuleSA genModuleSA (ModuleIdentification mi) { private ModuleSADocument.ModuleSA genModuleSA (ModuleIdentification mi, String arch) {
PackageIdentification pi = GlobalData.getPackageForModule(mi); PackageIdentification pi = GlobalData.getPackageForModule(mi);
ModuleSADocument.ModuleSA msa = getfpdFrameworkModules().addNewModuleSA(); ModuleSADocument.ModuleSA msa = getfpdFrameworkModules().addNewModuleSA();
msa.setModuleGuid(mi.getGuid()); msa.setModuleGuid(mi.getGuid());
msa.setModuleVersion(mi.getVersion()); msa.setModuleVersion(mi.getVersion());
msa.setPackageGuid(pi.getGuid()); msa.setPackageGuid(pi.getGuid());
msa.setPackageVersion(pi.getVersion()); msa.setPackageVersion(pi.getVersion());
if (arch != null) {
Vector<String> v = new Vector<String>();
v.add(arch);
msa.setSupArchList(v);
}
return msa; return msa;
} }
@ -772,7 +791,7 @@ public class FpdFileContents {
pcdConsumer = new ArrayList<String>(); pcdConsumer = new ArrayList<String>();
} }
String listValue = moduleSa.getModuleGuid() + " " + moduleSa.getModuleVersion() String listValue = moduleSa.getModuleGuid() + " " + moduleSa.getModuleVersion()
+ " " + moduleSa.getPackageGuid() + " " + moduleSa.getPackageVersion() + " " + moduleSa.getPackageGuid() + " " + moduleSa.getPackageVersion() + " " + listToString(moduleSa.getSupArchList())
+ " " + itemType; + " " + itemType;
pcdConsumer.add(listValue); pcdConsumer.add(listValue);
dynPcdMap.put(cName + " " + tsGuid, pcdConsumer); dynPcdMap.put(cName + " " + tsGuid, pcdConsumer);
@ -1259,12 +1278,20 @@ public class FpdFileContents {
private void setBuildOptionsUserDefAntTask(String id, String fileName, String execOrder, AntTaskDocument.AntTask at) { private void setBuildOptionsUserDefAntTask(String id, String fileName, String execOrder, AntTaskDocument.AntTask at) {
at.setId(new Integer(id)); at.setId(new Integer(id));
XmlCursor cursor = at.newCursor();
if (fileName != null){ if (fileName != null){
at.setFilename(fileName); at.setFilename(fileName);
} }
else if (cursor.toChild(xmlNs, "Filename")) {
cursor.removeXml();
}
if (execOrder != null) { if (execOrder != null) {
at.setAntCmdOptions(execOrder); at.setAntCmdOptions(execOrder);
} }
else if (cursor.toChild(xmlNs, "AntCmdOptions")) {
cursor.removeXml();
}
cursor.dispose();
} }
public void removeBuildOptionsUserDefAntTask(int i) { public void removeBuildOptionsUserDefAntTask(int i) {
@ -1350,7 +1377,14 @@ public class FpdFileContents {
opt.setTagName(tagName); opt.setTagName(tagName);
opt.setToolCode(toolCmd); opt.setToolCode(toolCmd);
opt.setSupArchList(archList); if (archList != null) {
opt.setSupArchList(archList);
}
else {
if (opt.isSetSupArchList()) {
opt.unsetSupArchList();
}
}
} }
public void removeBuildOptionsOpt(int i){ public void removeBuildOptionsOpt(int i){
@ -1783,7 +1817,16 @@ public class FpdFileContents {
} }
public void setPlatformDefsSupportedArchs(Vector<Object> archs) { public void setPlatformDefsSupportedArchs(Vector<Object> archs) {
getfpdPlatformDefs().setSupportedArchitectures(archs); if (archs != null) {
getfpdPlatformDefs().setSupportedArchitectures(archs);
}
// else {
// XmlCursor cursor = getfpdPlatformDefs().newCursor();
// if (cursor.toChild(xmlNs, "SupportedArchitectures")) {
// cursor.removeXml();
// }
// cursor.dispose();
// }
} }
public void getPlatformDefsBuildTargets(Vector<Object> targets) { public void getPlatformDefsBuildTargets(Vector<Object> targets) {

View File

@ -27,6 +27,7 @@ import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.Vector;
public class FpdFrameworkModules extends IInternalFrame { public class FpdFrameworkModules extends IInternalFrame {
@ -56,7 +57,7 @@ public class FpdFrameworkModules extends IInternalFrame {
private FpdFileContents ffc = null; private FpdFileContents ffc = null;
private OpeningPlatformType docConsole = null; private OpeningPlatformType docConsole = null;
private Map<String, String> fpdMsa = null; private Map<String, ArrayList<String>> fpdMsa = null;
private ArrayList<ModuleIdentification> miList = null; private ArrayList<ModuleIdentification> miList = null;
@ -137,10 +138,10 @@ public class FpdFrameworkModules extends IInternalFrame {
jTable = new JTable(model); jTable = new JTable(model);
jTable.setRowHeight(20); jTable.setRowHeight(20);
model.addColumn("ModuleName"); model.addColumn("ModuleName");
model.addColumn("ModuleGUID");
model.addColumn("ModuleVersion"); model.addColumn("ModuleVersion");
model.addColumn("PackageGUID"); model.addColumn("PackageName");
model.addColumn("PackageVersion"); model.addColumn("PackageVersion");
model.addColumn("Path");
jTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); jTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
} }
@ -180,34 +181,68 @@ public class FpdFrameworkModules extends IInternalFrame {
return; return;
} }
String mg = (String)model.getValueAt(selectedRow, 1); String path = model.getValueAt(selectedRow, 4)+"";
String mv = (String)model.getValueAt(selectedRow, 2); ModuleIdentification mi = miList.get(selectedRow);
String pg = (String)model.getValueAt(selectedRow, 3); Vector<String> vArchs = null;
String pv = (String)model.getValueAt(selectedRow, 4); try {
if (fpdMsa.containsKey(mg + mv + pg + pv)) { vArchs = GlobalData.getModuleSupArchs(mi);
}
catch (Exception exp) {
JOptionPane.showMessageDialog(frame, exp.getMessage());
}
if (vArchs == null) {
JOptionPane.showMessageDialog(frame, "No supported Archs specified in MSA file.");
return;
}
String archsAdded = "";
String mg = mi.getGuid();
String mv = mi.getVersion();
String pg = mi.getPackage().getGuid();
String pv = mi.getPackage().getVersion();
ArrayList<String> al = fpdMsa.get(mg + mv + pg + pv);
if (al == null) {
al = new ArrayList<String>();
fpdMsa.put(mg + mv + pg + pv, al);
}
for (int i = 0; i < al.size(); ++i) {
vArchs.remove(al.get(i));
}
//
// Archs this Module supported have already been added.
//
if (vArchs.size() == 0) {
JOptionPane.showMessageDialog(frame, "This Module Already Added."); JOptionPane.showMessageDialog(frame, "This Module Already Added.");
return; return;
} }
//ToDo put Arch instead of null //ToDo put Arch instead of null
fpdMsa.put(mg + mv + pg + pv, null); for (int i = 0; i < vArchs.size(); ++i) {
String arch = vArchs.get(i);
al.add(arch);
archsAdded += arch + " ";
String[] row = {"", mv, "", pv, arch, path};
if (mi != null) {
row[0] = mi.getName();
row[2] = mi.getPackage().getName();
}
model1.addRow(row);
docConsole.setSaved(false);
try{
//ToDo : specify archs need to add.
ffc.addFrameworkModulesPcdBuildDefs(mi, arch, null);
}
catch (Exception exception) {
JOptionPane.showMessageDialog(frame, "PCD Insertion Fail. " + exception.getMessage());
}
}
String[] row = {" ", mg, mv, pg, pv};
ModuleIdentification mi = getModuleId(mg + " " + mv + " " + pg + " " + pv);
if (mi != null) {
row[0] = mi.getName();
row[2] = mi.getVersion();
row[4] = mi.getPackage().getVersion();
}
model1.addRow(row);
docConsole.setSaved(false); JOptionPane.showMessageDialog(frame, "This Module with Arch "+ archsAdded +" Added Successfully.");
try{
ffc.addFrameworkModulesPcdBuildDefs(mi, null);
}
catch (Exception exception) {
JOptionPane.showMessageDialog(frame, "PCD Insertion Fail. " + exception.getMessage());
}
JOptionPane.showMessageDialog(frame, "This Module Added Successfully.");
jTable1.changeSelection(model1.getRowCount()-1, 0, false, false); jTable1.changeSelection(model1.getRowCount()-1, 0, false, false);
} }
}); });
@ -257,11 +292,11 @@ public class FpdFrameworkModules extends IInternalFrame {
jTable1 = new JTable(model1); jTable1 = new JTable(model1);
jTable1.setRowHeight(20); jTable1.setRowHeight(20);
model1.addColumn("ModuleName"); model1.addColumn("ModuleName");
model1.addColumn("ModuleGUID");
model1.addColumn("ModuleVersion"); model1.addColumn("ModuleVersion");
model1.addColumn("PackageGUID"); model1.addColumn("PackageName");
model1.addColumn("PackageVersion"); model1.addColumn("PackageVersion");
// model1.addColumn("SupportedArch"); model1.addColumn("SupportedArch");
model1.addColumn("Path");
jTable1.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); jTable1.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
} }
@ -288,11 +323,14 @@ public class FpdFrameworkModules extends IInternalFrame {
settingDlg = new FpdModuleSA(ffc); settingDlg = new FpdModuleSA(ffc);
} }
docConsole.setSaved(false); docConsole.setSaved(false);
String mg = model1.getValueAt(selectedRow, 1)+""; String[] sa = new String[5];
String mv = model1.getValueAt(selectedRow, 2)+""; ffc.getFrameworkModuleInfo(selectedRow, sa);
String pg = model1.getValueAt(selectedRow, 3)+""; String mg = sa[0];
String pv = model1.getValueAt(selectedRow, 4)+""; String mv = sa[1];
settingDlg.setKey(mg + " " + mv + " " + pg + " " + pv, selectedRow); String pg = sa[2];
String pv = sa[3];
String arch = sa[4];
settingDlg.setKey(mg + " " + mv + " " + pg + " " + pv + " " + arch, selectedRow);
settingDlg.setVisible(true); settingDlg.setVisible(true);
} }
}); });
@ -316,12 +354,30 @@ public class FpdFrameworkModules extends IInternalFrame {
if (selectedRow < 0){ if (selectedRow < 0){
return; return;
} }
String mg = model1.getValueAt(selectedRow, 1).toString(); String[] sa = new String[5];
String mv = model1.getValueAt(selectedRow, 2).toString(); ffc.getFrameworkModuleInfo(selectedRow, sa);
String pg = model1.getValueAt(selectedRow, 3).toString(); String mg = sa[0];
String pv = model1.getValueAt(selectedRow, 4).toString(); String mv = sa[1];
String pg = sa[2];
String pv = sa[3];
String arch = sa[4];
ModuleIdentification mi = getModuleId(sa[0] + " " + sa[1] + " " + sa[2] + " " + sa[3] + " " + sa[4]);
mv = mi.getVersion();
pv = mi.getPackage().getVersion();
model1.removeRow(selectedRow); model1.removeRow(selectedRow);
fpdMsa.remove(mg+mv+pg+pv); if (arch == null) {
// if no arch specified in ModuleSA
fpdMsa.remove(mg+mv+pg+pv);
}
else {
ArrayList<String> al = fpdMsa.get(mg+mv+pg+pv);
al.remove(arch);
if (al.size() == 0) {
fpdMsa.remove(mg+mv+pg+pv);
}
}
docConsole.setSaved(false); docConsole.setSaved(false);
ffc.removeModuleSA(selectedRow); ffc.removeModuleSA(selectedRow);
} }
@ -371,21 +427,36 @@ public class FpdFrameworkModules extends IInternalFrame {
} }
if (fpdMsa == null) { if (fpdMsa == null) {
fpdMsa = new HashMap<String, String>(); fpdMsa = new HashMap<String, ArrayList<String>>();
} }
if (ffc.getFrameworkModulesCount() > 0) { if (ffc.getFrameworkModulesCount() > 0) {
String[][] saa = new String[ffc.getFrameworkModulesCount()][5]; String[][] saa = new String[ffc.getFrameworkModulesCount()][5];
ffc.getFrameworkModulesInfo(saa); ffc.getFrameworkModulesInfo(saa);
for (int i = 0; i < saa.length; ++i) { for (int i = 0; i < saa.length; ++i) {
ModuleIdentification mi = getModuleId(saa[i][1]+ " "+saa[i][2]+" "+saa[i][3]+" "+saa[i][4]); ModuleIdentification mi = getModuleId(saa[i][0]+ " "+saa[i][1]+" "+saa[i][2]+" "+saa[i][3]);
String[] row = {"", "", "", "", "", ""};
if (mi != null) { if (mi != null) {
saa[i][0] = mi.getName(); row[0] = mi.getName();
saa[i][2] = mi.getVersion(); row[1] = mi.getVersion();
saa[i][4] = mi.getPackage().getVersion(); row[2] = mi.getPackage().getName();
row[3] = mi.getPackage().getVersion();
row[4] = saa[i][4];
try{
row[5] = GlobalData.getMsaFile(mi).getPath().substring(System.getenv("WORKSPACE").length() + 1);
}
catch (Exception e) {
JOptionPane.showMessageDialog(frame, "ShowFPDModules:" + e.getMessage());
}
} }
model1.addRow(saa[i]); model1.addRow(row);
fpdMsa.put(saa[i][1]+saa[i][2]+saa[i][3]+saa[i][4], saa[i][0]); ArrayList<String> al = fpdMsa.get(saa[i][0]+row[1]+saa[i][2]+row[3]);
if (al == null) {
al = new ArrayList<String>();
fpdMsa.put(saa[i][0]+row[1]+saa[i][2]+row[3], al);
}
al.add(saa[i][4]);
} }
} }
@ -404,15 +475,21 @@ public class FpdFrameworkModules extends IInternalFrame {
while(ispi.hasNext()) { while(ispi.hasNext()) {
PackageIdentification pi = (PackageIdentification)ispi.next(); PackageIdentification pi = (PackageIdentification)ispi.next();
String[] s = {"", "", "", "", ""}; String[] s = {"", "", "", "", ""};
s[3] = pi.getGuid();
s[4] = pi.getVersion();
Set<ModuleIdentification> smi = GlobalData.getModules(pi); Set<ModuleIdentification> smi = GlobalData.getModules(pi);
Iterator ismi = smi.iterator(); Iterator ismi = smi.iterator();
while(ismi.hasNext()) { while(ismi.hasNext()) {
ModuleIdentification mi = (ModuleIdentification)ismi.next(); ModuleIdentification mi = (ModuleIdentification)ismi.next();
s[0] = mi.getName(); s[0] = mi.getName();
s[1] = mi.getGuid(); s[1] = mi.getVersion();
s[2] = mi.getVersion(); s[2] = pi.getName();
s[3] = pi.getVersion();
try {
s[4] = GlobalData.getMsaFile(mi).getPath().substring(System.getenv("WORKSPACE").length() + 1);
}
catch (Exception e) {
JOptionPane.showMessageDialog(frame, "ShowAllModules:" + e.getMessage());
}
model.addRow(s); model.addRow(s);
miList.add(mi); miList.add(mi);
} }
@ -433,7 +510,7 @@ public class FpdFrameworkModules extends IInternalFrame {
private ModuleIdentification getModuleId(String key){ private ModuleIdentification getModuleId(String key){
// //
// Get ModuleGuid, ModuleVersion, PackageGuid, PackageVersion into string array. // Get ModuleGuid, ModuleVersion, PackageGuid, PackageVersion, Arch into string array.
// //
String[] keyPart = key.split(" "); String[] keyPart = key.split(" ");
Set<PackageIdentification> spi = GlobalData.getPackageList(); Set<PackageIdentification> spi = GlobalData.getPackageList();

View File

@ -131,6 +131,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
public void setKey(String k, int i){ public void setKey(String k, int i){
this.moduleKey = k; this.moduleKey = k;
jTabbedPane.setSelectedIndex(0); jTabbedPane.setSelectedIndex(0);
initPcdBuildDefinition(i); initPcdBuildDefinition(i);
} }
@ -158,7 +159,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
// //
// display library classes that need to be resolved. also potential instances for them. // display library classes that need to be resolved. also potential instances for them.
// //
resolveLibraryInstances(key); resolveLibraryInstances(moduleKey);
// //
// display lib instances already selected for key // display lib instances already selected for key
// //
@ -201,6 +202,13 @@ public class FpdModuleSA extends JDialog implements ActionListener {
if (ffsKey != null) { if (ffsKey != null) {
jTextField2.setText(ffsKey); jTextField2.setText(ffsKey);
} }
optionsTableModel.setRowCount(0);
String[][] saa = new String[ffc.getModuleSAOptionsCount(key)][6];
ffc.getModuleSAOptions(key, saa);
for (int i = 0; i < saa.length; ++i) {
optionsTableModel.addRow(saa[i]);
}
} }
private void resolveLibraryInstances(String key) { private void resolveLibraryInstances(String key) {
@ -316,7 +324,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
// //
// remove pcd information of instance from current ModuleSA // remove pcd information of instance from current ModuleSA
// //
ffc.removePcdData(moduleKey, mi); ffc.removePcdData(key, mi);
// //
// remove class produced by this instance and add back these produced class to be bound. // remove class produced by this instance and add back these produced class to be bound.
// //
@ -349,7 +357,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
private ModuleIdentification getModuleId(String key){ private ModuleIdentification getModuleId(String key){
// //
// Get ModuleGuid, ModuleVersion, PackageGuid, PackageVersion into string array. // Get ModuleGuid, ModuleVersion, PackageGuid, PackageVersion, Arch into string array.
// //
String[] keyPart = key.split(" "); String[] keyPart = key.split(" ");
Set<PackageIdentification> spi = GlobalData.getPackageList(); Set<PackageIdentification> spi = GlobalData.getPackageList();
@ -357,16 +365,26 @@ public class FpdModuleSA extends JDialog implements ActionListener {
while(ispi.hasNext()) { while(ispi.hasNext()) {
PackageIdentification pi = (PackageIdentification)ispi.next(); PackageIdentification pi = (PackageIdentification)ispi.next();
if ( !pi.getGuid().equals(keyPart[2])){ if ( !pi.getGuid().equals(keyPart[2])){
// || !pi.getVersion().equals(keyPart[3])){
continue; continue;
} }
if (keyPart[3] != null && keyPart[3].length() > 0 && !keyPart[3].equals("null")){
if(!pi.getVersion().equals(keyPart[3])){
continue;
}
}
Set<ModuleIdentification> smi = GlobalData.getModules(pi); Set<ModuleIdentification> smi = GlobalData.getModules(pi);
Iterator ismi = smi.iterator(); Iterator ismi = smi.iterator();
while(ismi.hasNext()) { while(ismi.hasNext()) {
ModuleIdentification mi = (ModuleIdentification)ismi.next(); ModuleIdentification mi = (ModuleIdentification)ismi.next();
if (mi.getGuid().equals(keyPart[0])){ if (mi.getGuid().equals(keyPart[0])){
// && mi.getVersion().equals(keyPart[1])){ if (keyPart[1] != null && keyPart[1].length() > 0 && !keyPart[1].equals("null")){
if(!mi.getVersion().equals(keyPart[1])){
continue;
}
}
return mi; return mi;
} }
} }
@ -745,7 +763,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
private JPanel getJPanel4() { private JPanel getJPanel4() {
if (jPanel4 == null) { if (jPanel4 == null) {
jLabel1 = new JLabel(); jLabel1 = new JLabel();
jLabel1.setText("Library Classes Consumed"); jLabel1.setText("Library Classes Uninstantiated");
jPanel4 = new JPanel(); jPanel4 = new JPanel();
jPanel4.add(jLabel1, null); jPanel4.add(jLabel1, null);
jPanel4.add(getJScrollPane3(), null); jPanel4.add(getJScrollPane3(), null);
@ -1000,7 +1018,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
// Add pcd information of selected instance to current moduleSA // Add pcd information of selected instance to current moduleSA
// //
try{ try{
ffc.addFrameworkModulesPcdBuildDefs(getModuleId(instanceValue), ffc.getModuleSA(moduleKey)); ffc.addFrameworkModulesPcdBuildDefs(getModuleId(instanceValue), null, ffc.getModuleSA(moduleKey));
} }
catch (Exception exception) { catch (Exception exception) {
JOptionPane.showMessageDialog(frame, "PCD Insertion Fail. " + exception.getMessage()); JOptionPane.showMessageDialog(frame, "PCD Insertion Fail. " + exception.getMessage());
@ -1073,14 +1091,12 @@ public class FpdModuleSA extends JDialog implements ActionListener {
public void actionPerformed(ActionEvent arg0) { public void actionPerformed(ActionEvent arg0) {
if (arg0.getSource() == jButton2) { if (arg0.getSource() == jButton2) {
// ffc.removeLibraryInstances(moduleKey); if (jTable4.isEditing()) {
// for (int i = 0; i < model1.getRowCount(); ++i) { jTable4.getCellEditor().stopCellEditing();
// String mg = model1.getValueAt(i, 1)+""; }
// String mv = model1.getValueAt(i, 2)+""; ffc.setFvBinding(moduleKey, jTextField.getText());
// String pg = model1.getValueAt(i, 3)+""; ffc.setFfsFileNameGuid(moduleKey, jTextField1.getText());
// String pv = model1.getValueAt(i, 4)+""; ffc.setFfsFormatKey(moduleKey, jTextField2.getText());
// ffc.genLibraryInstance(mg, mv, pg, pv, moduleKey);
// }
this.setVisible(false); this.setVisible(false);
} }
} }
@ -1124,11 +1140,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
if (jTextField == null) { if (jTextField == null) {
jTextField = new JTextField(); jTextField = new JTextField();
jTextField.setPreferredSize(new java.awt.Dimension(100,20)); jTextField.setPreferredSize(new java.awt.Dimension(100,20));
jTextField.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusLost(java.awt.event.FocusEvent e) {
ffc.setFvBinding(moduleKey, jTextField.getText());
}
});
} }
return jTextField; return jTextField;
} }
@ -1141,11 +1153,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
if (jTextField1 == null) { if (jTextField1 == null) {
jTextField1 = new JTextField(); jTextField1 = new JTextField();
jTextField1.setPreferredSize(new java.awt.Dimension(100,20)); jTextField1.setPreferredSize(new java.awt.Dimension(100,20));
jTextField1.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusLost(java.awt.event.FocusEvent e) {
ffc.setFfsFileNameGuid(moduleKey, jTextField1.getText());
}
});
} }
return jTextField1; return jTextField1;
} }
@ -1158,11 +1166,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
if (jTextField2 == null) { if (jTextField2 == null) {
jTextField2 = new JTextField(); jTextField2 = new JTextField();
jTextField2.setPreferredSize(new java.awt.Dimension(100,20)); jTextField2.setPreferredSize(new java.awt.Dimension(100,20));
jTextField2.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusLost(java.awt.event.FocusEvent e) {
ffc.setFfsFormatKey(moduleKey, jTextField2.getText());
}
});
} }
return jTextField2; return jTextField2;
} }
@ -1257,11 +1261,11 @@ public class FpdModuleSA extends JDialog implements ActionListener {
jButton4.setText("New"); jButton4.setText("New");
jButton4.addActionListener(new java.awt.event.ActionListener() { jButton4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) { public void actionPerformed(java.awt.event.ActionEvent e) {
String[] row = {"", "", "", "", "IA32", ""}; String[] row = {"", "", "", "", "", ""};
optionsTableModel.addRow(row); optionsTableModel.addRow(row);
Vector<Object> v = new Vector<Object>(); Vector<Object> v = new Vector<Object>();
Vector<Object> v1 = new Vector<Object>(); Vector<Object> v1 = null;
v1.add("IA32");
ffc.genModuleSAOptionsOpt(moduleKey, v, "", "", "", v1, ""); ffc.genModuleSAOptionsOpt(moduleKey, v, "", "", "", v1, "");
} }
}); });
@ -1443,7 +1447,7 @@ private void pcdNonDynamicToDynamic(String cName, String tsGuid) {
ArrayList<String> al = ffc.getDynPcdMapValue(cName + " " + tsGuid); ArrayList<String> al = ffc.getDynPcdMapValue(cName + " " + tsGuid);
for (int i = 0; i < al.size(); ++i) { for (int i = 0; i < al.size(); ++i) {
String[] s = al.get(i).split(" "); String[] s = al.get(i).split(" ");
String mKey = s[0] + s[1] + s[2] + s[3]; String mKey = s[0] + " " + s[1]+ " " + s[2] + " " + s[3];
ffc.updatePcdData(mKey, cName, tsGuid, jComboBox.getSelectedItem()+"", jTextField3.getText(), jTextField4.isVisible() ? jTextField4.getText() : jComboBox1.getSelectedItem()+""); ffc.updatePcdData(mKey, cName, tsGuid, jComboBox.getSelectedItem()+"", jTextField3.getText(), jTextField4.isVisible() ? jTextField4.getText() : jComboBox1.getSelectedItem()+"");
s[4] = jComboBox.getSelectedItem()+""; s[4] = jComboBox.getSelectedItem()+"";
al.set(i, s[0]+" "+s[1]+" "+s[2]+" "+s[3]+" "+s[4]); al.set(i, s[0]+" "+s[1]+" "+s[2]+" "+s[3]+" "+s[4]);

View File

@ -29,6 +29,7 @@ import java.awt.FlowLayout;
import javax.swing.JCheckBox; import javax.swing.JCheckBox;
import javax.swing.JOptionPane;
import javax.swing.JTextField; import javax.swing.JTextField;
import javax.swing.JLabel; import javax.swing.JLabel;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
@ -332,6 +333,7 @@ public class FpdPlatformDefs extends IInternalFrame {
if (jCheckBox6.isSelected()) { if (jCheckBox6.isSelected()) {
v.add("PPC"); v.add("PPC");
} }
} }
/** /**
@ -406,6 +408,10 @@ public class FpdPlatformDefs extends IInternalFrame {
public void itemStateChanged(java.awt.event.ItemEvent e) { public void itemStateChanged(java.awt.event.ItemEvent e) {
Vector<Object> v = new Vector<Object>(); Vector<Object> v = new Vector<Object>();
getToolChain(v); getToolChain(v);
if (v.size() == 0) {
JOptionPane.showMessageDialog(frame, "Platform must contain at least ONE supported Arch.");
return;
}
ffc.setPlatformDefsSupportedArchs(v); ffc.setPlatformDefsSupportedArchs(v);
} }
}); });
@ -426,6 +432,10 @@ public class FpdPlatformDefs extends IInternalFrame {
public void itemStateChanged(java.awt.event.ItemEvent e) { public void itemStateChanged(java.awt.event.ItemEvent e) {
Vector<Object> v = new Vector<Object>(); Vector<Object> v = new Vector<Object>();
getToolChain(v); getToolChain(v);
if (v.size() == 0) {
JOptionPane.showMessageDialog(frame, "Platform must contain at least ONE supported Arch.");
return;
}
ffc.setPlatformDefsSupportedArchs(v); ffc.setPlatformDefsSupportedArchs(v);
} }
}); });
@ -446,6 +456,10 @@ public class FpdPlatformDefs extends IInternalFrame {
public void itemStateChanged(java.awt.event.ItemEvent e) { public void itemStateChanged(java.awt.event.ItemEvent e) {
Vector<Object> v = new Vector<Object>(); Vector<Object> v = new Vector<Object>();
getToolChain(v); getToolChain(v);
if (v.size() == 0) {
JOptionPane.showMessageDialog(frame, "Platform must contain at least ONE supported Arch.");
return;
}
ffc.setPlatformDefsSupportedArchs(v); ffc.setPlatformDefsSupportedArchs(v);
} }
}); });
@ -700,6 +714,10 @@ public class FpdPlatformDefs extends IInternalFrame {
public void itemStateChanged(java.awt.event.ItemEvent e) { public void itemStateChanged(java.awt.event.ItemEvent e) {
Vector<Object> v = new Vector<Object>(); Vector<Object> v = new Vector<Object>();
getToolChain(v); getToolChain(v);
if (v.size() == 0) {
JOptionPane.showMessageDialog(frame, "Platform must contain at least ONE supported Arch.");
return;
}
ffc.setPlatformDefsSupportedArchs(v); ffc.setPlatformDefsSupportedArchs(v);
} }
}); });
@ -717,10 +735,15 @@ public class FpdPlatformDefs extends IInternalFrame {
jCheckBox5 = new JCheckBox(); jCheckBox5 = new JCheckBox();
jCheckBox5.setPreferredSize(new java.awt.Dimension(52,20)); jCheckBox5.setPreferredSize(new java.awt.Dimension(52,20));
jCheckBox5.setText("ARM"); jCheckBox5.setText("ARM");
jCheckBox5.setVisible(false);
jCheckBox5.addItemListener(new java.awt.event.ItemListener() { jCheckBox5.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent e) { public void itemStateChanged(java.awt.event.ItemEvent e) {
Vector<Object> v = new Vector<Object>(); Vector<Object> v = new Vector<Object>();
getToolChain(v); getToolChain(v);
if (v.size() == 0) {
JOptionPane.showMessageDialog(frame, "Platform must contain at least ONE supported Arch.");
return;
}
ffc.setPlatformDefsSupportedArchs(v); ffc.setPlatformDefsSupportedArchs(v);
} }
}); });
@ -738,10 +761,15 @@ public class FpdPlatformDefs extends IInternalFrame {
jCheckBox6 = new JCheckBox(); jCheckBox6 = new JCheckBox();
jCheckBox6.setPreferredSize(new Dimension(50, 20)); jCheckBox6.setPreferredSize(new Dimension(50, 20));
jCheckBox6.setText("PPC"); jCheckBox6.setText("PPC");
jCheckBox6.setVisible(false);
jCheckBox6.addItemListener(new java.awt.event.ItemListener() { jCheckBox6.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent e) { public void itemStateChanged(java.awt.event.ItemEvent e) {
Vector<Object> v = new Vector<Object>(); Vector<Object> v = new Vector<Object>();
getToolChain(v); getToolChain(v);
if (v.size() == 0) {
JOptionPane.showMessageDialog(frame, "Platform must contain at least ONE supported Arch.");
return;
}
ffc.setPlatformDefsSupportedArchs(v); ffc.setPlatformDefsSupportedArchs(v);
} }
}); });

View File

@ -32,8 +32,10 @@ import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.ListIterator;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.Vector;
import java.util.logging.Logger; import java.util.logging.Logger;
/** /**
@ -96,45 +98,6 @@ public class GlobalData {
/// ///
private static Set<FpdModuleIdentification> builtModules = new HashSet<FpdModuleIdentification>(); private static Set<FpdModuleIdentification> builtModules = new HashSet<FpdModuleIdentification>();
///
/// PCD memory database stored all PCD information which collected from FPD,MSA and SPD.
///
// private static final MemoryDatabaseManager pcdDbManager = new MemoryDatabaseManager();
///
/// build target + tool chain family/tag name + arch + command types + command options
///
private static Map<String, Object> toolChainOptions;
private static Map<String, Object> toolChainFamilyOptions;
private static Map<String, String> toolChainDefinitions;
///
///
///
private static Set<String> targets;
///
///
///
private static Set<String> toolChainFamilies;
///
///
///
private static Set<String> toolChains;
///
/// keep track which toolchain family a toolchain tag belongs to
///
private static Map<String, Set<String>> toolChainFamilyMap;
private static Map<String, Set<String>> toolChainCommandMap;
///
/// list of Arch: EBC, ARM, IA32, X64, IPF, PPC
///
private static Set<String> archs;
///
/// list of Command Type: CC, LIB, LINK, ASL, ASM, ASMLINK, PP
///
private static Set<String> commandTypes;
/** /**
Parse framework database (DB) and all SPD files listed in DB to initialize Parse framework database (DB) and all SPD files listed in DB to initialize
the environment for next build. This method will only be executed only once the environment for next build. This method will only be executed only once
@ -465,134 +428,24 @@ public class GlobalData {
return result; return result;
} }
////// Tool Chain Related, try to refine and put some logic process to ToolChainFactory
public static void setBuildToolChainFamilyOptions(Map<String, Object> map) { public static Vector<String> getModuleSupArchs(ModuleIdentification mi) throws Exception{
toolChainFamilyOptions = map; Vector<String> vArchs = null;
} ModuleSurfaceAreaDocument.ModuleSurfaceArea msa = (ModuleSurfaceAreaDocument.ModuleSurfaceArea)getModuleXmlObject(mi);
if (msa.getModuleDefinitions() == null || msa.getModuleDefinitions().getSupportedArchitectures() == null) {
public static Map<String, Object> getToolChainFamilyOptions() { return vArchs;
return toolChainFamilyOptions; }
} ListIterator li = msa.getModuleDefinitions().getSupportedArchitectures().listIterator();
while (li.hasNext()) {
public static void setBuildToolChainOptions(Map<String, Object> map) { if (vArchs == null) {
toolChainOptions = map; vArchs = new Vector<String>();
}
public static Map<String, Object> getToolChainOptions() {
return toolChainOptions;
}
public static void setTargets(Set<String> targetSet) {
GlobalData.log.info("TargetSet: " + targetSet);
targets = targetSet;
}
public static String[] getTargets() {
return (String[])targets.toArray(new String[targets.size()]);
}
public static void setToolChains(Set<String> toolChainSet) {
toolChains = toolChainSet;
}
public static String[] getToolChains() {
String[] toolChainList = new String[toolChains.size()];
return (String[])toolChains.toArray(toolChainList);
}
public static void setToolChainFamilies(Set<String> toolChainFamilySet) {
toolChainFamilies = toolChainFamilySet;
}
public static void setToolChainFamiliyMap(Map<String, Set<String>> map) {
/*
Set<String> keys = map.keySet();
Iterator it = keys.iterator();
while (it.hasNext()) {
String toolchain = (String)it.next();
Set<String> familyMap = (Set<String>)map.get(toolchain);
Iterator fit = familyMap.iterator();
System.out.print(toolchain + ": ");
while (fit.hasNext()) {
System.out.print((String)fit.next() + " ");
} }
System.out.println(""); vArchs.add((String)li.next());
} }
*/
toolChainFamilyMap = map; return vArchs;
} }
public static String[] getToolChainFamilies() {
String[] toolChainFamilyList = new String[toolChainFamilies.size()];
return (String[])toolChainFamilies.toArray(toolChainFamilyList);
}
public static String[] getToolChainFamilies(String toolChain) {
Set<String> familySet = (Set<String>)toolChainFamilyMap.get(toolChain);
String[] toolChainFamilyList = new String[familySet.size()];
return (String[])familySet.toArray(toolChainFamilyList);
}
public static Set<String> getToolChainFamilySet(String toolChain) {
return (Set<String>)toolChainFamilyMap.get(toolChain);
}
public static void setArchs(Set<String> archSet) {
archs = archSet;
}
public static String[] getArchs() {
String[] archList = new String[archs.size()];
return (String[])archs.toArray(archList);
}
/*
*/
public static void SetCommandTypes(Set<String> commandTypeSet) {
commandTypes = commandTypeSet;
}
/*
*/
public static void SetCommandTypes(Map<String, Set<String>> commandTypeMap) {
toolChainCommandMap = commandTypeMap;
}
/*
*/
public static String[] getCommandTypes() {
String[] commandList = new String[commandTypes.size()];
return (String[])commandTypes.toArray(commandList);
}
/*
*/
public static String[] getCommandTypes(String toolChain) {
Set<String> commands = (Set<String>)toolChainCommandMap.get(toolChain);
if (commands == null) {
return new String[0];
}
String[] commandList = new String[commands.size()];
return (String[])commands.toArray(commandList);
}
/*
*/
public static String getCommandSetting(String commandDescString) {
return (String)toolChainDefinitions.get(commandDescString);
}
/*
*/
public static void setToolChainDefinitions(Map<String, String> def) {
toolChainDefinitions = def;
}
public static Map<String, String> getToolChainDefinitions() {
return toolChainDefinitions;
}
} }
final class KeyComparator implements Comparator<String> { final class KeyComparator implements Comparator<String> {