BaseTools: skip updating temporary variable.
[mirror_edk2.git] / BaseTools / Source / Python / CommonDataClass / PackageClass.py
CommitLineData
30fdf114
LG
1## @file\r
2# This file is used to define a class object to describe a package\r
3#\r
40d841f6
LG
4# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
5# This program and the accompanying materials\r
30fdf114
LG
6# are licensed and made available under the terms and conditions of the BSD License\r
7# which accompanies this distribution. The full text of the license may be found at\r
8# http://opensource.org/licenses/bsd-license.php\r
9#\r
10# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13##\r
14# Import Modules\r
15#\r
16from CommonClass import *\r
6e6d767e 17from collections import OrderedDict\r
30fdf114
LG
18\r
19## PackageHeaderClass\r
20#\r
21# This class defined header items used in Package file\r
22# \r
23# @param IdentificationClass: Inherited from IdentificationClass class\r
24# @param CommonHeaderClass: Inherited from CommonHeaderClass class\r
25#\r
26# @var DecSpecification: To store value for DecSpecification\r
27# @var ReadOnly: To store value for ReadOnly\r
28# @var RePackage: To store value for RePackage\r
29# @var ClonedFrom: To store value for ClonedFrom, it is a set structure as\r
30# [ ClonedRecordClass, ...]\r
31#\r
32class PackageHeaderClass(IdentificationClass, CommonHeaderClass):\r
33 def __init__(self):\r
34 IdentificationClass.__init__(self)\r
35 CommonHeaderClass.__init__(self)\r
36 self.DecSpecification = ''\r
37 self.ReadOnly = False\r
38 self.RePackage = False\r
39 self.PackagePath = ''\r
40 self.ClonedFrom = []\r
41\r
42## PackageIndustryStdHeaderClass\r
43#\r
44# This class defined industry std header items used in Package file\r
45# \r
46# @param CommonHeaderClass: Inherited from CommonHeaderClass class\r
47#\r
48# @var Name: To store value for Name\r
49# @var IncludeHeader: To store value for IncludeHeader\r
50#\r
51class PackageIndustryStdHeaderClass(CommonClass):\r
52 def __init__(self):\r
53 self.Name = ''\r
54 self.IncludeHeader = ''\r
55 CommonClass.__init__(self)\r
56\r
57## PackageIncludePkgHeaderClass\r
58#\r
59# This class defined include Pkg header items used in Package file\r
60# \r
61# @param object: Inherited from object class\r
62#\r
63# @var IncludeHeader: To store value for IncludeHeader\r
64# @var ModuleType: To store value for ModuleType, it is a set structure as\r
96f73940 65# BASE | SEC | PEI_CORE | PEIM | DXE_CORE | DXE_DRIVER | DXE_RUNTIME_DRIVER | DXE_SAL_DRIVER | DXE_SMM_DRIVER | TOOL | UEFI_DRIVER | UEFI_APPLICATION | USER_DEFINED | SMM_CORE | MM_STANDALONE | MM_CORE_STANDALONE\r
30fdf114
LG
66#\r
67class PackageIncludePkgHeaderClass(object):\r
68 def __init__(self):\r
69 self.IncludeHeader = ''\r
70 self.ModuleType = []\r
71\r
72## PackageClass\r
73#\r
74# This class defined a complete package item\r
75# \r
76# @param object: Inherited from object class\r
77#\r
78# @var Header: To store value for Header, it is a structure as\r
79# {Arch : PackageHeaderClass}\r
80# @var Includes: To store value for Includes, it is a list structure as\r
81# [ IncludeClass, ...]\r
82# @var LibraryClassDeclarations: To store value for LibraryClassDeclarations, it is a list structure as\r
83# [ LibraryClassClass, ...]\r
84# @var IndustryStdHeaders: To store value for IndustryStdHeaders, it is a list structure as\r
85# [ PackageIndustryStdHeader, ...]\r
86# @var ModuleFiles: To store value for ModuleFiles, it is a list structure as\r
87# [ '', '', ...] \r
88# @var PackageIncludePkgHeaders: To store value for PackageIncludePkgHeaders, it is a list structure as\r
89# [ PackageIncludePkgHeader, ...]\r
90# @var GuidDeclarations: To store value for GuidDeclarations, it is a list structure as\r
91# [ GuidClass, ...]\r
92# @var ProtocolDeclarations: To store value for ProtocolDeclarations, it is a list structure as\r
93# [ ProtocolClass, ...]\r
94# @var PpiDeclarations: To store value for PpiDeclarations, it is a list structure as\r
95# [ PpiClass, ...]\r
96# @var PcdDeclarations: To store value for PcdDeclarations, it is a list structure as\r
97# [ PcdClass, ...]\r
98# @var UserExtensions: To store value for UserExtensions, it is a list structure as\r
99# [ UserExtensionsClass, ...]\r
100#\r
101class PackageClass(object):\r
102 def __init__(self):\r
103 self.PackageHeader = PackageHeaderClass()\r
104 self.Header = {}\r
105 self.Includes = []\r
106 self.LibraryClassDeclarations = []\r
107 self.IndustryStdHeaders = []\r
108 self.ModuleFiles = []\r
109 # {[Guid, Value, Path(relative to WORKSPACE)]: ModuleClassObj}\r
6e6d767e 110 self.Modules = OrderedDict()\r
30fdf114
LG
111 self.PackageIncludePkgHeaders = []\r
112 self.GuidDeclarations = []\r
113 self.ProtocolDeclarations = []\r
114 self.PpiDeclarations = []\r
115 self.PcdDeclarations = []\r
116 self.PcdChecks = []\r
117 self.UserExtensions = UserExtensionsClass()\r
118 self.MiscFiles = MiscFileClass()\r
119 self.FileList = []\r
120\r
121##\r
122#\r
123# This acts like the main() function for the script, unless it is 'import'ed into another\r
124# script.\r
125#\r
126if __name__ == '__main__':\r
127 P = PackageClass()\r