]>
git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Source/Python/UPT/Object/POM/ModuleObject.py
2 # This file is used to define a class object to describe a module
4 # Copyright (c) 2011, 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 HelpTextListObject
25 from Object
.POM
.CommonObject
import GuidVersionObject
31 class BootModeObject(CommonPropertiesObject
, HelpTextListObject
):
33 self
.SupportedBootModes
= ''
34 CommonPropertiesObject
.__init
__(self
)
35 HelpTextListObject
.__init
__(self
)
37 def SetSupportedBootModes(self
, SupportedBootModes
):
38 self
.SupportedBootModes
= SupportedBootModes
40 def GetSupportedBootModes(self
):
41 return self
.SupportedBootModes
46 class EventObject(CommonPropertiesObject
, HelpTextListObject
):
49 CommonPropertiesObject
.__init
__(self
)
50 HelpTextListObject
.__init
__(self
)
52 def SetEventType(self
, EventType
):
53 self
.EventType
= EventType
55 def GetEventType(self
):
61 class HobObject(CommonPropertiesObject
, HelpTextListObject
):
64 CommonPropertiesObject
.__init
__(self
)
65 HelpTextListObject
.__init
__(self
)
67 def SetHobType(self
, HobType
):
68 self
.HobType
= HobType
76 class SpecObject(object):
81 def SetSpec(self
, Spec
):
87 def SetVersion(self
, Version
):
88 self
.Version
= Version
95 # This class defined header items used in Module file
97 class ModuleHeaderObject(IdentificationObject
, CommonHeaderObject
):
99 self
.IsLibrary
= False
100 self
.IsLibraryModList
= []
102 self
.BinaryModule
= False
103 self
.PcdIsDriver
= ''
104 self
.PiSpecificationVersion
= ''
105 self
.UefiSpecificationVersion
= ''
113 self
.BootModeList
= []
125 self
.LibraryClassList
= []
126 self
.SupArchList
= []
127 IdentificationObject
.__init
__(self
)
128 CommonHeaderObject
.__init
__(self
)
130 def SetIsLibrary(self
, IsLibrary
):
131 self
.IsLibrary
= IsLibrary
133 def GetIsLibrary(self
):
134 return self
.IsLibrary
136 def SetIsLibraryModList(self
, IsLibraryModList
):
137 self
.IsLibraryModList
= IsLibraryModList
139 def GetIsLibraryModList(self
):
140 return self
.IsLibraryModList
142 def SetModuleType(self
, ModuleType
):
143 self
.ModuleType
= ModuleType
145 def GetModuleType(self
):
146 return self
.ModuleType
148 def SetBinaryModule(self
, BinaryModule
):
149 self
.BinaryModule
= BinaryModule
151 def GetBinaryModule(self
):
152 return self
.BinaryModule
154 def SetPcdIsDriver(self
, PcdIsDriver
):
155 self
.PcdIsDriver
= PcdIsDriver
157 def GetPcdIsDriver(self
):
158 return self
.PcdIsDriver
160 def SetPiSpecificationVersion(self
, PiSpecificationVersion
):
161 self
.PiSpecificationVersion
= PiSpecificationVersion
163 def GetPiSpecificationVersion(self
):
164 return self
.PiSpecificationVersion
166 def SetUefiSpecificationVersion(self
, UefiSpecificationVersion
):
167 self
.UefiSpecificationVersion
= UefiSpecificationVersion
169 def GetUefiSpecificationVersion(self
):
170 return self
.UefiSpecificationVersion
172 def SetSpecList(self
, SpecList
):
173 self
.SpecList
= SpecList
175 def GetSpecList(self
):
178 def SetBootModeList(self
, BootModeList
):
179 self
.BootModeList
= BootModeList
181 def GetBootModeList(self
):
182 return self
.BootModeList
184 def SetEventList(self
, EventList
):
185 self
.EventList
= EventList
187 def GetEventList(self
):
188 return self
.EventList
190 def SetHobList(self
, HobList
):
191 self
.HobList
= HobList
193 def GetHobList(self
):
196 def SetLibraryClassList(self
, LibraryClassList
):
197 self
.LibraryClassList
= LibraryClassList
199 def GetLibraryClassList(self
):
200 return self
.LibraryClassList
202 def SetSupArchList(self
, SupArchList
):
203 self
.SupArchList
= SupArchList
205 def GetSupArchList(self
):
206 return self
.SupArchList
211 class SourceFileObject(CommonPropertiesObject
):
213 CommonPropertiesObject
.__init
__(self
)
220 def SetSourceFile(self
, SourceFile
):
221 self
.SourceFile
= SourceFile
223 def GetSourceFile(self
):
224 return self
.SourceFile
226 def SetTagName(self
, TagName
):
227 self
.TagName
= TagName
229 def GetTagName(self
):
232 def SetToolCode(self
, ToolCode
):
233 self
.ToolCode
= ToolCode
235 def GetToolCode(self
):
238 def SetFamily(self
, Family
):
244 def SetFileType(self
, FileType
):
245 self
.FileType
= FileType
247 def GetFileType(self
):
254 class BinaryFileObject(CommonPropertiesObject
):
256 self
.FileNamList
= []
257 self
.AsBuiltList
= []
258 CommonPropertiesObject
.__init
__(self
)
260 def SetFileNameList(self
, FileNamList
):
261 self
.FileNamList
= FileNamList
263 def GetFileNameList(self
):
264 return self
.FileNamList
266 def SetAsBuiltList(self
, AsBuiltList
):
267 self
.AsBuiltList
= AsBuiltList
269 def GetAsBuiltList(self
):
270 return self
.AsBuiltList
274 # AsBuildLibraryClassObject
276 class AsBuildLibraryClassObject(object):
281 def SetLibGuid(self
, LibGuid
):
282 self
.LibGuid
= LibGuid
283 def GetLibGuid(self
):
286 def SetLibVersion(self
, LibVersion
):
287 self
.LibVersion
= LibVersion
288 def GetLibVersion(self
):
289 return self
.LibVersion
294 class AsBuiltObject(object):
299 self
.PatchPcdList
= []
303 self
.PcdExValueList
= []
305 # list of GuidVersionObject
307 self
.LibraryInstancesList
= []
309 # List of BinaryBuildFlag object
311 self
.BinaryBuildFlagList
= ''
313 def SetPatchPcdList(self
, PatchPcdList
):
314 self
.PatchPcdList
= PatchPcdList
316 def GetPatchPcdList(self
):
317 return self
.PatchPcdList
319 def SetPcdExList(self
, PcdExValueList
):
320 self
.PcdExValueList
= PcdExValueList
322 def GetPcdExList(self
):
323 return self
.PcdExValueList
325 def SetLibraryInstancesList(self
, LibraryInstancesList
):
326 self
.LibraryInstancesList
= LibraryInstancesList
328 def GetLibraryInstancesList(self
):
329 return self
.LibraryInstancesList
331 def SetBuildFlagsList(self
, BinaryBuildFlagList
):
332 self
.BinaryBuildFlagList
= BinaryBuildFlagList
334 def GetBuildFlagsList(self
):
335 return self
.BinaryBuildFlagList
338 # BinaryBuildFlag, this object will include those fields that are not
339 # covered by the UPT Spec BinaryFile field
341 class BinaryBuildFlagObject(object):
346 self
.AsBuiltOptionFlags
= ''
348 def SetTarget(self
, Target
):
354 def SetTagName(self
, TagName
):
355 self
.TagName
= TagName
357 def GetTagName(self
):
360 def SetFamily(self
, Family
):
366 def SetAsBuiltOptionFlags(self
, AsBuiltOptionFlags
):
367 self
.AsBuiltOptionFlags
= AsBuiltOptionFlags
368 def GetAsBuiltOptionFlags(self
):
369 return self
.AsBuiltOptionFlags
374 class ExternObject(CommonPropertiesObject
):
377 self
.UnloadImage
= ''
378 self
.Constructor
= ''
381 CommonPropertiesObject
.__init
__(self
)
383 def SetEntryPoint(self
, EntryPoint
):
384 self
.EntryPoint
= EntryPoint
386 def GetEntryPoint(self
):
387 return self
.EntryPoint
389 def SetUnloadImage(self
, UnloadImage
):
390 self
.UnloadImage
= UnloadImage
392 def GetUnloadImage(self
):
393 return self
.UnloadImage
395 def SetConstructor(self
, Constructor
):
396 self
.Constructor
= Constructor
398 def GetConstructor(self
):
399 return self
.Constructor
401 def SetDestructor(self
, Destructor
):
402 self
.Destructor
= Destructor
404 def GetDestructor(self
):
405 return self
.Destructor
407 def SetSupModList(self
, SupModList
):
408 self
.SupModList
= SupModList
409 def GetSupModList(self
):
410 return self
.SupModList
415 class DepexObject(CommonPropertiesObject
):
419 CommonPropertiesObject
.__init
__(self
)
421 def SetDepex(self
, Depex
):
427 def SetModuleType(self
, ModuleType
):
428 self
.ModuelType
= ModuleType
430 def GetModuleType(self
):
431 return self
.ModuelType
434 # PackageDependencyObject
436 class PackageDependencyObject(GuidVersionObject
, CommonPropertiesObject
):
439 self
.PackageFilePath
= ''
440 GuidVersionObject
.__init
__(self
)
441 CommonPropertiesObject
.__init
__(self
)
443 def SetPackageFilePath(self
, PackageFilePath
):
444 self
.PackageFilePath
= PackageFilePath
446 def GetPackageFilePath(self
):
447 return self
.PackageFilePath
449 def SetPackage(self
, Package
):
450 self
.Package
= Package
452 def GetPackage(self
):
458 class BuildOptionObject(CommonPropertiesObject
):
460 CommonPropertiesObject
.__init
__(self
)
461 self
.BuildOption
= ''
463 def SetBuildOption(self
, BuildOption
):
464 self
.BuildOption
= BuildOption
466 def GetBuildOption(self
):
467 return self
.BuildOption
472 class ModuleObject(ModuleHeaderObject
):
475 # {Arch : ModuleHeaderObject}
481 self
.LibraryClassList
= []
485 self
.SourceFileList
= []
489 self
.BinaryFileList
= []
491 # PackageDependencyObject
493 self
.PackageDependencyList
= []
509 self
.ProtocolList
= []
529 self
.BuildOptionList
= []
531 # UserExtensionObject
533 self
.UserExtensionList
= []
537 self
.MiscFileList
= []
541 self
.ClonedFrom
= None
543 ModuleHeaderObject
.__init
__(self
)
545 def SetHeaderDict(self
, HeaderDict
):
546 self
.HeaderDict
= HeaderDict
548 def GetHeaderDict(self
):
549 return self
.HeaderDict
551 def SetLibraryClassList(self
, LibraryClassList
):
552 self
.LibraryClassList
= LibraryClassList
554 def GetLibraryClassList(self
):
555 return self
.LibraryClassList
557 def SetSourceFileList(self
, SourceFileList
):
558 self
.SourceFileList
= SourceFileList
560 def GetSourceFileList(self
):
561 return self
.SourceFileList
563 def SetBinaryFileList(self
, BinaryFileList
):
564 self
.BinaryFileList
= BinaryFileList
566 def GetBinaryFileList(self
):
567 return self
.BinaryFileList
569 def SetPackageDependencyList(self
, PackageDependencyList
):
570 self
.PackageDependencyList
= PackageDependencyList
572 def GetPackageDependencyList(self
):
573 return self
.PackageDependencyList
575 def SetPeiDepex(self
, PeiDepex
):
576 self
.PeiDepex
= PeiDepex
578 def GetPeiDepex(self
):
581 def SetDxeDepex(self
, DxeDepex
):
582 self
.DxeDepex
= DxeDepex
584 def GetDxeDepex(self
):
587 def SetSmmDepex(self
, SmmDepex
):
588 self
.SmmDepex
= SmmDepex
590 def GetSmmDepex(self
):
593 def SetPpiList(self
, PpiList
):
594 self
.PpiList
= PpiList
596 def GetPpiList(self
):
599 def SetProtocolList(self
, ProtocolList
):
600 self
.ProtocolList
= ProtocolList
602 def GetProtocolList(self
):
603 return self
.ProtocolList
605 def SetPcdList(self
, PcdList
):
606 self
.PcdList
= PcdList
608 def GetPcdList(self
):
611 def SetGuidList(self
, GuidList
):
612 self
.GuidList
= GuidList
614 def GetGuidList(self
):
617 def SetExternList(self
, ExternList
):
618 self
.ExternList
= ExternList
620 def GetExternList(self
):
621 return self
.ExternList
623 def SetBuildOptionList(self
, BuildOptionList
):
624 self
.BuildOptionList
= BuildOptionList
626 def GetBuildOptionList(self
):
627 return self
.BuildOptionList
629 def SetUserExtensionList(self
, UserExtensionList
):
630 self
.UserExtensionList
= UserExtensionList
632 def GetUserExtensionList(self
):
633 return self
.UserExtensionList
635 def SetMiscFileList(self
, MiscFileList
):
636 self
.MiscFileList
= MiscFileList
638 def GetMiscFileList(self
):
639 return self
.MiscFileList
641 def SetClonedFrom(self
, ClonedFrom
):
642 self
.ClonedFrom
= ClonedFrom
644 def GetClonedFrom(self
):
645 return self
.ClonedFrom