X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Tools%2FSource%2FGenBuild%2Forg%2Ftianocore%2Fbuild%2Fglobal%2FSurfaceAreaQuery.java;h=149b30dd173e88fb7946e4b21eeb629bc55a7e25;hp=235c604eb3c391ab68495842378ed767341e7f4c;hb=8cf5da75ce5bf66f1ef5a495a41fdcc0a51f7138;hpb=7d6ef0a92952746ba92183efb7b8291e0bc2d1b7 diff --git a/Tools/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java b/Tools/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java index 235c604eb3..149b30dd17 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java +++ b/Tools/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java @@ -397,7 +397,6 @@ public class SurfaceAreaQuery { String toolchainFamily = null; List archList = null; String cmd = null; - String targetName = null; String optionName = null; Object[] returns = get(from, xPath); @@ -598,9 +597,8 @@ public class SurfaceAreaQuery { * xpath * @returns null if nothing is there */ - public static String[] getLibraryClasses(String usage) { + public static String[] getLibraryClasses(String usage, String arch) { String[] xPath; - if (usage == null || usage.equals("")) { xPath = new String[] { "/LibraryClass" }; } else { @@ -613,11 +611,19 @@ public class SurfaceAreaQuery { } LibraryClassDocument.LibraryClass[] libraryClassList = (LibraryClassDocument.LibraryClass[]) returns; - String[] libraryClassName = new String[libraryClassList.length]; + List libraryClassName = new ArrayList(); for (int i = 0; i < libraryClassList.length; i++) { - libraryClassName[i] = libraryClassList[i].getKeyword(); + List archList = libraryClassList[i].getSupArchList(); + + if (arch == null || contains(archList, arch)) { + libraryClassName.add(libraryClassList[i].getKeyword()); + } } - return libraryClassName; + String[] libraryArray = new String[libraryClassName.size()]; + for (int i = 0; i < libraryClassName.size(); i++) { + libraryArray[i] = libraryClassName.get(i); + } + return libraryArray; } /** @@ -1378,8 +1384,20 @@ public class SurfaceAreaQuery { return result; } - public static Node getFpdUserExtension() { - String[] xPath = new String[] { "/UserExtensions[@UserID='TianoCore']" }; + public static Node getFpdUserExtensionPreBuild() { + String[] xPath = new String[] { "/UserExtensions[@UserID='TianoCore' and @Identifier='0']" }; + + Object[] queryResult = get("PlatformSurfaceArea", xPath); + if (queryResult == null || queryResult.length == 0) { + return null; + } + UserExtensionsDocument.UserExtensions a = (UserExtensionsDocument.UserExtensions)queryResult[0]; + + return a.getDomNode(); + } + + public static Node getFpdUserExtensionPostBuild() { + String[] xPath = new String[] { "/UserExtensions[@UserID='TianoCore' and @Identifier='1']" }; Object[] queryResult = get("PlatformSurfaceArea", xPath); if (queryResult == null || queryResult.length == 0) { @@ -1885,6 +1903,9 @@ public class SurfaceAreaQuery { @return boolean **/ public static boolean contains(List list, String str) { + if (list == null || list.size()== 0) { + return true; + } Iterator it = list.iterator(); while (it.hasNext()) { String s = (String)it.next();