summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python/CommonDataClass/PackageClass.py
blob: 82e7394ced2ed2049ae27669be0f643f0a695de0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
## @file
# This file is used to define a class object to describe a package
#
# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution.    The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php
#
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

##
# Import Modules
#
from CommonClass import *
from Common.Misc import sdict

## PackageHeaderClass
#
# This class defined header items used in Package file
# 
# @param IdentificationClass:  Inherited from IdentificationClass class
# @param CommonHeaderClass:    Inherited from CommonHeaderClass class
#
# @var DecSpecification:       To store value for DecSpecification
# @var ReadOnly:               To store value for ReadOnly
# @var RePackage:              To store value for RePackage
# @var ClonedFrom:             To store value for ClonedFrom, it is a set structure as
#                              [ ClonedRecordClass, ...]
#
class PackageHeaderClass(IdentificationClass, CommonHeaderClass):
    def __init__(self):
        IdentificationClass.__init__(self)
        CommonHeaderClass.__init__(self)
        self.DecSpecification = ''
        self.ReadOnly = False
        self.RePackage = False
        self.PackagePath = ''
        self.ClonedFrom = []

## PackageIndustryStdHeaderClass
#
# This class defined industry std header items used in Package file
# 
# @param CommonHeaderClass:  Inherited from CommonHeaderClass class
#
# @var Name:                 To store value for Name
# @var IncludeHeader:        To store value for IncludeHeader
#
class PackageIndustryStdHeaderClass(CommonClass):
    def __init__(self):
        self.Name = ''
        self.IncludeHeader = ''
        CommonClass.__init__(self)

## PackageIncludePkgHeaderClass
#
# This class defined include Pkg header items used in Package file
# 
# @param object:       Inherited from object class
#
# @var IncludeHeader:  To store value for IncludeHeader
# @var ModuleType:     To store value for ModuleType, it is a set structure as
#                      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
#
class PackageIncludePkgHeaderClass(object):
    def __init__(self):
        self.IncludeHeader = ''
        self.ModuleType = []

## PackageClass
#
# This class defined a complete package item
# 
# @param object:                  Inherited from object class
#
# @var Header:                    To store value for Header, it is a structure as
#                                 {Arch : PackageHeaderClass}
# @var Includes:                  To store value for Includes, it is a list structure as
#                                 [ IncludeClass, ...]
# @var LibraryClassDeclarations:  To store value for LibraryClassDeclarations, it is a list structure as
#                                 [ LibraryClassClass, ...]
# @var IndustryStdHeaders:        To store value for IndustryStdHeaders, it is a list structure as
#                                 [ PackageIndustryStdHeader, ...]
# @var ModuleFiles:               To store value for ModuleFiles, it is a list structure as
#                                 [ '', '', ...] 
# @var PackageIncludePkgHeaders:  To store value for PackageIncludePkgHeaders, it is a list structure as
#                                 [ PackageIncludePkgHeader, ...]
# @var GuidDeclarations:          To store value for GuidDeclarations, it is a list structure as
#                                 [ GuidClass, ...]
# @var ProtocolDeclarations:      To store value for ProtocolDeclarations, it is a list structure as
#                                 [ ProtocolClass, ...]
# @var PpiDeclarations:           To store value for PpiDeclarations, it is a list structure as
#                                 [ PpiClass, ...]
# @var PcdDeclarations:           To store value for PcdDeclarations, it is a list structure as
#                                 [ PcdClass, ...]
# @var UserExtensions:            To store value for UserExtensions, it is a list structure as
#                                 [ UserExtensionsClass, ...]
#
class PackageClass(object):
    def __init__(self):
        self.PackageHeader = PackageHeaderClass()
        self.Header = {}
        self.Includes = []
        self.LibraryClassDeclarations = []
        self.IndustryStdHeaders = []
        self.ModuleFiles = []
        # {[Guid, Value, Path(relative to WORKSPACE)]: ModuleClassObj}
        self.Modules = sdict()
        self.PackageIncludePkgHeaders = []
        self.GuidDeclarations = []
        self.ProtocolDeclarations = []
        self.PpiDeclarations = []
        self.PcdDeclarations = []
        self.PcdChecks = []
        self.UserExtensions = UserExtensionsClass()
        self.MiscFiles = MiscFileClass()
        self.FileList = []

##
#
# This acts like the main() function for the script, unless it is 'import'ed into another
# script.
#
if __name__ == '__main__':
    P = PackageClass()