X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Tools%2FJava%2FSource%2FMigrationTools%2Forg%2Ftianocore%2Fmigration%2FMsaWriter.java;h=a8e26c573f590814dbfd06a0639dd4e768ddcf76;hp=3db25079057b4d98851bbd705448a9ce6693b4fd;hb=9c0e70cb4a8155ffac7aff028f0760b8137cc26c;hpb=feccee87a78e68d575dbdf44b34ca0cb5a21ea8d;ds=sidebyside diff --git a/Tools/Java/Source/MigrationTools/org/tianocore/migration/MsaWriter.java b/Tools/Java/Source/MigrationTools/org/tianocore/migration/MsaWriter.java index 3db2507905..a8e26c573f 100644 --- a/Tools/Java/Source/MigrationTools/org/tianocore/migration/MsaWriter.java +++ b/Tools/Java/Source/MigrationTools/org/tianocore/migration/MsaWriter.java @@ -70,11 +70,20 @@ public class MsaWriter { filename.setSupArchList(arch); } } - + private void addWrapper() { + XmlCursor cursor = msa.newCursor(); + String uri = "http://www.TianoCore.org/2006/Edk2.0"; + cursor.push(); + cursor.toNextToken(); + cursor.insertNamespace("", uri); + cursor.insertNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance"); + cursor.pop(); + msa = (ModuleSurfaceAreaDocument.ModuleSurfaceArea)cursor.getObject(); + } private ModuleSurfaceAreaDocument fulfillMsadoc() throws Exception { Iterator it; String temp; - + if (mi.modulename != null) { msaheader.setModuleName(mi.modulename); } else { @@ -91,18 +100,16 @@ public class MsaWriter { msaheader.setModuleType(ModuleTypeDef.Enum.forString(mi.moduletype = Query("Guid Value Not Found! Please Input Guid Value"))); } - msaheader.setCopyright("Copyright (c) 2006, Intel Corporation"); + msaheader.setCopyright("Copyright (c) 2006, Intel Corporation. All right reserved."); msaheader.setVersion("1.0"); msaheader.setAbstract("Component name for module " + mi.modulename); msaheader.setDescription("FIX ME!"); - msaheader.addNewLicense().setStringValue("All rights reserved.\n" + - " This software and associated documentation (if any) is furnished\n" + - " under a license and may only be used or copied in accordance\n" + - " with the terms of the license. Except as permitted by such\n" + - " license, no part of this software or documentation may be\n" + - " reproduced, stored in a retrieval system, or transmitted in any\n" + - " form or by any means without the express written consent of\n" + - " Intel Corporation."); + + if (mi.license == null) { + mi.license = "FIX ME!"; + MigrationTool.ui.println ("Fail to extract license info in inf file"); + } + msaheader.addNewLicense().setStringValue(mi.license); msaheader.setSpecification("FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052"); List arch = new ArrayList(); @@ -113,9 +120,13 @@ public class MsaWriter { md.setSupportedArchitectures(arch); md.setBinaryModule(false); md.setOutputFileBasename(mi.modulename); - - pd.addNewPackage().setPackageGuid("5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"); - pd.addNewPackage().setPackageGuid("68169ab0-d41b-4009-9060-292c253ac43d"); + // + // For now, simply add all package guids in the database. + // + it = MigrationTool.db.dumpAllPkgGuid(); + while (it.hasNext()) { + pd.addNewPackage().setPackageGuid(it.next()); + } externs.addNewSpecification().setStringValue("EFI_SPECIFICATION_VERSION 0x00020000"); externs.addNewSpecification().setStringValue("EDK_RELEASE_VERSION 0x00020000"); if (mi.entrypoint != null) { @@ -173,7 +184,8 @@ public class MsaWriter { lc.setUsage(UsageTypes.ALWAYS_CONSUMED); } } - + addWrapper(); + msadoc.setModuleSurfaceArea(msa); return msadoc; } @@ -184,7 +196,7 @@ public class MsaWriter { options.setSavePrettyPrint(); options.setSavePrettyPrintIndent(2); options.setUseDefaultNamespace(); - + BufferedWriter bw = new BufferedWriter(new FileWriter(MigrationTool.ModuleInfoMap.get(mi) + File.separator + "Migration_" + mi.modulename + File.separator + mi.modulename + ".msa")); fulfillMsadoc().save(bw, options); //MsaTreeEditor.init(mi, ui, msadoc);