Exemple #1
0
def __ResolveAndGenerate(config: Config, errorHelpManager: ErrorHelpManager,
                         platformGeneratorPlugin: GeneratorPlugin,
                         packageLoader: PackageLoader,
                         packageFilters: PackageFilters, isSDKBuild: bool,
                         writeGraph: bool) -> List[Package]:
    generatorContext = GeneratorContext(config, errorHelpManager,
                                        packageFilters.RecipeFilterManager,
                                        config.ToolConfig.Experimental,
                                        platformGeneratorPlugin)

    process = PackageLoadAndResolveProcess(config,
                                           packageLoader,
                                           platformGeneratorPlugin,
                                           writeGraph=writeGraph)
    process.Resolve(generatorContext, packageFilters)

    if not isSDKBuild:
        for package in process.Packages:
            if not package.ResolvedPlatformSupported and package.Type != PackageType.TopLevel:
                notSupported = LocalUtil.BuildListOfDirectlyNotSupported(
                    package)
                notSupportedNames = Util.ExtractNames(notSupported)
                config.DoPrintWarning(
                    "{0} was marked as not supported on this platform by package: {1}"
                    .format(package.Name, notSupportedNames))

    return platformGeneratorPlugin.Generate(generatorContext, config,
                                            process.Packages)
Exemple #2
0
    def __ApplyClangTidy(self, log: Log, toolConfig: ToolConfig, localToolConfig: LocalToolConfig,
                         packageRecipeResultManager: Optional[PackageRecipeResultManager],
                         topLevelPackage: Optional[Package], tidyPackageList: List[Package], generator: GeneratorPlugin,
                         config: Config, generatorContext: GeneratorContext, customPackageFileFilter: Optional[CustomPackageFileFilter]) -> None:
        """
        The only reason we take optionals here is because they are optional in the main program, so its just easier to do the check here
        :currentDirPath: is used to process the '--file' argument
        """
        if toolConfig.ClangTidyConfiguration is None or packageRecipeResultManager is None or topLevelPackage is None:
            raise Exception("internal error")

        # Generate the build files (so that the run scripts exist)
        log.LogPrint("Generating build files")
        generator.Generate(generatorContext, config, tidyPackageList)

        clangFormatFilename = None if toolConfig.ClangFormatConfiguration is None else toolConfig.ClangFormatConfiguration.CustomFormatFile

        pythonScriptRoot = IOUtil.Join(config.SDKPath, ".Config")

        performClangTidyConfig = PerformClangTidyConfig(toolConfig.ClangTidyConfiguration, localToolConfig.ClangTidyArgs,
                                                        localToolConfig.ClangTidyPostfixArgs, localToolConfig.TidyOverrideChecks,
                                                        localToolConfig.ClangTidyProfile, not localToolConfig.ClangTidyNoDynamicVariantCache,
                                                        localToolConfig.Repair)
        PerformClangTidy.Run(log, toolConfig, generatorContext.Generator.PlatformId, topLevelPackage, tidyPackageList,
                             localToolConfig.BuildVariantsDict, pythonScriptRoot, generatorContext, config.SDKConfigTemplatePath,
                             packageRecipeResultManager, performClangTidyConfig, customPackageFileFilter, clangFormatFilename,
                             localToolConfig.BuildThreads, localToolConfig.Legacy)
Exemple #3
0
    def __init__(self, log: Log, toolVersion: Version,
                 allowDevelopmentPlugins: bool) -> None:
        self.DotEnabled = False
        self.VSVersion = 0
        self.LegacyGeneratorType = "default"
        self.__Log = log
        self.__ToolVersion = toolVersion
        # prepare plugins
        self.__GeneratorPlugins = [
            GeneratorPluginAndroid(),
            GeneratorPluginUbuntu(),
            GeneratorPluginYocto(),
            GeneratorPluginWindows(),
            GeneratorPluginFreeRTOS(),
            GeneratorPluginQNX(),
            GeneratorPluginCMake()
        ]
        if not allowDevelopmentPlugins:
            self.__GeneratorPlugins = [
                entry for entry in self.__GeneratorPlugins
                if not entry.InDevelopment
            ]

        self.__GeneratorPluginDict = {}  # Dict[str, GeneratorPlugin]
        for _entry in self.__GeneratorPlugins:
            self.__GeneratorPluginDict[_entry.PlatformId] = _entry
        self.__GeneratorPluginDict[
            PluginSharedValues.PLATFORM_ID_ALL] = GeneratorPlugin(
                PluginSharedValues.PLATFORM_ID_ALL)
Exemple #4
0

#__g_generatorPlugins = [GeneratorPlugin(PluginSharedValues.PLATFORM_ID_ALL), GeneratorPluginAndroid(), GeneratorPluginUbuntu(), GeneratorPluginYocto(), GeneratorPluginWindows(), GeneratorPluginQNX(), GeneratorPluginCMake()]
__g_generatorPlugins = [
    GeneratorPluginAndroid(),
    GeneratorPluginUbuntu(),
    GeneratorPluginYocto(),
    GeneratorPluginWindows(),
    GeneratorPluginQNX(),
    GeneratorPluginCMake()
]
__g_generatorPluginDict = {}  # type: Dict[str, GeneratorPlugin]

for _entry in __g_generatorPlugins:
    __g_generatorPluginDict[_entry.Id] = _entry
__g_generatorPluginDict[PluginSharedValues.PLATFORM_ID_ALL] = GeneratorPlugin(
    PluginSharedValues.PLATFORM_ID_ALL)

#def __CreateCustomWindowGenerator(platformName):
#    gen = GeneratorPluginWindows();
#    gen.SetCustomPlatformName(platformName);
#    return gen

#def SetForceUseNativeGenerator(forceUseNativegenerator):
#    if forceUseNativegenerator or PlatformUtil.DetectBuildPlatformType() != BuildPlatformType.Windows:
#        return
#    # This allows us to use the Visual C++ for linux development plugin on windows
#    ubuntuGen = __CreateCustomWindowGenerator(PackageConfig.PlatformNameString.UBUNTU)
#    __g_generatorPluginDict[ubuntuGen.Id] = ubuntuGen
#    PlatformUtil.AddExtraGenerators(ubuntuGen.Name)

def __PrepareGenerator(generator: GeneratorPlugin) -> None:
    generator.DotEnabled = __g_globalContext.DotEnabled
    generator.ToolVersion = __g_globalContext.VSVersion
    generator.SetLegacyGeneratorType(__g_globalContext.LegacyGeneratorType)