1.SpdHeader, FpdHeader not save specification.
2.  PackageSurfaceArea.LibraryClassDeclarations Show Recommended Library Instance UiName, not the GUID.
PackageSurfaceArea.MsaFiles - make table fill the window.
3.   PlatformSurfaceArea.PlatformDefinitions.IntermediateDirectories Do NOT create EMPTY <OutputDirectory/>
4.   Do NOT create EMPTY <FrameworkModules/> 
5.   When adding a module, pop up the module settings to let you know that you have added the module.

6.  PlatformSurfaceArea.BuildOptions.Options.Option Do not require ToolFamily - default should be not specified.
	
7.  PlatformSurfaceArea.BuildOptions.UserDefinedAntTasks 
Ant Task File should have a browse button
Id column should only be width of 8 characters.


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@944 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jlin16 2006-07-13 03:36:11 +00:00
parent 19689a077c
commit 12e17a0aee
7 changed files with 72 additions and 273 deletions

View File

@ -502,7 +502,7 @@ public class SpdHeader extends IInternalFrame {
if (sfc.getSpdHdrSpec() != null) {
jTextFieldSpecification.setText(sfc.getSpdHdrSpec());
}
sfc.setSpdHdrSpec(jTextFieldSpecification.getText());
}
/**

View File

@ -270,7 +270,7 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
String lib = m.getValueAt(row, 0) + "";
String hdr = m.getValueAt(row, 1) + "";
String hlp = m.getValueAt(row, 2) + "";
String guid = m.getValueAt(row, 3) + "";
String name = m.getValueAt(row, 3) + "";
String ver = m.getValueAt(row, 4) + "";
String arch = null;
if (m.getValueAt(row, 5) != null) {
@ -285,6 +285,10 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
return;
}
docConsole.setSaved(false);
getLibInstances(lib);
String guid = nameToGuid(name);
sfc.updateSpdLibClass(row, lib, hdr, hlp, guid, ver, arch, module);
}
}
@ -389,6 +393,11 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
sfc.getSpdLibClassDeclarations(saa);
int i = 0;
while (i < saa.length) {
if (saa[i][3] != null && saa[i][3].length() > 0) {
getLibInstances(saa[i][0]);
saa[i][3] = guidToName(saa[i][3]);
}
model.addRow(saa[i]);
i++;
}
@ -528,7 +537,7 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
if (arg0.getSource() == jButtonAdd) {
//ToDo: check before add
String[] row = {null, null, null, jTextField1.getText(), jTextField2.getText(), null, null};
String[] row = {null, null, null, jComboBox.getSelectedItem()+"", jTextField2.getText(), null, null};
row[0] = jTextFieldAdd.getText();
row[1] = jTextField.getText().replace('\\', '/');
row[2] = jTextFieldHelp.getText();
@ -546,7 +555,12 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
model.addRow(row);
jTable.changeSelection(model.getRowCount()-1, 0, false, false);
docConsole.setSaved(false);
sfc.genSpdLibClassDeclarations(row[0], row[3], row[1], row[2], row[5], null, null, row[4], null, row[6]);
//
//convert to GUID before storing recommended lib instance.
//
getLibInstances(row[0]);
String recommendGuid = nameToGuid(row[3]);
sfc.genSpdLibClassDeclarations(row[0], recommendGuid, row[1], row[2], row[5], null, null, row[4], null, row[6]);
}
//
@ -847,6 +861,32 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
}
private String nameToGuid(String name) {
String s = "";
if (!libNameGuidMap.containsKey(name)) {
return s;
}
s = libNameGuidMap.get(name);
return s;
}
private String guidToName(String guid){
String s = "";
if (!libNameGuidMap.containsValue(guid)) {
return s;
}
Set<String> key = libNameGuidMap.keySet();
Iterator<String> is = key.iterator();
while(is.hasNext()) {
s = is.next();
if (libNameGuidMap.get(s).equals(guid)) {
break;
}
}
return s;
}
}

View File

@ -213,26 +213,16 @@ public class FpdFileContents {
while(li.hasNext()) {
ModuleSADocument.ModuleSA msa = (ModuleSADocument.ModuleSA)li.next();
if (msa.getModuleGuid().equals(s[0]) && msa.getPackageGuid().equals(s[2])) {
// if (msa.getModuleVersion() != null) {
// if (!msa.getModuleVersion().equals(s[1])) {
// continue;
// }
// }
// else{
// if (s[1] != null) {
// continue;
// }
// }
// if (msa.getPackageVersion() != null) {
// if (!msa.getPackageVersion().equals(s[3])) {
// continue;
// }
// }
// else{
// if (s[3] != null) {
// continue;
// }
// }
if (msa.getModuleVersion() != null) {
if (!msa.getModuleVersion().equals(s[1])) {
continue;
}
}
if (msa.getPackageVersion() != null) {
if (!msa.getPackageVersion().equals(s[3])) {
continue;
}
}
return msa;
}
}

View File

@ -442,15 +442,24 @@ public class FpdFrameworkModules extends IInternalFrame {
while(ispi.hasNext()) {
PackageIdentification pi = (PackageIdentification)ispi.next();
if ( !pi.getGuid().equals(keyPart[2])){
// || !pi.getVersion().equals(keyPart[3])){
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);
Iterator ismi = smi.iterator();
while(ismi.hasNext()) {
ModuleIdentification mi = (ModuleIdentification)ismi.next();
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;
}

View File

@ -508,7 +508,7 @@ public class FpdHeader extends IInternalFrame {
if (ffc.getFpdHdrSpec() != null) {
jTextFieldSpecification.setText(ffc.getFpdHdrSpec());
}
ffc.setFpdHdrSpec(jTextFieldSpecification.getText());
}
/**

View File

@ -406,120 +406,6 @@ public class GlobalData {
}
}
/**
The header file path is relative to workspace dir
**/
public static String[] getLibraryClassHeaderFiles(PackageIdentification[] packages, String name) {
if (packages == null ){
// throw Exception or not????
return new String[0];
}
String[] result = null;
for (int i = 0; i < packages.length; i++){
Spd spd = spdTable.get(packages[i]);
//
// If find one package defined the library class
//
if( (result = spd.getLibClassIncluder(name)) != null){
return result;
}
}
return null;
}
/**
The header file path is relative to workspace dir
**/
public static String getPackageHeaderFiles(PackageIdentification packages, String moduleType) throws Exception {
if (packages == null ){
return new String("");
}
Spd spd = spdTable.get(packages);
//
// If can't find package header file, skip it
//
String temp = null;
if (spd != null){
if( (temp = spd.getPackageIncluder(moduleType)) != null){
return temp;
}else {
temp = "";
return temp;
}
}else {
return null;
}
}
/**
return two values: {cName, GuidValue}
**/
public static String[] getGuid(PackageIdentification[] packages, String name) throws Exception {
if (packages == null ){
// throw Exception or not????
return new String[0];
}
String[] result = null;
for (int i = 0; i < packages.length; i++){
Spd spd = spdTable.get(packages[i]);
//
// If find one package defined the GUID
//
if( (result = spd.getGuid(name)) != null){
return result;
}
}
return null;
}
/**
return two values: {cName, GuidValue}
**/
public static String[] getPpiGuid(PackageIdentification[] packages, String name) throws Exception {
if (packages == null ){
return new String[0];
}
String[] result = null;
for (int i = 0; i < packages.length; i++){
Spd spd = spdTable.get(packages[i]);
//
// If find one package defined the Ppi GUID
//
if( (result = spd.getPpi(name)) != null){
return result;
}
}
return null;
}
/**
return two values: {cName, GuidValue}
**/
public static String[] getProtocolGuid(PackageIdentification[] packages, String name) throws Exception {
if (packages == null ){
return new String[0];
}
String[] result = null;
for (int i = 0; i < packages.length; i++){
Spd spd = spdTable.get(packages[i]);
//
// If find one package defined the protocol GUID
//
if( (result = spd.getProtocol(name)) != null){
return result;
}
}
return null;
}
/////////////////////////// Update!! Update!! Update!!
// public synchronized static MemoryDatabaseManager getPCDMemoryDBManager() {
// return pcdDbManager;
// }
///////////////////////////
public synchronized static PlatformIdentification getPlatform(String name) throws Exception {
Iterator iter = platformList.iterator();
while(iter.hasNext()){

View File

@ -17,7 +17,6 @@ package org.tianocore.frameworkwizard.platform.ui.global;
import java.io.File;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
@ -35,42 +34,7 @@ public class Spd {
///
///
Map<ModuleIdentification, File> msaInfo = new HashMap<ModuleIdentification, File>();
///
/// Map of module info.
/// Key : moduletype
/// Value: moduletype related include file
///
Map<String, String> packageHeaderInfo = new HashMap<String, String>();
///
/// Map of PPI info.
/// Key : PPI name
/// value: String[] a. PPI C_NAME; b. PPI GUID;
///
Map<String, String[]> ppiInfo = new HashMap<String, String[]>();
///
/// Map of Protocol info.
/// Key : Protocol name
/// value: String[] a. Protocol C_NAME; b. Protocol GUID;
///
Map<String, String[]> protocolInfo = new HashMap<String, String[]>();
///
/// Map of Guid info.
/// Key : Guid name
/// value: String[] a. Guid C_NAME; b. Guid's GUID;
///
Map<String, String[]> guidInfo = new HashMap<String, String[]>();
///
/// Map of library class and its exposed header file.
/// Key : library class name
/// value : library class corresponding header file
///
Map<String, String[]> libClassHeaderList = new HashMap<String, String[]>();
//
// Xml Doc of Spd file, Msa file
//
@ -112,6 +76,9 @@ public class Spd {
String[] msaFilenames = SurfaceAreaQuery.getSpdMsaFile();
for (int i = 0; i < msaFilenames.length; i++){
File msaFile = new File(packageId.getPackageDir() + File.separatorChar + msaFilenames[i]);
if (!msaFile.exists()) {
continue;
}
Map<String, XmlObject> msaDoc = GlobalData.getNativeMsa( msaFile );
SurfaceAreaQuery.push(msaDoc);
ModuleIdentification moduleId = SurfaceAreaQuery.getMsaHeader();
@ -120,57 +87,10 @@ public class Spd {
msaInfo.put(moduleId, msaFile);
msaDocMap.put(moduleId, msaDoc.get("ModuleSurfaceArea"));
}
//
// initialize Package header files
//
// Map<String, String> packageHeaders = SurfaceAreaQuery.getSpdPackageHeaderFiles();
// Set keys = packageHeaders.keySet();
// Iterator iter = keys.iterator();
// while (iter.hasNext()){
// String moduleType = (String)iter.next();
// String header = packageId.getPackageRelativeDir() + File.separatorChar + packageHeaders.get(moduleType);
// //
// // Change path seperator to system-dependent path separator
// //
// File file = new File (header);
// header = file.getParent();
// packageHeaderInfo.put(moduleType, header);
// }
//
// initialize Guid Info
//
guidInfo.putAll(SurfaceAreaQuery.getSpdGuid());
//
// initialize PPI info
//
ppiInfo.putAll(SurfaceAreaQuery.getSpdPpi());
//
// initialize Protocol info
//
protocolInfo.putAll(SurfaceAreaQuery.getSpdProtocol());
//
// initialize library class declaration
//
Map<String, String[]> libraryClassHeaders = SurfaceAreaQuery.getSpdLibraryClasses();
Set<String> keys = libraryClassHeaders.keySet();
Iterator iter = keys.iterator();
while (iter.hasNext()){
String libraryClassName = (String)iter.next();
String[] headerFiles = libraryClassHeaders.get(libraryClassName);
for (int i = 0; i < headerFiles.length; i++){
headerFiles[i] = packageId.getPackageRelativeDir() + File.separatorChar + headerFiles[i];
//
// Change path separator to system system-dependent path separator.
//
File file = new File (headerFiles[i]);
headerFiles[i] = file.getPath();
}
libClassHeaderList.put(libraryClassName, headerFiles);
}
}
catch (Exception e) {
e.setStackTrace(e.getStackTrace());
throw new Exception("Parse package description file [" + packageId.getSpdFile() + "] Error.\n"
+ e.getMessage());
}
@ -187,51 +107,5 @@ public class Spd {
public Set<ModuleIdentification> getModules(){
return msaInfo.keySet();
}
/**
return two value {CName, Guid}. If not found, return null.
**/
public String[] getPpi(String ppiName) {
return ppiInfo.get(ppiName);
}
/**
return two value {CName, Guid}. If not found, return null.
**/
public String[] getProtocol(String protocolName) {
return protocolInfo.get(protocolName);
}
/**
return two value {CName, Guid}. If not found, return null.
**/
public String[] getGuid(String guidName) {
return guidInfo.get(guidName);
}
/**
getLibClassInclude
This function is to get the library exposed header file name according
library class name.
@param libName Name of library class
@return Name of header file
**/
String[] getLibClassIncluder(String libName) {
return libClassHeaderList.get(libName);
}
/**
getModuleTypeIncluder
This function is to get the header file name from module info map
according to module type.
@param moduleType Module type.
@return Name of header file.
**/
String getPackageIncluder(String moduleType) {
return packageHeaderInfo.get(moduleType);
}
}