396 |
409 |
397 Symbian metadata files are subject to preprocessing, primarily with macros based |
410 Symbian metadata files are subject to preprocessing, primarily with macros based |
398 on the selected build platform. This class provides a generic means of wrapping |
411 on the selected build platform. This class provides a generic means of wrapping |
399 up the preprocessing of such files.""" |
412 up the preprocessing of such files.""" |
400 |
413 |
401 def __init__(self, aFilename, gnucpp, aRootLocation=None, log=None): |
414 def __init__(self, aFilename, gnucpp, depfiles, aRootLocation=None, log=None): |
402 """ |
415 """ |
403 @param aFilename An MMP, bld.inf or other preprocessable build spec file |
416 @param aFilename An MMP, bld.inf or other preprocessable build spec file |
404 @param aDefaultPlatform Default preprocessed version of this file |
417 @param aDefaultPlatform Default preprocessed version of this file |
405 @param aCPP location of GNU CPP |
418 @param aCPP location of GNU CPP |
|
419 @param depfiles list to add dependency file tuples to |
|
420 @param aRootLocation where the file is |
406 @param log A class with Debug(<string>), Info(<string>) and Error(<string>) methods |
421 @param log A class with Debug(<string>), Info(<string>) and Error(<string>) methods |
407 """ |
422 """ |
408 self.filename = aFilename |
423 self.filename = aFilename |
409 self.__RootLocation = aRootLocation |
424 self.__RootLocation = aRootLocation |
410 # Dictionary with key of build platform and a text string of processed output as values |
425 # Dictionary with key of build platform and a text string of processed output as values |
411 self.__PreProcessedContent = {} |
426 self.__PreProcessedContent = {} |
412 self.log = log |
427 self.log = log |
|
428 self.depfiles = depfiles |
413 |
429 |
414 self.__gnucpp = gnucpp |
430 self.__gnucpp = gnucpp |
415 if gnucpp is None: |
431 if gnucpp is None: |
416 raise ValueError('gnucpp must be set') |
432 raise ValueError('gnucpp must be set') |
417 |
433 |
513 |
529 |
514 Symbian metadata files are subject to preprocessing, primarily with macros based |
530 Symbian metadata files are subject to preprocessing, primarily with macros based |
515 on the selected build platform. This class provides a generic means of wrapping |
531 on the selected build platform. This class provides a generic means of wrapping |
516 up the preprocessing of such files.""" |
532 up the preprocessing of such files.""" |
517 |
533 |
518 def __init__(self, aFilename, gnucpp, bldinf, log=None): |
534 def __init__(self, aFilename, gnucpp, bldinf, depfiles, log=None): |
519 """ |
535 """ |
520 @param aFilename An MMP, bld.inf or other preprocessable build spec file |
536 @param aFilename An MMP, bld.inf or other preprocessable build spec file |
521 @param gnucpp location of GNU CPP |
537 @param gnucpp location of GNU CPP |
522 @param bldinf the bldinf file that this mmp comes from |
538 @param bldinf the bld.inf file this mmp was specified in |
523 @param log A class with Debug(<string>), Info(<string>) and Error(<string>) methods |
539 @param depfiles list to fill with mmp dependency files |
|
540 @param log A class with Debug(<string>), Info(<string>) and Error(<string>) methods |
524 """ |
541 """ |
525 super(MMPFile, self).__init__(aFilename, gnucpp, str(bldinf.filename.Dir()), log) |
542 super(MMPFile, self).__init__(aFilename, gnucpp, depfiles, str(bldinf.filename.Dir()), log) |
526 self.__bldinf = bldinf |
543 self.__bldinf = bldinf |
|
544 self.depfiles = depfiles |
527 |
545 |
528 self.__gnucpp = gnucpp |
546 self.__gnucpp = gnucpp |
529 if gnucpp is None: |
547 if gnucpp is None: |
530 raise ValueError('gnucpp must be set') |
548 raise ValueError('gnucpp must be set') |
531 |
549 |
2283 resolvedDefFile = raptor_utilities.resolveSymbianPath(self.__defFileRoot, resolvedDefFile, 'DEFFILE', "", str(aBuildPlatform['EPOCROOT'])) |
2304 resolvedDefFile = raptor_utilities.resolveSymbianPath(self.__defFileRoot, resolvedDefFile, 'DEFFILE', "", str(aBuildPlatform['EPOCROOT'])) |
2284 |
2305 |
2285 return resolvedDefFile |
2306 return resolvedDefFile |
2286 |
2307 |
2287 |
2308 |
|
2309 def CheckedGet(self, key, default = None): |
|
2310 """extract a value from an self and raise an exception if None. |
|
2311 |
|
2312 An optional default can be set to replace a None value. |
|
2313 |
|
2314 This function belongs in the Evaluator class logically. But |
|
2315 Evaluator doesn't know how to raise a Metadata error. Since |
|
2316 being able to raise a metadata error is the whole point of |
|
2317 the method, it makes sense to adapt the Evaluator class from |
|
2318 raptor_meta for the use of everything inside raptor_meta. |
|
2319 |
|
2320 ... so it will be added to the Evaluator class. |
|
2321 """ |
|
2322 |
|
2323 value = self.Get(key) |
|
2324 if value == None: |
|
2325 if default == None: |
|
2326 raise MetaDataError("configuration " + self.buildUnit.name + |
|
2327 " has no variable " + key) |
|
2328 else: |
|
2329 return default |
|
2330 return value |
|
2331 |
|
2332 raptor_data.Evaluator.CheckedGet = CheckedGet |
|
2333 |
|
2334 |
2288 class MetaReader(object): |
2335 class MetaReader(object): |
2289 """Entry point class for Symbian metadata processing. |
2336 """Entry point class for Symbian metadata processing. |
2290 |
2337 |
2291 Provides a means of integrating "traditional" Symbian metadata processing |
2338 Provides a means of integrating "traditional" Symbian metadata processing |
2292 with the new Raptor build system.""" |
2339 with the new Raptor build system.""" |
2321 # and VARIANT_HRH values. Each "build platform" has one associated |
2368 # and VARIANT_HRH values. Each "build platform" has one associated |
2322 # "export platform" but several "build platforms" can be associated |
2369 # "export platform" but several "build platforms" can be associated |
2323 # with the same "export platform". |
2370 # with the same "export platform". |
2324 exports = {} |
2371 exports = {} |
2325 |
2372 |
|
2373 self.__Raptor.Debug("MetaReader: configsToBuild: %s", [b.name for b in configsToBuild]) |
2326 for buildConfig in configsToBuild: |
2374 for buildConfig in configsToBuild: |
2327 # get everything we need to know about the configuration |
2375 # get everything we need to know about the configuration |
2328 evaluator = self.__Raptor.GetEvaluator(None, buildConfig) |
2376 evaluator = self.__Raptor.GetEvaluator(None, buildConfig) |
2329 |
2377 |
2330 detail = {} |
2378 detail = {} |
2331 detail['PLATFORM'] = self.CheckValue(evaluator, "TRADITIONAL_PLATFORM") |
2379 detail['PLATFORM'] = evaluator.CheckedGet("TRADITIONAL_PLATFORM") |
2332 epocroot = self.CheckValue(evaluator, "EPOCROOT") |
2380 epocroot = evaluator.CheckedGet("EPOCROOT") |
2333 detail['EPOCROOT'] = generic_path.Path(epocroot) |
2381 detail['EPOCROOT'] = generic_path.Path(epocroot) |
2334 |
2382 |
2335 sbs_build_dir = self.CheckValue(evaluator, "SBS_BUILD_DIR") |
2383 sbs_build_dir = evaluator.CheckedGet("SBS_BUILD_DIR") |
2336 detail['SBS_BUILD_DIR'] = generic_path.Path(sbs_build_dir) |
2384 detail['SBS_BUILD_DIR'] = generic_path.Path(sbs_build_dir) |
2337 flm_export_dir = self.CheckValue(evaluator, "FLM_EXPORT_DIR") |
2385 flm_export_dir = evaluator.CheckedGet("FLM_EXPORT_DIR") |
2338 detail['FLM_EXPORT_DIR'] = generic_path.Path(flm_export_dir) |
2386 detail['FLM_EXPORT_DIR'] = generic_path.Path(flm_export_dir) |
2339 detail['CACHEID'] = flm_export_dir |
2387 detail['CACHEID'] = flm_export_dir |
2340 if raptor_utilities.getOSPlatform().startswith("win"): |
2388 if raptor_utilities.getOSPlatform().startswith("win"): |
2341 detail['PLATMACROS'] = self.CheckValue(evaluator,"PLATMACROS.WINDOWS") |
2389 detail['PLATMACROS'] = evaluator.CheckedGet("PLATMACROS.WINDOWS") |
2342 else: |
2390 else: |
2343 detail['PLATMACROS'] = self.CheckValue(evaluator,"PLATMACROS.LINUX") |
2391 detail['PLATMACROS'] = evaluator.CheckedGet("PLATMACROS.LINUX") |
2344 |
2392 |
2345 # Apply OS variant provided we are not ignoring this |
2393 # Apply OS variant provided we are not ignoring this |
2346 if not self.__Raptor.ignoreOsDetection: |
2394 if not self.__Raptor.ignoreOsDetection: |
2347 self.__Raptor.Debug("Automatic OS detection enabled.") |
2395 self.__Raptor.Debug("Automatic OS detection enabled.") |
2348 self.ApplyOSVariant(buildConfig, epocroot) |
2396 self.ApplyOSVariant(buildConfig, epocroot) |
2369 variantHRH = variantCfgs[variantCfg] |
2417 variantHRH = variantCfgs[variantCfg] |
2370 detail['ISFEATUREVARIANT'] = False |
2418 detail['ISFEATUREVARIANT'] = False |
2371 |
2419 |
2372 detail['VARIANT_HRH'] = variantHRH |
2420 detail['VARIANT_HRH'] = variantHRH |
2373 self.__Raptor.Info("'%s' uses variant hrh file '%s'", buildConfig.name, variantHRH) |
2421 self.__Raptor.Info("'%s' uses variant hrh file '%s'", buildConfig.name, variantHRH) |
2374 detail['SYSTEMINCLUDE'] = self.CheckValue(evaluator, "SYSTEMINCLUDE") |
2422 detail['SYSTEMINCLUDE'] = evaluator.CheckedGet("SYSTEMINCLUDE") |
2375 |
2423 |
2376 detail['METADEPS'] = [] # Dependency targets for all metadata files in this platform |
|
2377 |
2424 |
2378 # find all the interface names we need |
2425 # find all the interface names we need |
2379 ifaceTypes = self.CheckValue(evaluator, "INTERFACE_TYPES") |
2426 ifaceTypes = evaluator.CheckedGet("INTERFACE_TYPES") |
2380 interfaces = ifaceTypes.split() |
2427 interfaces = ifaceTypes.split() |
2381 |
2428 |
2382 for iface in interfaces: |
2429 for iface in interfaces: |
2383 detail[iface] = self.CheckValue(evaluator, "INTERFACE." + iface) |
2430 detail[iface] = evaluator.CheckedGet("INTERFACE." + iface) |
2384 |
2431 |
2385 # not test code unless positively specified |
2432 # not test code unless positively specified |
2386 detail['TESTCODE'] = self.CheckValue(evaluator, "TESTCODE", "") |
2433 detail['TESTCODE'] = evaluator.CheckedGet("TESTCODE", "") |
2387 |
2434 |
2388 # make a key that identifies this platform uniquely |
2435 # make a key that identifies this platform uniquely |
2389 # - used to tell us whether we have done the pre-processing |
2436 # - used to tell us whether we have done the pre-processing |
2390 # we need already using another platform with compatible values. |
2437 # we need already using another platform with compatible values. |
2391 |
2438 |
2452 |
2499 |
2453 # one platform is picked as the "default" for extracting things |
2500 # one platform is picked as the "default" for extracting things |
2454 # that are supposedly platform independent (e.g. PRJ_PLATFORMS) |
2501 # that are supposedly platform independent (e.g. PRJ_PLATFORMS) |
2455 self.defaultPlatform = self.ExportPlatforms[0] |
2502 self.defaultPlatform = self.ExportPlatforms[0] |
2456 |
2503 |
2457 def CheckValue(self, evaluator, key, default = None): |
2504 |
2458 """extract a value from an evaluator and raise an exception if None. |
2505 def ReadBldInfFiles(self, aComponentList, doExportOnly): |
2459 |
|
2460 An optional default can be set to replace a None value.""" |
|
2461 value = evaluator.Get(key) |
|
2462 if value == None: |
|
2463 if default == None: |
|
2464 raise MetaDataError("configuration " + evaluator.config.name + |
|
2465 " has no variable " + key) |
|
2466 else: |
|
2467 return default |
|
2468 return value |
|
2469 |
|
2470 def ReadBldInfFiles(self, aFileList, doExportOnly): |
|
2471 """Take a list of bld.inf files and return a list of build specs. |
2506 """Take a list of bld.inf files and return a list of build specs. |
2472 |
2507 |
2473 The returned specification nodes will be suitable for all the build |
2508 The returned specification nodes will be suitable for all the build |
2474 configurations under consideration (using Filter nodes where required). |
2509 configurations under consideration (using Filter nodes where required). |
2475 """ |
2510 """ |
2476 |
2511 |
2477 # we need a Filter node per export platform |
2512 # we need a Filter node per export platform |
2478 exportNodes = [] |
2513 exportNodes = [] |
2479 for i,ep in enumerate(self.ExportPlatforms): |
2514 for i,ep in enumerate(self.ExportPlatforms): |
2480 filter = raptor_data.Filter("export_" + str(i)) |
2515 filter = raptor_data.Filter(name = "export_" + str(i)) |
2481 |
2516 |
2482 # what configurations is this node active for? |
2517 # what configurations is this node active for? |
2483 for config in ep['configs']: |
2518 for config in ep['configs']: |
2484 filter.AddConfigCondition(config.name) |
2519 filter.AddConfigCondition(config.name) |
2485 |
2520 |
2486 exportNodes.append(filter) |
2521 exportNodes.append(filter) |
2487 |
2522 |
2488 # we need a Filter node per build platform |
2523 # we need a Filter node per build platform |
2489 platformNodes = [] |
2524 platformNodes = [] |
2490 for i,bp in enumerate(self.BuildPlatforms): |
2525 for i,bp in enumerate(self.BuildPlatforms): |
2491 filter = raptor_data.Filter("build_" + str(i)) |
2526 filter = raptor_data.Filter(name = "build_" + str(i)) |
2492 |
2527 |
2493 # what configurations is this node active for? |
2528 # what configurations is this node active for? |
2494 for config in bp['configs']: |
2529 for config in bp['configs']: |
2495 filter.AddConfigCondition(config.name) |
2530 filter.AddConfigCondition(config.name) |
2496 |
2531 |
2502 filter.AddVariant(platformVar) |
2537 filter.AddVariant(platformVar) |
2503 platformNodes.append(filter) |
2538 platformNodes.append(filter) |
2504 |
2539 |
2505 # check that each bld.inf exists and add a Specification node for it |
2540 # check that each bld.inf exists and add a Specification node for it |
2506 # to the nodes of the export and build platforms that it supports. |
2541 # to the nodes of the export and build platforms that it supports. |
2507 for bif in aFileList: |
2542 for c in aComponentList: |
2508 if bif.isFile(): |
2543 if c.bldinf_filename.isFile(): |
2509 self.__Raptor.Info("Processing %s", str(bif)) |
2544 self.__Raptor.Info("Processing %s", str(c.bldinf_filename)) |
2510 try: |
2545 try: |
2511 self.AddComponentNodes(bif, exportNodes, platformNodes) |
2546 self.AddComponentNodes(c, exportNodes, platformNodes) |
2512 |
2547 |
2513 except MetaDataError, e: |
2548 except MetaDataError, e: |
2514 self.__Raptor.Error(e.Text, bldinf=str(bif)) |
2549 self.__Raptor.Error(e.Text, bldinf=str(c.bldinf_filename)) |
2515 if not self.__Raptor.keepGoing: |
2550 if not self.__Raptor.keepGoing: |
2516 return [] |
2551 return [] |
2517 else: |
2552 else: |
2518 self.__Raptor.Error("build info file does not exist", bldinf=str(bif)) |
2553 self.__Raptor.Error("build info file does not exist", bldinf=str(c.bldinf_filename)) |
2519 if not self.__Raptor.keepGoing: |
2554 if not self.__Raptor.keepGoing: |
2520 return [] |
2555 return [] |
2521 |
2556 |
2522 # now we have the top-level structure in place... |
2557 # now we have the top-level structure in place... |
2523 # |
2558 # |
2615 if moduleName == "" or moduleName.endswith(":"): |
2650 if moduleName == "" or moduleName.endswith(":"): |
2616 moduleName = "module" |
2651 moduleName = "module" |
2617 return moduleName |
2652 return moduleName |
2618 |
2653 |
2619 |
2654 |
2620 def AddComponentNodes(self, buildFile, exportNodes, platformNodes): |
2655 def AddComponentNodes(self, component, exportNodes, platformNodes): |
2621 """Add Specification nodes for a bld.inf to the appropriate platforms.""" |
2656 """Add Specification nodes for a bld.inf to the appropriate platforms.""" |
2622 bldInfFile = BldInfFile(buildFile, self.__gnucpp, self.__Raptor) |
2657 bldInfFile = BldInfFile(component.bldinf_filename, self.__gnucpp, component.depfiles, self.__Raptor) |
2623 |
2658 component.bldinf = bldInfFile |
2624 specName = self.getSpecName(buildFile, fullPath=True) |
2659 |
2625 |
2660 specName = getSpecName(component.bldinf_filename, fullPath=True) |
2626 if isinstance(buildFile, raptor_xml.SystemModelComponent): |
2661 |
|
2662 if isinstance(component.bldinf, raptor_xml.SystemModelComponent): |
2627 # this component came from a system_definition.xml |
2663 # this component came from a system_definition.xml |
2628 layer = buildFile.GetContainerName("layer") |
2664 layer = component.bldinf.GetContainerName("layer") |
2629 component = buildFile.GetContainerName("component") |
2665 componentName = component.bldinf.GetContainerName("component") |
2630 else: |
2666 else: |
2631 # this is a plain old bld.inf file from the command-line |
2667 # this is a plain old bld.inf file from the command-line |
2632 layer = "" |
2668 layer = "" |
2633 component = "" |
2669 componentName = "" |
2634 |
2670 |
2635 # exports are independent of build platform |
2671 # exports are independent of build platform |
2636 for i,ep in enumerate(self.ExportPlatforms): |
2672 for i,ep in enumerate(self.ExportPlatforms): |
2637 specNode = raptor_data.Specification(specName) |
2673 specNode = raptor_data.Specification(name = specName) |
2638 |
2674 |
2639 # keep the BldInfFile object for later |
2675 # keep the BldInfFile object for later |
2640 specNode.bldinf = bldInfFile |
2676 specNode.component = component |
2641 |
2677 |
2642 # add some basic data in a component-wide variant |
2678 # add some basic data in a component-wide variant |
2643 var = raptor_data.Variant() |
2679 var = raptor_data.Variant(name='component-wide') |
2644 var.AddOperation(raptor_data.Set("COMPONENT_META", str(buildFile))) |
2680 var.AddOperation(raptor_data.Set("COMPONENT_META", str(component.bldinf_filename))) |
2645 var.AddOperation(raptor_data.Set("COMPONENT_NAME", component)) |
2681 var.AddOperation(raptor_data.Set("COMPONENT_NAME", componentName)) |
2646 var.AddOperation(raptor_data.Set("COMPONENT_LAYER", layer)) |
2682 var.AddOperation(raptor_data.Set("COMPONENT_LAYER", layer)) |
2647 specNode.AddVariant(var) |
2683 specNode.AddVariant(var) |
2648 |
2684 |
2649 # add this bld.inf Specification to the export platform |
2685 # add this bld.inf Specification to the export platform |
2650 exportNodes[i].AddChild(specNode) |
2686 exportNodes[i].AddChild(specNode) |
|
2687 component.exportspecs.append(specNode) |
2651 |
2688 |
2652 # get the relevant build platforms |
2689 # get the relevant build platforms |
2653 listedPlatforms = bldInfFile.getBuildPlatforms(self.defaultPlatform) |
2690 listedPlatforms = bldInfFile.getBuildPlatforms(self.defaultPlatform) |
2654 platforms = getBuildableBldInfBuildPlatforms(listedPlatforms, |
2691 platforms = getBuildableBldInfBuildPlatforms(listedPlatforms, |
2655 self.__defaultplatforms, |
2692 self.__defaultplatforms, |
2656 self.__basedefaultplatforms, |
2693 self.__basedefaultplatforms, |
2657 self.__baseuserdefaultplatforms) |
2694 self.__baseuserdefaultplatforms) |
2658 |
2695 |
2659 |
2696 |
2660 |
2697 outputDir = BldInfFile.outputPathFragment(component.bldinf_filename) |
2661 outputDir = BldInfFile.outputPathFragment(buildFile) |
|
2662 |
2698 |
2663 # Calculate "module name" |
2699 # Calculate "module name" |
2664 modulename = self.ModuleName(str(buildFile)) |
2700 modulename = self.ModuleName(str(component.bldinf_filename)) |
2665 |
2701 |
2666 for i,bp in enumerate(self.BuildPlatforms): |
2702 for i,bp in enumerate(self.BuildPlatforms): |
|
2703 plat = bp['PLATFORM'] |
2667 if bp['PLATFORM'] in platforms: |
2704 if bp['PLATFORM'] in platforms: |
2668 specNode = raptor_data.Specification(specName) |
2705 specNode = raptor_data.Specification(name = specName) |
2669 |
2706 |
2670 # keep the BldInfFile object for later |
2707 # remember what component this spec node comes from for later |
2671 specNode.bldinf = bldInfFile |
2708 specNode.component = component |
2672 |
2709 |
2673 # add some basic data in a component-wide variant |
2710 # add some basic data in a component-wide variant |
2674 var = raptor_data.Variant() |
2711 var = raptor_data.Variant(name='component-wide-settings-' + plat) |
2675 var.AddOperation(raptor_data.Set("COMPONENT_META",str(buildFile))) |
2712 var.AddOperation(raptor_data.Set("COMPONENT_META",str(component.bldinf_filename))) |
2676 var.AddOperation(raptor_data.Set("COMPONENT_NAME", component)) |
2713 var.AddOperation(raptor_data.Set("COMPONENT_NAME", componentName)) |
2677 var.AddOperation(raptor_data.Set("COMPONENT_LAYER", layer)) |
2714 var.AddOperation(raptor_data.Set("COMPONENT_LAYER", layer)) |
2678 var.AddOperation(raptor_data.Set("MODULE", modulename)) |
2715 var.AddOperation(raptor_data.Set("MODULE", modulename)) |
2679 var.AddOperation(raptor_data.Append("OUTPUTPATHOFFSET", outputDir, '/')) |
2716 var.AddOperation(raptor_data.Append("OUTPUTPATHOFFSET", outputDir, '/')) |
2680 var.AddOperation(raptor_data.Append("OUTPUTPATH", outputDir, '/')) |
2717 var.AddOperation(raptor_data.Append("OUTPUTPATH", outputDir, '/')) |
2681 var.AddOperation(raptor_data.Append("BLDINF_OUTPUTPATH",outputDir, '/')) |
2718 var.AddOperation(raptor_data.Append("BLDINF_OUTPUTPATH",outputDir, '/')) |
2682 |
2719 |
2683 var.AddOperation(raptor_data.Set("TEST_OPTION", specNode.bldinf.getRomTestType(bp))) |
2720 var.AddOperation(raptor_data.Set("TEST_OPTION", component.bldinf.getRomTestType(bp))) |
2684 specNode.AddVariant(var) |
2721 specNode.AddVariant(var) |
2685 |
2722 |
2686 # add this bld.inf Specification to the build platform |
2723 # add this bld.inf Specification to the build platform |
2687 platformNodes[i].AddChild(specNode) |
2724 platformNodes[i].AddChild(specNode) |
|
2725 # also attach it into the component |
|
2726 component.specs.append(specNode) |
2688 |
2727 |
2689 def ProcessExports(self, componentNode, exportPlatform): |
2728 def ProcessExports(self, componentNode, exportPlatform): |
2690 """Do the exports for a given platform and skeleton bld.inf node. |
2729 """Do the exports for a given platform and skeleton bld.inf node. |
2691 |
2730 |
2692 This will actually perform exports as certain types of files (.mmh) |
2731 This will actually perform exports as certain types of files (.mmh) |
2694 (and parts of other bld.inf nodes) can be processed. |
2733 (and parts of other bld.inf nodes) can be processed. |
2695 |
2734 |
2696 [some MMP files #include exported .mmh files] |
2735 [some MMP files #include exported .mmh files] |
2697 """ |
2736 """ |
2698 if exportPlatform["TESTCODE"]: |
2737 if exportPlatform["TESTCODE"]: |
2699 exports = componentNode.bldinf.getTestExports(exportPlatform) |
2738 exports = componentNode.component.bldinf.getTestExports(exportPlatform) |
2700 else: |
2739 else: |
2701 exports = componentNode.bldinf.getExports(exportPlatform) |
2740 exports = componentNode.component.bldinf.getExports(exportPlatform) |
2702 |
2741 |
2703 self.__Raptor.Debug("%i exports for %s", |
2742 self.__Raptor.Debug("%i exports for %s", |
2704 len(exports), str(componentNode.bldinf.filename)) |
2743 len(exports), str(componentNode.component.bldinf.filename)) |
2705 if exports: |
2744 if exports: |
2706 |
2745 |
2707 # each export is either a 'copy' or 'unzip' |
2746 # each export is either a 'copy' or 'unzip' |
2708 # maybe we should trap multiple exports to the same location here? |
2747 # maybe we should trap multiple exports to the same location here? |
2709 epocroot = str(exportPlatform["EPOCROOT"]) |
2748 epocroot = str(exportPlatform["EPOCROOT"]) |
2710 bldinf_filename = str(componentNode.bldinf.filename) |
2749 bldinf_filename = str(componentNode.component.bldinf.filename) |
2711 exportwhatlog="<whatlog bldinf='%s' mmp='' config=''>\n" % bldinf_filename |
2750 exportwhatlog="<whatlog bldinf='%s' mmp='' config=''>\n" % bldinf_filename |
2712 for export in exports: |
2751 for export in exports: |
2713 expSrc = export.getSource() |
2752 expSrc = export.getSource() |
2714 expDstList = export.getDestination() # Might not be a list in all circumstances |
2753 expDstList = export.getDestination() # Might not be a list in all circumstances |
2715 |
2754 |
3203 value = value.replace('$/', '/').replace('$;', ':') |
3248 value = value.replace('$/', '/').replace('$;', ':') |
3204 var.AddOperation(raptor_data.Set(standardVariable, value)) |
3249 var.AddOperation(raptor_data.Set(standardVariable, value)) |
3205 gnuSpec.AddVariant(var) |
3250 gnuSpec.AddVariant(var) |
3206 componentNode.AddChild(gnuSpec) |
3251 componentNode.AddChild(gnuSpec) |
3207 |
3252 |
3208 def getSpecName(self, aFileRoot, fullPath=False): |
|
3209 """Returns a build spec name: this is the file root (full path |
|
3210 or simple file name) made safe for use as a file name.""" |
|
3211 |
|
3212 if fullPath: |
|
3213 specName = str(aFileRoot).replace("/","_") |
|
3214 specName = specName.replace(":","") |
|
3215 else: |
|
3216 specName = aFileRoot.File() |
|
3217 |
|
3218 return specName.lower() |
|
3219 |
3253 |
3220 def ApplyOSVariant(self, aBuildUnit, aEpocroot): |
3254 def ApplyOSVariant(self, aBuildUnit, aEpocroot): |
3221 # Form path to kif.xml and path to buildinfo.txt |
3255 # Form path to kif.xml and path to buildinfo.txt |
3222 kifXmlPath = generic_path.Join(aEpocroot, "epoc32", "data","kif.xml") |
3256 kifXmlPath = generic_path.Join(aEpocroot, "epoc32", "data","kif.xml") |
3223 buildInfoTxtPath = generic_path.Join(aEpocroot, "epoc32", "data","buildinfo.txt") |
3257 buildInfoTxtPath = generic_path.Join(aEpocroot, "epoc32", "data","buildinfo.txt") |