sbsv2/raptor/python/raptor.py
branchfix
changeset 268 692d9a4eefc4
parent 226 59f343577f92
child 372 e6d6373c0c3a
child 451 153129bf777e
equal deleted inserted replaced
250:019dafe54c23 268:692d9a4eefc4
   236 		     # to be able to simulate the overall recursive unfurling of a build.
   236 		     # to be able to simulate the overall recursive unfurling of a build.
   237 
   237 
   238 class Component(ModelNode):
   238 class Component(ModelNode):
   239 	"""A group of projects or, in symbian-speak, a bld.inf.
   239 	"""A group of projects or, in symbian-speak, a bld.inf.
   240 	"""
   240 	"""
   241 	def __init__(self, filename):
   241 	def __init__(self, filename, layername="", componentname=""):
   242 		super(Component,self).__init__(filename)
   242 		super(Component,self).__init__(filename)
   243 		# Assume that components are specified in bld.inf files for now
   243 		# Assume that components are specified in bld.inf files for now
   244 		# One day that tyranny might end.
   244 		# One day that tyranny might end.
   245 		self.bldinf = None # Slot for a bldinf object if we spot one later
   245 		self.bldinf = None # Slot for a bldinf object if we spot one later
   246 		self.bldinf_filename = generic_path.Path.Absolute(filename)
   246 		self.bldinf_filename = generic_path.Path.Absolute(filename)
   247 
   247 
   248 		self.id = str(self.bldinf_filename)
   248 		self.id = str(self.bldinf_filename)
   249 		self.exportspecs = []
   249 		self.exportspecs = []
   250 		self.depfiles = []
   250 		self.depfiles = []
   251 		self.unfurled = False # We can parse this
   251 		self.unfurled = False # We can parse this
       
   252 		
       
   253 		# Extra metadata optionally supplied with system definition file gathered components
       
   254 		self.layername = layername
       
   255 		self.componentname = componentname
   252 
   256 
   253 	def AddMMP(self, filename):
   257 	def AddMMP(self, filename):
   254 		self.children.add(Project(filename))
   258 		self.children.add(Project(filename))
   255 
   259 
   256 
   260 
   257 class Layer(ModelNode):
   261 class Layer(ModelNode):
   258 	""" 	Some components that should be built togther
   262 	""" Some components that should be built togther
   259 		e.g. a Layer in the system definition.
   263 		e.g. a Layer in the system definition.
       
   264 		
       
   265 		Components that come from system definition files can
       
   266 		have extra surrounding metadata that we need to pass
       
   267 		on for use in log output.
   260 	"""
   268 	"""
   261 	def __init__(self, name, componentlist=[]):
   269 	def __init__(self, name, componentlist=[]):
   262 		super(Layer,self).__init__(name)
   270 		super(Layer,self).__init__(name)
   263 		self.name = name
   271 		self.name = name
   264 
   272 
   265 		for c in componentlist:
   273 		for c in componentlist:
   266 			self.children.add(Component(c))
   274 			if isinstance(c, raptor_xml.SystemModelComponent):
       
   275 				# this component came from a system_definition.xml
       
   276 				self.children.add(Component(c, c.GetContainerName("layer"), c.GetContainerName("component")))
       
   277 			else:
       
   278 				# this is a plain old bld.inf file from the command-line
       
   279 				self.children.add(Component(c))
   267 
   280 
   268 	def unfurl(self, build):
   281 	def unfurl(self, build):
   269 		"""Discover the children of this layer. This involves parsing the component MetaData (bld.infs, mmps).
   282 		"""Discover the children of this layer. This involves parsing the component MetaData (bld.infs, mmps).
   270 		Takes a raptor object as a parameter (build), together with a list of Configurations.
   283 		Takes a raptor object as a parameter (build), together with a list of Configurations.
   271 
   284