X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=Tools%2FJava%2FSource%2FFrameworkWizard%2Fsrc%2Forg%2Ftianocore%2Fframeworkwizard%2Fplatform%2Fui%2FFpdFileContents.java;h=d8dfb279ba59f2228a4fce57ceb13b79fb57ad91;hb=ceea362ed6c5e41ce78fbf8b9da8428c7f794136;hp=1c41daf1fec410d55b147f203cf98466e4409911;hpb=ed7aa83f2e64b8e6be0600b06e93fd3987a62fa6;p=mirror_edk2.git diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFileContents.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFileContents.java index 1c41daf1fe..d8dfb279ba 100644 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFileContents.java +++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFileContents.java @@ -62,6 +62,7 @@ import org.tianocore.frameworkwizard.platform.ui.global.WorkspaceProfile; import org.tianocore.frameworkwizard.platform.ui.global.SurfaceAreaQuery; import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification; import org.tianocore.frameworkwizard.packaging.PackageIdentification; +import org.tianocore.frameworkwizard.workspace.Workspace; /** This class processes fpd file contents such as add remove xml elements. @@ -426,7 +427,7 @@ public class FpdFileContents { if (nextMi == null) { continue; } - if (WorkspaceProfile.pcdInMsa(saaModuleSaPcd[i][0], saaModuleSaPcd[i][1], nextMi)) { + if (WorkspaceProfile.pcdInMsa(saaModuleSaPcd[i][0], saaModuleSaPcd[i][1], arch, nextMi)) { continue nextPcd; } } @@ -454,6 +455,13 @@ public class FpdFileContents { } } } + // Check sup arch conformance for the new PCD + if (msaPcd.getSupArchList() != null) { + String newPcdArch = msaPcd.getSupArchList().toString(); + if (!newPcdArch.toLowerCase().contains(arch.toLowerCase())) { + continue; + } + } PackageIdentification[] depPkgs = SurfaceAreaQuery.getDependencePkg(null, vMi.get(i)); PcdDeclarationsDocument.PcdDeclarations.PcdEntry spdPcd = LookupPcdDeclaration(msaPcd, depPkgs); @@ -685,7 +693,7 @@ public class FpdFileContents { int pcdSourceCount = 0; for (int i = 0; i < vMi.size(); ++i) { - if (WorkspaceProfile.pcdInMsa(cName, tsGuidCName, vMi.get(i))) { + if (WorkspaceProfile.pcdInMsa(cName, tsGuidCName, null, vMi.get(i))) { pcdSourceCount++; } } @@ -829,7 +837,7 @@ public class FpdFileContents { XmlCursor cursor = instance.newCursor(); try{ String comment = "Pkg: " + pn + " Mod: " + mn - + " Path: " + libMi.getPath().substring(System.getenv("WORKSPACE").length() + 1); + + " Path: " + libMi.getPath().substring(Workspace.getCurrentWorkspace().length() + 1); cursor.insertComment(comment); } catch (Exception e){ @@ -1178,12 +1186,17 @@ public class FpdFileContents { ListIterator li = l.listIterator(); while (li.hasNext()) { PcdCodedDocument.PcdCoded.PcdEntry msaPcd = (PcdCodedDocument.PcdCoded.PcdEntry) li.next(); + if (msaPcd.getSupArchList() != null) { + if (!msaPcd.getSupArchList().toString().toLowerCase().contains(arch.toLowerCase())) { + continue; + } + } PcdDeclarationsDocument.PcdDeclarations.PcdEntry spdPcd = LookupPcdDeclaration(msaPcd, depPkgs); if (spdPcd == null) { // // ToDo Error // - throw new PcdDeclNotFound("No Declaration for PCD Entry " + msaPcd.getCName() + " used by Module " + throw new PcdDeclNotFound("No Declaration for PCD Entry " + msaPcd.getCName() + "\n used by Module " + mi.getName() + " or its Library Instances."); } // @@ -1232,7 +1245,7 @@ public class FpdFileContents { XmlCursor cursor = msa.newCursor(); try{ String comment = "Mod: " + mi.getName() + " Type: " + SurfaceAreaQuery.getModuleType(mi) + " Path: " - + mi.getPath().substring(System.getenv("WORKSPACE").length() + 1); + + mi.getPath().substring(Workspace.getCurrentWorkspace().length() + 1); cursor.insertComment(comment); } catch(Exception e){ @@ -1345,7 +1358,7 @@ public class FpdFileContents { fpdPcd.setDatumType(PcdDataTypes.Enum.forString(dataType)); fpdPcd.setItemType(PcdItemTypes.Enum.forString(itemType)); - if (defaultVal != null){ + if (defaultVal != null && defaultVal.length() > 0){ fpdPcd.setValue(defaultVal); } else { @@ -1356,7 +1369,7 @@ public class FpdFileContents { fpdPcd.setValue("FALSE"); } if (dataType.equals("VOID*")) { - fpdPcd.setValue(""); + fpdPcd.setValue("L\"\""); } } // @@ -1507,7 +1520,7 @@ public class FpdFileContents { saa[i][1] = dynPcd.getToken().toString(); saa[i][2] = dynPcd.getTokenSpaceGuidCName(); saa[i][3] = dynPcd.getMaxDatumSize()+""; - saa[i][4] = dynPcd.getDatumType().toString(); + saa[i][4] = dynPcd.getDatumType()+""; ++i; } @@ -1732,9 +1745,10 @@ public class FpdFileContents { return; } else { - QName qSkuInfo = new QName(xmlNs, "SkuInfo"); - cursor.toChild(qSkuInfo); - cursor.removeXml(); + pcdData.getSkuInfoList().clear(); +// QName qSkuInfo = new QName(xmlNs, "SkuInfo"); +// cursor.toChild(qSkuInfo); +// cursor.removeXml(); } } cursor.dispose(); @@ -1822,7 +1836,7 @@ public class FpdFileContents { UserExtensionsDocument.UserExtensions userExts = getfpdBuildOpts().addNewUserExtensions(); userExts.setUserID(userId); - userExts.setIdentifier(new BigInteger(id)); + userExts.setIdentifier(id); XmlCursor cursor = userExts.newCursor(); cursor.toEndToken(); @@ -1865,7 +1879,7 @@ public class FpdFileContents { if (!ues.getUserID().equals(userId)) { continue; } - if (ues.getIdentifier() == null || ues.getIdentifier().intValue() != id) { + if (ues.getIdentifier() == null || ues.getIdentifier() != new Integer(id).toString()) { continue; } XmlCursor cursor = ues.newCursor(); @@ -1965,7 +1979,7 @@ public class FpdFileContents { if (!ues.getUserID().equals(userId)) { continue; } - if (ues.getIdentifier()== null || ues.getIdentifier().intValue() != id) { + if (ues.getIdentifier()== null || ues.getIdentifier() != new Integer(id).toString()) { continue; } XmlCursor cursor = ues.newCursor(); @@ -2137,7 +2151,7 @@ public class FpdFileContents { if (!ues.getUserID().equals(userId)) { continue; } - if (ues.getIdentifier() == null || ues.getIdentifier().intValue() != id) { + if (ues.getIdentifier() == null || ues.getIdentifier() != new Integer(id).toString()) { continue; } XmlCursor cursor = ues.newCursor(); @@ -3701,10 +3715,10 @@ class PcdItemTypeConflictException extends Exception { PcdItemTypeConflictException (String pcdName, String info) { ModuleIdentification mi = WorkspaceProfile.getModuleId(info); if (mi != null) { - details = pcdName + " ItemType Conflicts with " + mi.getName() + " in Pkg " + mi.getPackageId().getName(); + details = pcdName + " ItemType Conflicts with " + mi.getName() + "\n in Pkg " + mi.getPackageId().getName(); } else { - details = pcdName + " ItemType Conflicts with " + info; + details = pcdName + " ItemType Conflicts with \n" + info; } } @@ -3727,7 +3741,7 @@ class PcdItemTypeConflictException extends Exception { moduleInfo2 = info2; } - details = pcdName + " ItemType Conflicts in " + moduleInfo1 + " and " + moduleInfo2; + details = pcdName + " ItemType Conflicts in \n" + moduleInfo1 + "\n and " + moduleInfo2; } public String getMessage() {