2 # This file is used to define a class object to describe a platform
4 # Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
5 # This program and the accompanying materials
6 # are licensed and made available under the terms and conditions of the BSD License
7 # which accompanies this distribution. The full text of the license may be found at
8 # http://opensource.org/licenses/bsd-license.php
10 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 from CommonClass
import *
20 # This class defined sku info list item used in platform file
22 # @param IncludeStatementClass: Inherited from IncludeStatementClass class
24 # @var SkuInfoList: To store value for SkuInfoList, it is a set structure as
27 class SkuInfoListClass(IncludeStatementClass
):
29 IncludeStatementClass
.__init
__(self
)
32 ## PlatformHeaderClass
34 # This class defined header items used in Platform file
36 # @param IdentificationClass: Inherited from IdentificationClass class
37 # @param CommonHeaderClass: Inherited from CommonHeaderClass class
38 # @param DefineClass: Inherited from DefineClass class
40 # @var DscSpecification: To store value for DscSpecification
41 # @var SupArchList: To store value for SupArchList, selection scope is in below list
42 # EBC | IA32 | X64 | IPF | ARM | PPC
43 # @var BuildTargets: To store value for BuildTargets, selection scope is in below list
45 # @var IntermediateDirectories: To store value for IntermediateDirectories, selection scope is in below list
47 # @var OutputDirectory: To store value for OutputDirectory
48 # @var ForceDebugTarget: To store value for ForceDebugTarget
49 # @var SkuIdName: To store value for SkuIdName
50 # @var BuildNumber: To store value for BuildNumber
51 # @var MakefileName: To store value for MakefileName
52 # @var ClonedFrom: To store value for ClonedFrom, it is a list structure as
53 # [ ClonedRecordClass, ... ]
55 class PlatformHeaderClass(IdentificationClass
, CommonHeaderClass
, DefineClass
):
57 IdentificationClass
.__init
__(self
)
58 CommonHeaderClass
.__init
__(self
)
59 DefineClass
.__init
__(self
)
60 self
.DscSpecification
= ''
62 self
.BuildTargets
= []
63 self
.IntermediateDirectories
= ''
64 self
.OutputDirectory
= ''
65 self
.ForceDebugTarget
= ''
68 self
.MakefileName
= ''
71 ## PlatformFlashDefinitionFileClass
73 # This class defined FlashDefinitionFile item used in platform file
75 # @param object: Inherited from object class
77 # @var Id: To store value for Id
78 # @var UiName: To store value for UiName
79 # @var Preferred: To store value for Preferred
80 # @var FilePath: To store value for FilePath
82 class PlatformFlashDefinitionFileClass(object):
86 self
.Preferred
= False
89 ## PlatformFvImageOptionClass
91 # This class defined FvImageOption item used in platform file
93 # @param object: Inherited from object class
95 # @var FvImageOptionName: To store value for FvImageOptionName
96 # @var FvImageOptionValues: To store value for FvImageOptionValues
98 class PlatformFvImageOptionClass(object):
100 self
.FvImageOptionName
= ''
101 self
.FvImageOptionValues
= []
103 ## PlatformFvImageClass
105 # This class defined FvImage item used in platform file
107 # @param object: Inherited from object class
109 # @var Name: To store value for Name
110 # @var Value: To store value for Value
111 # @var Type: To store value for Type, selection scope is in below list
112 # Attributes | Options | Components | ImageName
113 # @var FvImageNames: To store value for FvImageNames
114 # @var FvImageOptions: To store value for FvImageOptions, it is a list structure as
115 # [ PlatformFvImageOption, ...]
117 class PlatformFvImageClass(object):
122 self
.FvImageNames
= []
123 self
.FvImageOptions
= []
125 ## PlatformFvImageNameClass
127 # This class defined FvImageName item used in platform file
129 # @param object: Inherited from object class
131 # @var Name: To store value for Name
132 # @var Type: To store value for Type, selection scope is in below list
133 # FV_MAIN | FV_MAIN_COMPACT | NV_STORAGE | FV_RECOVERY | FV_RECOVERY_FLOPPY | FV_FILE | CAPSULE_CARGO | NULL | USER_DEFINED
134 # @var FvImageOptions: To store value for FvImageOptions, it is a list structure as
135 # [ PlatformFvImageOption, ...]
137 class PlatformFvImageNameClass(object):
141 self
.FvImageOptions
= []
143 ## PlatformFvImagesClass
145 # This class defined FvImages item used in platform file
147 # @param object: Inherited from object class
149 # @var FvImages: To store value for FvImages
151 class PlatformFvImagesClass(object):
155 ## PlatformAntTaskClass
157 # This class defined AntTask item used in platform file
159 # @param object: Inherited from object class
161 # @var Id: To store value for Id
162 # @var AntCmdOptions: To store value for AntCmdOptions
163 # @var FilePath: To store value for FilePath
165 class PlatformAntTaskClass(object):
168 self
.AntCmdOptions
= ''
171 ## PlatformFfsSectionClass
173 # This class defined FfsSection item used in platform file
175 # @param CommonClass: Inherited from CommonClass class
177 # @var BindingOrder: To store value for BindingOrder
178 # @var Compressible: To store value for Compressible
179 # @var SectionType: To store value for SectionType
180 # @var EncapsulationType: To store value for EncapsulationType
181 # @var ToolName: To store value for ToolName
182 # @var Filenames: To store value for Filenames
183 # @var Args: To store value for Args
184 # @var OutFile: To store value for OutFile
185 # @var OutputFileExtension: To store value for OutputFileExtension
186 # @var ToolNameElement: To store value for ToolNameElement
188 class PlatformFfsSectionClass(CommonClass
):
190 CommonClass
.__init
__(self
)
191 self
.BindingOrder
= ''
192 self
.Compressible
= ''
193 self
.SectionType
= ''
194 self
.EncapsulationType
= ''
199 self
.OutputFileExtension
= ''
200 self
.ToolNameElement
= ''
202 ## PlatformFfsSectionsClass
204 # This class defined FfsSections item used in platform file
206 # @param CommonClass: Inherited from CommonClass class
208 # @var BindingOrder: To store value for BindingOrder
209 # @var Compressible: To store value for Compressible
210 # @var SectionType: To store value for SectionType
211 # @var EncapsulationType: To store value for EncapsulationType
212 # @var ToolName: To store value for ToolName
213 # @var Section: To store value for Section, it is a list structure as
214 # [ PlatformFfsSectionClass, ... ]
215 # @var Sections: To store value for Sections, it is a list structure as
216 # [ PlatformFfsSectionsClass, ...]
218 class PlatformFfsSectionsClass(CommonClass
):
220 CommonClass
.__init
__(self
)
221 self
.BindingOrder
= ''
222 self
.Compressible
= ''
223 self
.SectionType
= ''
224 self
.EncapsulationType
= ''
231 # This class defined Ffs item used in platform file
233 # @param object: Inherited from object class
235 # @var Attribute: To store value for Attribute, it is a set structure as
236 # { [(Name, PlatformFfsSectionsClass)] : Value}
237 # @var Sections: To store value for Sections, it is a list structure as
238 # [ PlatformFfsSectionsClass]
239 # @var ToolName: To store value for ToolName
241 class PlatformFfsClass(object):
247 ## PlatformBuildOptionClass
249 # This class defined BuildOption item used in platform file
251 # @param object: Inherited from object class
253 # @var UserDefinedAntTasks: To store value for UserDefinedAntTasks, it is a set structure as
254 # { [Id] : PlatformAntTaskClass, ...}
255 # @var Options: To store value for Options, it is a list structure as
256 # [ BuildOptionClass, ...]
257 # @var UserExtensions: To store value for UserExtensions, it is a set structure as
258 # { [(UserID, Identifier)] : UserExtensionsClass, ...}
259 # @var FfsKeyList: To store value for FfsKeyList, it is a set structure as
260 # { [FfsKey]: PlatformFfsClass, ...}
262 class PlatformBuildOptionClass(object):
264 self
.UserDefinedAntTasks
= {}
266 self
.UserExtensions
= {}
269 ## PlatformBuildOptionClasses
271 # This class defined BuildOption item list used in platform file
273 # @param IncludeStatementClass: Inherited from IncludeStatementClass class
275 # @var FvBinding: To store value for FvBinding
276 # @var FfsFileNameGuid: To store value for FfsFileNameGuid
277 # @var FfsFormatKey: To store value for FfsFormatKey
278 # @var BuildOptionList: To store value for BuildOptionList, it is a list structure as
279 # [ BuildOptionClass, ... ]
281 class PlatformBuildOptionClasses(IncludeStatementClass
):
283 IncludeStatementClass
.__init
__(self
)
285 self
.FfsFileNameGuid
= ''
286 self
.FfsFormatKey
= ''
287 self
.BuildOptionList
= []
289 ## PlatformLibraryClass
291 # This class defined Library item used in platform file
293 # @param CommonClass: Inherited from CommonClass class
294 # @param DefineClass: Inherited from DefineClass class
295 # @param Name: Input value for Name, default is ''
296 # @param FilePath: Input value for FilePath, default is ''
298 # @var Name: To store value for Name
299 # @var FilePath: To store value for FilePath
300 # @var ModuleType: To store value for ModuleType
301 # @var SupModuleList: To store value for SupModuleList
302 # @var ModuleGuid: To store value for ModuleGuid
303 # @var ModuleVersion: To store value for ModuleVersion
304 # @var PackageGuid: To store value for PackageGuid
305 # @var PackageVersion: To store value for PackageVersion
307 class PlatformLibraryClass(CommonClass
, DefineClass
):
308 def __init__(self
, Name
= '', FilePath
= ''):
309 CommonClass
.__init
__(self
)
310 DefineClass
.__init
__(self
)
312 self
.FilePath
= FilePath
314 self
.SupModuleList
= []
316 self
.ModuleVersion
= ''
317 self
.PackageGuid
= ''
318 self
.PackageVersion
= ''
320 ## PlatformLibraryClasses
322 # This class defined Library item list used in platform file
324 # @param IncludeStatementClass: Inherited from IncludeStatementClass class
326 # @var LibraryList: To store value for LibraryList, it is a list structure as
327 # [ PlatformLibraryClass, ... ]
329 class PlatformLibraryClasses(IncludeStatementClass
):
331 IncludeStatementClass
.__init
__(self
)
332 self
.LibraryList
= []
334 ## PlatformModuleClass
336 # This class defined Module item used in platform file
338 # @param CommonClass: Inherited from CommonClass class
339 # @param DefineClass: Inherited from DefineClass class
340 # @param IncludeStatementClass: Inherited from IncludeStatementClass class
342 # @var Name: To store value for Name (Library name or libraryclass name or module name)
343 # @var FilePath: To store value for FilePath
344 # @var Type: To store value for Type, selection scope is in below list
345 # LIBRARY | LIBRARY_CLASS | MODULE
346 # @var ModuleType: To store value for ModuleType
347 # @var ExecFilePath: To store value for ExecFilePath
348 # @var LibraryClasses: To store value for LibraryClasses, it is a structure as
349 # PlatformLibraryClasses
350 # @var PcdBuildDefinitions: To store value for PcdBuildDefinitions, it is a list structure as
352 # @var ModuleSaBuildOption: To store value for ModuleSaBuildOption, it is a structure as
353 # PlatformBuildOptionClasses
354 # @var Specifications: To store value for Specifications, it is a list structure as
357 class PlatformModuleClass(CommonClass
, DefineClass
, IncludeStatementClass
):
359 CommonClass
.__init
__(self
)
360 DefineClass
.__init
__(self
)
365 self
.ExecFilePath
= ''
366 self
.LibraryClasses
= PlatformLibraryClasses()
367 self
.PcdBuildDefinitions
= []
368 self
.ModuleSaBuildOption
= PlatformBuildOptionClasses()
369 self
.Specifications
= []
370 self
.SourceOverridePath
= ''
372 ## PlatformModuleClasses
374 # This class defined Module item list used in platform file
376 # @param IncludeStatementClass: Inherited from IncludeStatementClass class
378 # @var ModuleList: To store value for ModuleList, it is a list structure as
379 # [ PlatformModuleClass, ... ]
381 class PlatformModuleClasses(IncludeStatementClass
):
383 IncludeStatementClass
.__init
__(self
)
388 # This class defined a complete platform item
390 # @param object: Inherited from object class
392 # @var Header: To store value for Header, it is a structure as
393 # {Arch : PlatformHeaderClass()}
394 # @var SkuInfos: To store value for SkuInfos, it is a structure as
396 # @var Libraries: To store value for Libraries, it is a structure as
397 # PlatformLibraryClasses
398 # @var LibraryClasses: To store value for LibraryClasses, it is a structure as
399 # PlatformLibraryClasses
400 # @var Modules: To store value for Modules, it is a structure as
401 # PlatformModuleClasses
402 # @var FlashDefinitionFile: To store value for FlashDefinitionFile, it is a structure as
403 # PlatformFlashDefinitionFileClass
404 # @var BuildOptions: To store value for BuildOptions, it is a structure as
405 # PlatformBuildOptionClasses
406 # @var DynamicPcdBuildDefinitions: To store value for DynamicPcdBuildDefinitions, it is a list structure as
408 # @var Fdf: To store value for Fdf, it is a list structure as
410 # @var UserExtensions: To store value for UserExtensions, it is a list structure as
411 # [ UserExtensionsClass, ...]
413 class PlatformClass(object):
416 self
.SkuInfos
= SkuInfoListClass()
417 self
.Libraries
= PlatformLibraryClasses()
418 self
.LibraryClasses
= PlatformLibraryClasses()
419 self
.Modules
= PlatformModuleClasses()
420 self
.FlashDefinitionFile
= PlatformFlashDefinitionFileClass()
421 self
.BuildOptions
= PlatformBuildOptionClasses()
422 self
.DynamicPcdBuildDefinitions
= []
424 self
.UserExtensions
= []
428 # This acts like the main() function for the script, unless it is 'import'ed into another
431 if __name__
== '__main__':