X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Tools%2FJava%2FSource%2FGenBuild%2Forg%2Ftianocore%2Fbuild%2FGenBuildTask.java;h=468b5f9ecc494a7a365cff4e93184cd32e8917e5;hp=8be1d62cc0f765de9032d86091bf4a37885c13a8;hb=1fcc1b796c0323cfc1e8c67a1454dc1f8324dab6;hpb=700279a971c1f603a72a45455be4b4f842ce39d9 diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/GenBuildTask.java b/Tools/Java/Source/GenBuild/org/tianocore/build/GenBuildTask.java index 8be1d62cc0..468b5f9ecc 100644 --- a/Tools/Java/Source/GenBuild/org/tianocore/build/GenBuildTask.java +++ b/Tools/Java/Source/GenBuild/org/tianocore/build/GenBuildTask.java @@ -207,6 +207,7 @@ public class GenBuildTask extends Ant { } else { moduleId.setLibrary(true); } + moduleId.setBinary(saq.getBinaryModule()); // // Judge whether it is single module build or not @@ -231,7 +232,7 @@ public class GenBuildTask extends Ant { Set archSet = new LinkedHashSet(); String archString = getProject().getProperty("ARCH"); - if (archString != null) { + if (archString != null && archString.length() > 0) { String[] fpdArchList = archString.split(" "); for (int i = 0; i < fpdArchList.length; i++) { @@ -251,8 +252,9 @@ public class GenBuildTask extends Ant { List moduleSupportedArchs = saq.getModuleSupportedArchs(); if (moduleSupportedArchs != null) { for (int k = 0; k < archList.length; k++) { - if ( ! moduleSupportedArchs.contains(archList[k])) { - throw new BuildException("Specified architecture [" + archList[k] + "] is not supported by " + moduleId + ". The module " + moduleId + " only supports [" + moduleSupportedArchs + "] architectures."); + if (!moduleSupportedArchs.contains(archList[k])) { + EdkLog.log(this, EdkLog.EDK_WARNING, "Specified architecture [" + archList[k] + "] is not supported by " + moduleId + ". The module " + moduleId + " only supports [" + moduleSupportedArchs + "] architectures."); + archList[k] = ""; } } } @@ -262,6 +264,9 @@ public class GenBuildTask extends Ant { } for (int k = 0; k < archList.length; k++) { + if (archList[k] == "") { + continue; + } getProject().setProperty("ARCH", archList[k]); @@ -270,8 +275,13 @@ public class GenBuildTask extends Ant { // // Whether the module is built before // - if (moduleId.isLibrary() == false && GlobalData.hasFpdModuleSA(fpdModuleId) == false) { - EdkLog.log(this, EdkLog.EDK_WARNING, "Warning: " + moduleId + " for " + archList[k] + " was not found in current platform FPD file!\n"); + if ((moduleId.isLibrary() == false || isSingleModuleBuild) && GlobalData.hasFpdModuleSA(fpdModuleId) == false) { + if (isSingleModuleBuild) { + EdkLog.log(this, EdkLog.EDK_ERROR, "Error: " + moduleId + " for " + archList[k] + " was not found in current platform FPD file!\n"); + throw new BuildException("No platform containing this module!"); + } else { + EdkLog.log(this, EdkLog.EDK_WARNING, "Warning: " + moduleId + " for " + archList[k] + " was not found in current platform FPD file!\n"); + } continue; } else if (GlobalData.isModuleBuilt(fpdModuleId)) { break; @@ -327,10 +337,8 @@ public class GenBuildTask extends Ant { if (type.equalsIgnoreCase("all") || type.equalsIgnoreCase("build")) { applyBuild(targetList[i], toolchainList[j], fpdModuleId); - } else if (type.equalsIgnoreCase("clean")) { - applyClean(fpdModuleId); - } else if (type.equalsIgnoreCase("cleanall")) { - applyCleanall(fpdModuleId); + } else { + applyNonBuildTarget(fpdModuleId); } } } @@ -649,10 +657,11 @@ public class GenBuildTask extends Ant { // if it is CUSTOM_BUILD // then call the exist BaseName_build.xml directly. // - if (moduleId.getModuleType().equalsIgnoreCase("USER_DEFINED")) { - EdkLog.log(this, "Call user-defined " + moduleId.getName() + "_build.xml"); + String buildFilename = ""; + if ((buildFilename = GetCustomizedBuildFile(fpdModuleId.getArch())) != "") { + EdkLog.log(this, "Call user-defined " + buildFilename); - String antFilename = getProject().getProperty("MODULE_DIR") + File.separatorChar + moduleId.getName() + "_build.xml"; + String antFilename = getProject().getProperty("MODULE_DIR") + File.separatorChar + buildFilename; antCall(antFilename, null); return ; @@ -664,7 +673,7 @@ public class GenBuildTask extends Ant { // String ffsKeyword = saq.getModuleFfsKeyword(); ModuleBuildFileGenerator fileGenerator = new ModuleBuildFileGenerator(getProject(), ffsKeyword, fpdModuleId, includes, saq); - String buildFilename = getProject().getProperty("DEST_DIR_OUTPUT") + File.separatorChar + moduleId.getName() + "_build.xml"; + buildFilename = getProject().getProperty("DEST_DIR_OUTPUT") + File.separatorChar + moduleId.getName() + "_build.xml"; fileGenerator.genBuildFile(buildFilename); // @@ -674,6 +683,24 @@ public class GenBuildTask extends Ant { antCall(antFilename, null); } + private void applyNonBuildTarget(FpdModuleIdentification fpdModuleId){ + // + // if it is CUSTOM_BUILD + // then call the exist BaseName_build.xml directly. + // + if (moduleId.getModuleType().equalsIgnoreCase("USER_DEFINED")) { + EdkLog.log(this, "Calling user-defined " + moduleId.getName() + "_build.xml"); + + String antFilename = getProject().getProperty("MODULE_DIR") + File.separatorChar + moduleId.getName() + "_build.xml"; + antCall(antFilename, this.type); + + return ; + } + + String antFilename = getProject().getProperty("DEST_DIR_OUTPUT") + File.separatorChar + moduleId.getName() + "_build.xml"; + antCall(antFilename, this.type); + } + private void applyClean(FpdModuleIdentification fpdModuleId){ // // if it is CUSTOM_BUILD @@ -815,4 +842,15 @@ public class GenBuildTask extends Ant { public void setExternalProperties(Vector v) { this.properties = v; } + + private String GetCustomizedBuildFile(String arch) { + String[][] files = saq.getSourceFiles(arch); + for (int i = 0; i < files.length; ++i) { + if (files[i][1].endsWith("build.xml")) { + return files[i][1]; + } + } + + return ""; + } }