2 # This file is used to define a class object to describe a module
4 # Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved.<BR>
6 # This program and the accompanying materials are licensed and made available
7 # under the terms and conditions of the BSD License which accompanies this
8 # distribution. The full text of the license may be found at
9 # http://opensource.org/licenses/bsd-license.php
11 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
21 from Object
.POM
.CommonObject
import CommonPropertiesObject
22 from Object
.POM
.CommonObject
import IdentificationObject
23 from Object
.POM
.CommonObject
import CommonHeaderObject
24 from Object
.POM
.CommonObject
import BinaryHeaderObject
25 from Object
.POM
.CommonObject
import HelpTextListObject
26 from Object
.POM
.CommonObject
import GuidVersionObject
32 class BootModeObject(CommonPropertiesObject
, HelpTextListObject
):
34 self
.SupportedBootModes
= ''
35 CommonPropertiesObject
.__init
__(self
)
36 HelpTextListObject
.__init
__(self
)
38 def SetSupportedBootModes(self
, SupportedBootModes
):
39 self
.SupportedBootModes
= SupportedBootModes
41 def GetSupportedBootModes(self
):
42 return self
.SupportedBootModes
47 class EventObject(CommonPropertiesObject
, HelpTextListObject
):
50 CommonPropertiesObject
.__init
__(self
)
51 HelpTextListObject
.__init
__(self
)
53 def SetEventType(self
, EventType
):
54 self
.EventType
= EventType
56 def GetEventType(self
):
62 class HobObject(CommonPropertiesObject
, HelpTextListObject
):
65 CommonPropertiesObject
.__init
__(self
)
66 HelpTextListObject
.__init
__(self
)
68 def SetHobType(self
, HobType
):
69 self
.HobType
= HobType
77 class SpecObject(object):
82 def SetSpec(self
, Spec
):
88 def SetVersion(self
, Version
):
89 self
.Version
= Version
96 # This class defined header items used in Module file
98 class ModuleHeaderObject(IdentificationObject
, CommonHeaderObject
, BinaryHeaderObject
):
100 self
.IsLibrary
= False
101 self
.IsLibraryModList
= []
103 self
.BinaryModule
= False
104 self
.PcdIsDriver
= ''
105 self
.PiSpecificationVersion
= ''
106 self
.UefiSpecificationVersion
= ''
108 self
.ModuleUniFile
= ''
116 self
.BootModeList
= []
128 self
.LibraryClassList
= []
129 self
.SupArchList
= []
130 IdentificationObject
.__init
__(self
)
131 CommonHeaderObject
.__init
__(self
)
132 BinaryHeaderObject
.__init
__(self
)
134 def SetIsLibrary(self
, IsLibrary
):
135 self
.IsLibrary
= IsLibrary
137 def GetIsLibrary(self
):
138 return self
.IsLibrary
140 def SetIsLibraryModList(self
, IsLibraryModList
):
141 self
.IsLibraryModList
= IsLibraryModList
143 def GetIsLibraryModList(self
):
144 return self
.IsLibraryModList
146 def SetModuleType(self
, ModuleType
):
147 self
.ModuleType
= ModuleType
149 def GetModuleType(self
):
150 return self
.ModuleType
152 def SetBinaryModule(self
, BinaryModule
):
153 self
.BinaryModule
= BinaryModule
155 def GetBinaryModule(self
):
156 return self
.BinaryModule
158 def SetPcdIsDriver(self
, PcdIsDriver
):
159 self
.PcdIsDriver
= PcdIsDriver
161 def GetPcdIsDriver(self
):
162 return self
.PcdIsDriver
164 def SetPiSpecificationVersion(self
, PiSpecificationVersion
):
165 self
.PiSpecificationVersion
= PiSpecificationVersion
167 def GetPiSpecificationVersion(self
):
168 return self
.PiSpecificationVersion
170 def SetUefiSpecificationVersion(self
, UefiSpecificationVersion
):
171 self
.UefiSpecificationVersion
= UefiSpecificationVersion
173 def GetUefiSpecificationVersion(self
):
174 return self
.UefiSpecificationVersion
176 def SetSpecList(self
, SpecList
):
177 self
.SpecList
= SpecList
179 def GetSpecList(self
):
182 def SetBootModeList(self
, BootModeList
):
183 self
.BootModeList
= BootModeList
185 def GetBootModeList(self
):
186 return self
.BootModeList
188 def SetEventList(self
, EventList
):
189 self
.EventList
= EventList
191 def GetEventList(self
):
192 return self
.EventList
194 def SetHobList(self
, HobList
):
195 self
.HobList
= HobList
197 def GetHobList(self
):
200 def SetLibraryClassList(self
, LibraryClassList
):
201 self
.LibraryClassList
= LibraryClassList
203 def GetLibraryClassList(self
):
204 return self
.LibraryClassList
206 def SetSupArchList(self
, SupArchList
):
207 self
.SupArchList
= SupArchList
209 def GetSupArchList(self
):
210 return self
.SupArchList
212 def SetModuleUniFile(self
, ModuleUniFile
):
213 self
.ModuleUniFile
= ModuleUniFile
215 def GetModuleUniFile(self
):
216 return self
.ModuleUniFile
220 class SourceFileObject(CommonPropertiesObject
):
222 CommonPropertiesObject
.__init
__(self
)
229 def SetSourceFile(self
, SourceFile
):
230 self
.SourceFile
= SourceFile
232 def GetSourceFile(self
):
233 return self
.SourceFile
235 def SetTagName(self
, TagName
):
236 self
.TagName
= TagName
238 def GetTagName(self
):
241 def SetToolCode(self
, ToolCode
):
242 self
.ToolCode
= ToolCode
244 def GetToolCode(self
):
247 def SetFamily(self
, Family
):
253 def SetFileType(self
, FileType
):
254 self
.FileType
= FileType
256 def GetFileType(self
):
263 class BinaryFileObject(CommonPropertiesObject
):
265 self
.FileNamList
= []
266 self
.AsBuiltList
= []
267 CommonPropertiesObject
.__init
__(self
)
269 def SetFileNameList(self
, FileNamList
):
270 self
.FileNamList
= FileNamList
272 def GetFileNameList(self
):
273 return self
.FileNamList
275 def SetAsBuiltList(self
, AsBuiltList
):
276 self
.AsBuiltList
= AsBuiltList
278 def GetAsBuiltList(self
):
279 return self
.AsBuiltList
283 # AsBuildLibraryClassObject
285 class AsBuildLibraryClassObject(object):
289 self
.SupArchList
= []
291 def SetLibGuid(self
, LibGuid
):
292 self
.LibGuid
= LibGuid
293 def GetLibGuid(self
):
296 def SetLibVersion(self
, LibVersion
):
297 self
.LibVersion
= LibVersion
298 def GetLibVersion(self
):
299 return self
.LibVersion
301 def SetSupArchList(self
, SupArchList
):
302 self
.SupArchList
= SupArchList
303 def GetSupArchList(self
):
304 return self
.SupArchList
309 class AsBuiltObject(object):
314 self
.PatchPcdList
= []
318 self
.PcdExValueList
= []
320 # list of GuidVersionObject
322 self
.LibraryInstancesList
= []
324 # List of BinaryBuildFlag object
326 self
.BinaryBuildFlagList
= []
328 def SetPatchPcdList(self
, PatchPcdList
):
329 self
.PatchPcdList
= PatchPcdList
331 def GetPatchPcdList(self
):
332 return self
.PatchPcdList
334 def SetPcdExList(self
, PcdExValueList
):
335 self
.PcdExValueList
= PcdExValueList
337 def GetPcdExList(self
):
338 return self
.PcdExValueList
340 def SetLibraryInstancesList(self
, LibraryInstancesList
):
341 self
.LibraryInstancesList
= LibraryInstancesList
343 def GetLibraryInstancesList(self
):
344 return self
.LibraryInstancesList
346 def SetBuildFlagsList(self
, BinaryBuildFlagList
):
347 self
.BinaryBuildFlagList
= BinaryBuildFlagList
349 def GetBuildFlagsList(self
):
350 return self
.BinaryBuildFlagList
353 # BinaryBuildFlag, this object will include those fields that are not
354 # covered by the UPT Spec BinaryFile field
356 class BinaryBuildFlagObject(object):
361 self
.AsBuiltOptionFlags
= ''
363 def SetTarget(self
, Target
):
369 def SetTagName(self
, TagName
):
370 self
.TagName
= TagName
372 def GetTagName(self
):
375 def SetFamily(self
, Family
):
381 def SetAsBuiltOptionFlags(self
, AsBuiltOptionFlags
):
382 self
.AsBuiltOptionFlags
= AsBuiltOptionFlags
383 def GetAsBuiltOptionFlags(self
):
384 return self
.AsBuiltOptionFlags
389 class ExternObject(CommonPropertiesObject
):
392 self
.UnloadImage
= ''
393 self
.Constructor
= ''
396 CommonPropertiesObject
.__init
__(self
)
398 def SetEntryPoint(self
, EntryPoint
):
399 self
.EntryPoint
= EntryPoint
401 def GetEntryPoint(self
):
402 return self
.EntryPoint
404 def SetUnloadImage(self
, UnloadImage
):
405 self
.UnloadImage
= UnloadImage
407 def GetUnloadImage(self
):
408 return self
.UnloadImage
410 def SetConstructor(self
, Constructor
):
411 self
.Constructor
= Constructor
413 def GetConstructor(self
):
414 return self
.Constructor
416 def SetDestructor(self
, Destructor
):
417 self
.Destructor
= Destructor
419 def GetDestructor(self
):
420 return self
.Destructor
422 def SetSupModList(self
, SupModList
):
423 self
.SupModList
= SupModList
424 def GetSupModList(self
):
425 return self
.SupModList
430 class DepexObject(CommonPropertiesObject
):
434 CommonPropertiesObject
.__init
__(self
)
436 def SetDepex(self
, Depex
):
442 def SetModuleType(self
, ModuleType
):
443 self
.ModuelType
= ModuleType
445 def GetModuleType(self
):
446 return self
.ModuelType
449 # PackageDependencyObject
451 class PackageDependencyObject(GuidVersionObject
, CommonPropertiesObject
):
454 self
.PackageFilePath
= ''
455 GuidVersionObject
.__init
__(self
)
456 CommonPropertiesObject
.__init
__(self
)
458 def SetPackageFilePath(self
, PackageFilePath
):
459 self
.PackageFilePath
= PackageFilePath
461 def GetPackageFilePath(self
):
462 return self
.PackageFilePath
464 def SetPackage(self
, Package
):
465 self
.Package
= Package
467 def GetPackage(self
):
473 class BuildOptionObject(CommonPropertiesObject
):
475 CommonPropertiesObject
.__init
__(self
)
476 self
.BuildOption
= ''
478 def SetBuildOption(self
, BuildOption
):
479 self
.BuildOption
= BuildOption
481 def GetBuildOption(self
):
482 return self
.BuildOption
487 class ModuleObject(ModuleHeaderObject
):
490 # {Arch : ModuleHeaderObject}
496 self
.LibraryClassList
= []
500 self
.SourceFileList
= []
504 self
.BinaryFileList
= []
506 # PackageDependencyObject
508 self
.PackageDependencyList
= []
524 self
.ProtocolList
= []
544 self
.BuildOptionList
= []
546 # UserExtensionObject
548 self
.UserExtensionList
= []
552 self
.MiscFileList
= []
556 self
.ClonedFrom
= None
558 ModuleHeaderObject
.__init
__(self
)
560 def SetHeaderDict(self
, HeaderDict
):
561 self
.HeaderDict
= HeaderDict
563 def GetHeaderDict(self
):
564 return self
.HeaderDict
566 def SetLibraryClassList(self
, LibraryClassList
):
567 self
.LibraryClassList
= LibraryClassList
569 def GetLibraryClassList(self
):
570 return self
.LibraryClassList
572 def SetSourceFileList(self
, SourceFileList
):
573 self
.SourceFileList
= SourceFileList
575 def GetSourceFileList(self
):
576 return self
.SourceFileList
578 def SetBinaryFileList(self
, BinaryFileList
):
579 self
.BinaryFileList
= BinaryFileList
581 def GetBinaryFileList(self
):
582 return self
.BinaryFileList
584 def SetPackageDependencyList(self
, PackageDependencyList
):
585 self
.PackageDependencyList
= PackageDependencyList
587 def GetPackageDependencyList(self
):
588 return self
.PackageDependencyList
590 def SetPeiDepex(self
, PeiDepex
):
591 self
.PeiDepex
= PeiDepex
593 def GetPeiDepex(self
):
596 def SetDxeDepex(self
, DxeDepex
):
597 self
.DxeDepex
= DxeDepex
599 def GetDxeDepex(self
):
602 def SetSmmDepex(self
, SmmDepex
):
603 self
.SmmDepex
= SmmDepex
605 def GetSmmDepex(self
):
608 def SetPpiList(self
, PpiList
):
609 self
.PpiList
= PpiList
611 def GetPpiList(self
):
614 def SetProtocolList(self
, ProtocolList
):
615 self
.ProtocolList
= ProtocolList
617 def GetProtocolList(self
):
618 return self
.ProtocolList
620 def SetPcdList(self
, PcdList
):
621 self
.PcdList
= PcdList
623 def GetPcdList(self
):
626 def SetGuidList(self
, GuidList
):
627 self
.GuidList
= GuidList
629 def GetGuidList(self
):
632 def SetExternList(self
, ExternList
):
633 self
.ExternList
= ExternList
635 def GetExternList(self
):
636 return self
.ExternList
638 def SetBuildOptionList(self
, BuildOptionList
):
639 self
.BuildOptionList
= BuildOptionList
641 def GetBuildOptionList(self
):
642 return self
.BuildOptionList
644 def SetUserExtensionList(self
, UserExtensionList
):
645 self
.UserExtensionList
= UserExtensionList
647 def GetUserExtensionList(self
):
648 return self
.UserExtensionList
650 def SetMiscFileList(self
, MiscFileList
):
651 self
.MiscFileList
= MiscFileList
653 def GetMiscFileList(self
):
654 return self
.MiscFileList
656 def SetClonedFrom(self
, ClonedFrom
):
657 self
.ClonedFrom
= ClonedFrom
659 def GetClonedFrom(self
):
660 return self
.ClonedFrom