]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/MigrationTools/org/tianocore/migration/ModuleReader.java
first step for MsaOwner in ModuleInfo
[mirror_edk2.git] / Tools / Source / MigrationTools / org / tianocore / migration / ModuleReader.java
index 383353c66bb2385e066d9f93e13408e6fce8d3db..5467b3eff464a673a96f6de79edfeb1ace087478 100644 (file)
@@ -119,7 +119,7 @@ public final class ModuleReader implements Common.ForDoAll {
                     }\r
                 }\r
             }\r
-            if (mtrsection.group(1).matches("includes.common")) {\r
+            if (mtrsection.group(1).matches("includes.")) {\r
                 mtrfilename = ptnfilename.matcher(mtrsection.group(2));\r
                 while (mtrfilename.find()) {\r
                        mi.infincludes.add(mtrfilename.group());\r
@@ -130,7 +130,7 @@ public final class ModuleReader implements Common.ForDoAll {
     \r
     private final void preProcessModule() throws Exception {\r
        // according to .inf file, add extraordinary includes and sourcefiles\r
-        Common.dirCopy(mi.modulepath, mi.modulepath + File.separator + "temp");        // collect all Laplace.namechange to here???\r
+        Common.dirCopy(mi.modulepath, mi.temppath);    // collect all Laplace.namechange to here???\r
         \r
        if (!mi.infincludes.isEmpty()) {\r
             Iterator<String> it = mi.infincludes.iterator();\r
@@ -140,9 +140,9 @@ public final class ModuleReader implements Common.ForDoAll {
                        if (tempincludename.contains("..")) {\r
                                Matcher mtr = Common.PTNSEPARATER.matcher(tempincludename);\r
                                if (mtr.find() && !mtr.group(2).matches(".")) {\r
-                                       Common.oneLevelDirCopy(mi.modulepath.replaceAll(Common.STRSEPARATER, "$1") + File.separator + mtr.group(2), mi.modulepath + File.separator + "temp", ".h");\r
+                                       Common.oneLevelDirCopy(mi.modulepath.replaceAll(Common.STRSEPARATER, "$1") + File.separator + mtr.group(2), mi.temppath, ".h");\r
                                } else {\r
-                                       Common.oneLevelDirCopy(mi.modulepath.replaceAll(Common.STRSEPARATER, "$1"), mi.modulepath + File.separator + "temp", ".h");\r
+                                       Common.oneLevelDirCopy(mi.modulepath.replaceAll(Common.STRSEPARATER, "$1"), mi.temppath, ".h");\r
                                }\r
                        }\r
                }\r
@@ -153,17 +153,17 @@ public final class ModuleReader implements Common.ForDoAll {
             while (it.hasNext()) {\r
                tempsourcename = it.next();\r
                if (tempsourcename.contains("..")) {\r
-                       Common.ensureDir(mi.modulepath + File.separator + "temp" + File.separator + "MT_Parent_Sources");\r
+                       Common.ensureDir(mi.temppath + File.separator + "MT_Parent_Sources");\r
                                Matcher mtr = Common.PTNSEPARATER.matcher(tempsourcename);\r
                                if (mtr.find()) {\r
-                                       Common.fileCopy(mi.modulepath.replaceAll(Common.STRSEPARATER, "$1") + File.separator + mtr.group(2), mi.modulepath + File.separator + "temp" + File.separator + "MT_Parent_Sources" + File.separator + mtr.group(2));\r
+                                       Common.fileCopy(mi.modulepath.replaceAll(Common.STRSEPARATER, "$1") + File.separator + mtr.group(2), mi.temppath + File.separator + "MT_Parent_Sources" + File.separator + mtr.group(2));\r
                                }\r
                }\r
             }\r
        }\r
 \r
         //CommentOutNonLocalHFile();\r
-        Common.toDoAll(mi.modulepath + File.separator + "temp", this, Common.FILE);\r
+        Common.toDoAll(mi.temppath, this, Common.FILE);\r
         \r
         parsePreProcessedSourceCode();\r
 \r
@@ -193,35 +193,22 @@ public final class ModuleReader implements Common.ForDoAll {
         ii = mi.preprocessedccodes.iterator();\r
         \r
         Pattern patefifuncc = Pattern.compile("g?(BS|RT)\\s*->\\s*([a-zA-Z_]\\w*)",Pattern.MULTILINE);\r
-        Pattern patentrypoint = Pattern.compile("EFI_([A-Z]*)_ENTRY_POINT\\s*\\(([^\\(\\)]*)\\)",Pattern.MULTILINE);\r
         Matcher matguid;\r
         Matcher matfuncc;\r
         Matcher matfuncd;\r
         Matcher matenclosereplace;\r
         Matcher matefifuncc;\r
-        Matcher matentrypoint;\r
         Matcher matmacro;\r
         \r
         while (ii.hasNext()) {\r
             StringBuffer wholefile = new StringBuffer();\r
             ifile = ii.next();\r
-            rd = new BufferedReader(new FileReader(mi.modulepath + File.separator + "temp" + File.separator + ifile));\r
+            rd = new BufferedReader(new FileReader(mi.temppath + File.separator + ifile));\r
             while ((line = rd.readLine()) != null) {\r
                 wholefile.append(line + '\n');\r
             }\r
             line = wholefile.toString();\r
             \r
-            // if this is a Pei phase module , add these library class to .msa\r
-            matentrypoint = patentrypoint.matcher(line);\r
-            if (matentrypoint.find()) {\r
-                mi.entrypoint = matentrypoint.group(2);\r
-                if (matentrypoint.group(1).matches("PEIM")) {\r
-                    mi.hashrequiredr9libs.add("PeimEntryPoint");\r
-                } else {\r
-                    mi.hashrequiredr9libs.add("UefiDriverEntryPoint");\r
-                }\r
-            }\r
-            \r
             // find guid\r
             matguid = Guid.ptnguid.matcher(line);                                        // several ways to implement this , which one is faster ? :\r
             while (matguid.find()) {                                                    // 1.currently , find once , then call to identify which is it\r
@@ -311,7 +298,7 @@ public final class ModuleReader implements Common.ForDoAll {
 \r
     //-----------------------------------ForDoAll-----------------------------------//\r
     public void run(String filepath) throws Exception {\r
-       String name = mi.modulepath + File.separator + "temp" + File.separator + filepath.replace(mi.modulepath + File.separator + "temp" + File.separator, "");\r
+       String name = mi.temppath + File.separator + filepath.replace(mi.temppath + File.separator, "");\r
        commentlaplace.transform(name, name);\r
     }\r
 \r