sbsv2/raptor/python/raptor_meta.py
branchwip
changeset 12 2cfea3290625
parent 11 ea23b18a2ff6
parent 9 b211d87c390a
child 14 45cdac6e50c6
equal deleted inserted replaced
11:ea23b18a2ff6 12:2cfea3290625
  1212 		super(MMPRaptorBackend,self).__init__()
  1212 		super(MMPRaptorBackend,self).__init__()
  1213 		self.platformblock = None
  1213 		self.platformblock = None
  1214 		self.__Raptor = aRaptor
  1214 		self.__Raptor = aRaptor
  1215 		self.__debug("-----+++++ %s " % aMmpfilename)
  1215 		self.__debug("-----+++++ %s " % aMmpfilename)
  1216 		self.BuildVariant = raptor_data.Variant(name = "mmp")
  1216 		self.BuildVariant = raptor_data.Variant(name = "mmp")
       
  1217 		self.ApplyVariants = []
  1217 		self.ResourceVariants = []
  1218 		self.ResourceVariants = []
  1218 		self.BitmapVariants = []
  1219 		self.BitmapVariants = []
  1219 		self.StringTableVariants = []
  1220 		self.StringTableVariants = []
  1220 		self.__bldInfFilename = aBldInfFilename
  1221 		self.__bldInfFilename = aBldInfFilename
  1221 		self.__targettype = "UNKNOWN"
  1222 		self.__targettype = "UNKNOWN"
  1225 		self.__sourcepath = raptor_utilities.resolveSymbianPath(self.__currentMmpFile, "")
  1226 		self.__sourcepath = raptor_utilities.resolveSymbianPath(self.__currentMmpFile, "")
  1226 		self.__userinclude = ""
  1227 		self.__userinclude = ""
  1227 		self.__systeminclude = ""
  1228 		self.__systeminclude = ""
  1228 		self.__bitmapSourcepath = self.__sourcepath
  1229 		self.__bitmapSourcepath = self.__sourcepath
  1229 		self.__current_resource = ""
  1230 		self.__current_resource = ""
       
  1231 		self.__resourceFiles = []
  1230 		self.__pageConflict = []
  1232 		self.__pageConflict = []
  1231 		self.__debuggable = ""
  1233 		self.__debuggable = ""
  1232 		self.__resourceFiles = []
  1234 		self.__compressionKeyword = ""
  1233 		self.sources = []
  1235 		self.sources = []
  1234 		self.capabilities = []
  1236 		self.capabilities = []
  1235 
  1237 
  1236 		self.__TARGET = ""
  1238 		self.__TARGET = ""
  1237 		self.__TARGETEXT = ""
  1239 		self.__TARGETEXT = ""
  1355 				self.__Raptor.Warn("DEBUGGABLE keyword has no effect as DEBUGGABLE or DEBUGGABLE_UDEBONLY is already set")
  1357 				self.__Raptor.Warn("DEBUGGABLE keyword has no effect as DEBUGGABLE or DEBUGGABLE_UDEBONLY is already set")
  1356 			self.__debuggable = "udeb"
  1358 			self.__debuggable = "udeb"
  1357 		elif varname == 'FEATUREVARIANT':
  1359 		elif varname == 'FEATUREVARIANT':
  1358 			self.BuildVariant.AddOperation(raptor_data.Set(varname,"1"))
  1360 			self.BuildVariant.AddOperation(raptor_data.Set(varname,"1"))
  1359 			self.featureVariant = True
  1361 			self.featureVariant = True
       
  1362 		elif varname in ['COMPRESSTARGET', 'NOCOMPRESSTARGET', 'INFLATECOMPRESSTARGET', 'BYTEPAIRCOMPRESSTARGET']:
       
  1363 			if self.__compressionKeyword:
       
  1364 				self.__Raptor.Warn("%s keyword in %s overrides earlier use of %s" % (varname, self.__currentMmpFile, self.__compressionKeyword))
       
  1365 				self.BuildVariant.AddOperation(raptor_data.Set(self.__compressionKeyword,""))
       
  1366 				self.__debug( "Set switch " + varname + " OFF")
       
  1367 			self.BuildVariant.AddOperation(raptor_data.Set(varname,"1"))
       
  1368 			self.__debug( "Set switch " + varname + " ON")
       
  1369 			self.__compressionKeyword = varname
  1360 		else:
  1370 		else:
  1361 			self.__debug( "Set switch "+toks[0]+" ON")
  1371 			self.__debug( "Set switch "+toks[0]+" ON")
  1362 			self.BuildVariant.AddOperation(raptor_data.Set(prefix+varname, "1"))
  1372 			self.BuildVariant.AddOperation(raptor_data.Set(prefix+varname, "1"))
  1363 
  1373 
  1364 		return "OK"
  1374 		return "OK"
  1535 				toks1 = str(toks[1]).replace("\\","/")
  1545 				toks1 = str(toks[1]).replace("\\","/")
  1536 				if toks1.find(","):
  1546 				if toks1.find(","):
  1537 					toks1 = re.sub("[,'\[\]]", "", toks1).replace("//","/")
  1547 					toks1 = re.sub("[,'\[\]]", "", toks1).replace("//","/")
  1538 				self.__debug("Set "+toks[0]+" to " + toks1)
  1548 				self.__debug("Set "+toks[0]+" to " + toks1)
  1539 				self.BuildVariant.AddOperation(raptor_data.Set(varname,toks1))
  1549 				self.BuildVariant.AddOperation(raptor_data.Set(varname,toks1))
  1540 
  1550 		elif varname=='APPLY':
       
  1551 			self.ApplyVariants.append(toks[1])
  1541 		else:
  1552 		else:
  1542 			self.__debug("Set "+toks[0]+" to " + str(toks[1]))
  1553 			self.__debug("Set "+toks[0]+" to " + str(toks[1]))
  1543 			self.BuildVariant.AddOperation(raptor_data.Set(varname,"".join(toks[1])))
  1554 			self.BuildVariant.AddOperation(raptor_data.Set(varname,"".join(toks[1])))
  1544 
  1555 
  1545 			if varname=='LINKAS':
  1556 			if varname=='LINKAS':
  3153 					var.AddOperation(raptor_data.Append("EXPORTHEADERS", str(exportfile)))
  3164 					var.AddOperation(raptor_data.Append("EXPORTHEADERS", str(exportfile)))
  3154 
  3165 
  3155 			# now we have something worth adding to the component
  3166 			# now we have something worth adding to the component
  3156 			mmpSpec.AddVariant(var)
  3167 			mmpSpec.AddVariant(var)
  3157 			componentNode.AddChild(mmpSpec)
  3168 			componentNode.AddChild(mmpSpec)
       
  3169 			
       
  3170 			# if there are APPLY variants then add them to the mmpSpec too
       
  3171 			for applyVar in backend.ApplyVariants:
       
  3172 				try:
       
  3173 					mmpSpec.AddVariant(self.__Raptor.cache.FindNamedVariant(applyVar))
       
  3174 				except KeyError:
       
  3175 					self.__Raptor.Error("APPLY unknown variant '%s' in %s",
       
  3176 								        applyVar,
       
  3177 								        str(mmpFileEntry.filename),
       
  3178 								        bldinf=str(bldInfFile))
  3158 
  3179 
  3159 			# resources, stringtables and bitmaps are sub-nodes of this project
  3180 			# resources, stringtables and bitmaps are sub-nodes of this project
  3160 			# (do not add these for feature variant builds)
  3181 			# (do not add these for feature variant builds)
  3161 			
  3182 			
  3162 			if not buildPlatform["ISFEATUREVARIANT"]:
  3183 			if not buildPlatform["ISFEATUREVARIANT"]: