3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 package org
.tianocore
.migration
;
18 import org
.tianocore
.ModuleSurfaceAreaDocument
;
21 Class ModuleInfo is built for scanning the source files, it contains all the needed
22 information and all the temporary data.
24 public final class ModuleInfo
{
25 ModuleInfo(String modulepath
) throws Exception
{
26 this.modulepath
= modulepath
;
27 this.temppath
= MigrationTool
.getTempDir(this.modulepath
);
30 public final String modulepath
;
31 public final String temppath
;
33 //private MsaOwner msaowner = new MsaWriter(this);
34 //public ModuleSurfaceAreaDocument msadoc = ModuleSurfaceAreaDocument.Factory.newInstance();
36 public String modulename
= null;
37 public String guidvalue
= null;
38 public String moduletype
= null;
39 public String entrypoint
= null;
41 public final Set
<String
> localmodulesources
= new HashSet
<String
>(); //contains both .c and .h
42 public final Set
<String
> preprocessedccodes
= new HashSet
<String
>();
43 public final Set
<String
> msaorinf
= new HashSet
<String
>(); //only a little, hash may be too big for this
44 public final Set
<String
> infincludes
= new HashSet
<String
>();
45 public final Set
<String
> infsources
= new HashSet
<String
>();
47 public final Set
<String
> hashfuncc
= new HashSet
<String
>();
48 public final Set
<String
> hashfuncd
= new HashSet
<String
>();
49 public final Set
<String
> hashnonlocalfunc
= new HashSet
<String
>();
50 public final Set
<String
> hashnonlocalmacro
= new HashSet
<String
>();
51 public final Set
<String
> hashEFIcall
= new HashSet
<String
>();
52 public final Set
<String
> hashr8only
= new HashSet
<String
>();
53 public final Set
<String
> hashmacro
= new HashSet
<String
>();
55 public final Set
<String
> hashrequiredr9libs
= new HashSet
<String
>(); // hashrequiredr9libs is now all added in SourceFileReplacer
56 public final Set
<String
> guid
= new HashSet
<String
>();
57 public final Set
<String
> protocol
= new HashSet
<String
>();
58 public final Set
<String
> ppi
= new HashSet
<String
>();
60 public final String
getModuleType() {
61 if (moduletype
.contains("PEI")) {
68 public final void enroll(String filepath
) throws Exception
{
70 if (filepath
.contains(".c") || filepath
.contains(".C") || filepath
.contains(".h") ||
71 filepath
.contains(".H") || filepath
.contains(".dxs") || filepath
.contains(".uni")) {
72 localmodulesources
.add(filepath
.replace(modulepath
+ File
.separator
, ""));
73 } else if (filepath
.contains(".inf") || filepath
.contains(".msa")) {
74 temp
= filepath
.replace(modulepath
+ File
.separator
, "");
75 if (!temp
.contains(File
.separator
)) { // .inf in subdirectory is not regarded
81 public static final boolean isModule(String path
) {
82 String
[] list
= new File(path
).list();
83 for (int i
= 0 ; i
< list
.length
; i
++) {
84 if (!new File(list
[i
]).isDirectory()) {
85 if (list
[i
].contains(".inf") || list
[i
].contains(".msa")) {