def Process(self, currentDirPath: str, toolConfig: ToolConfig, localToolConfig: LocalToolConfig) -> None: config = Config(self.Log, toolConfig, localToolConfig.PackageConfigurationType, localToolConfig.BuildVariantsDict, localToolConfig.AllowDevelopmentPlugins) if localToolConfig.DryRun: config.ForceDisableAllWrite() if localToolConfig.IgnoreNotSupported: config.IgnoreNotSupported = True if localToolConfig.Graph: PluginConfig.EnableGraph() theFiles = MainFlow.DoGetFiles(config, toolConfig.GetMinimalConfig(), currentDirPath, localToolConfig.Recursive) PluginConfig.SetGeneratorType(localToolConfig.GenType) platformGeneratorPlugin = PluginConfig.GetGeneratorPluginById( localToolConfig.PlatformName, True) generatorContext = GeneratorContext(config, config.ToolConfig.Experimental, platformGeneratorPlugin) packages = MainFlow.DoGenerateBuildFiles( config, theFiles, platformGeneratorPlugin, localToolConfig.BuildPackageFilters) # If the platform was manually switched, then check if the build platform is supported, # if its not disable recipe building and log a warning if localToolConfig.DefaultPlatformName != localToolConfig.PlatformName: if not PlatformUtil.TryCheckBuildPlatform( localToolConfig.PlatformName): self.Log.DoPrintWarning( "Build recipes not supported for '{0}' on this OS".format( localToolConfig.PlatformName)) localToolConfig.DontBuildRecipes = True if localToolConfig.ListVariants or localToolConfig.ListBuildVariants: requestedFiles = None if config.IsSDKBuild else theFiles if not isinstance(packages, dict): self.__DoShowList(packages, requestedFiles, localToolConfig.ListVariants, localToolConfig.ListBuildVariants, platformGeneratorPlugin) else: for platformName, platformResult in packages.items(): platformPackageList = platformResult[0] if len(platformPackageList) > 0: self.Log.DoPrint("Generator: {0}".format(platformName)) try: self.Log.PushIndent() self.__DoShowList( platformPackageList, requestedFiles, localToolConfig.ListVariants, localToolConfig.ListBuildVariants, platformResult[1]) finally: self.Log.PopIndent() elif not localToolConfig.DontBuildRecipes: if not isinstance(packages, dict): self.__DoBuildRecipes(config, generatorContext, packages, localToolConfig.ForceClaimInstallArea, localToolConfig.BuildThreads) else: for platformName, platformResult in packages.items(): platformPackageList = platformResult[0] if len(platformPackageList ) > 0 and PlatformUtil.TryCheckBuildPlatform( platformName): self.Log.DoPrint("Generator: {0}".format(platformName)) tempPlatformGeneratorPlugin = PluginConfig.GetGeneratorPluginById( platformName, True) tempGeneratorContext = GeneratorContext( config, config.ToolConfig.Experimental, tempPlatformGeneratorPlugin) try: self.Log.PushIndent() self.__DoBuildRecipes( config, tempGeneratorContext, platformPackageList, localToolConfig.ForceClaimInstallArea, localToolConfig.BuildThreads) finally: self.Log.PopIndent()
def Process(self, currentDirPath: str, toolConfig: ToolConfig, localToolConfig: LocalToolConfig) -> None: config = Config(self.Log, toolConfig, localToolConfig.PackageConfigurationType, localToolConfig.BuildVariantsDict, localToolConfig.AllowDevelopmentPlugins) if localToolConfig.DryRun: config.ForceDisableAllWrite() if localToolConfig.IgnoreNotSupported: config.IgnoreNotSupported = True # Get the platform and see if its supported platformGeneratorPlugin = PluginConfig.GetGeneratorPluginById( localToolConfig.PlatformName, False) PlatformUtil.CheckBuildPlatform(platformGeneratorPlugin.Name) config.LogPrint("Active platform: {0}".format( platformGeneratorPlugin.Name)) theFiles = MainFlow.DoGetFiles(config, toolConfig.GetMinimalConfig(), currentDirPath, localToolConfig.Recursive) generatorContext = GeneratorContext(config, config.ToolConfig.Experimental, platformGeneratorPlugin) PluginConfig.SetGeneratorType(localToolConfig.GenType) packageFilters = localToolConfig.BuildPackageFilters packages = MainFlow.DoGenerateBuildFilesNoAll(config, theFiles, platformGeneratorPlugin, packageFilters) topLevelPackage = PackageListUtil.GetTopLevelPackage(packages) requestedFiles = None if config.IsSDKBuild else theFiles # We need the generator to be able to examine its support if localToolConfig.ListFeatures or localToolConfig.ListVariants or localToolConfig.ListExtensions or localToolConfig.ListRequirements: if localToolConfig.ListFeatures: Builder.ShowFeatureList(self.Log, config, topLevelPackage, requestedFiles) if localToolConfig.ListVariants: Builder.ShowVariantList(self.Log, topLevelPackage, requestedFiles, platformGeneratorPlugin) if localToolConfig.ListExtensions: Builder.ShowExtensionList(self.Log, topLevelPackage, requestedFiles) if localToolConfig.ListRequirements: Builder.ShowRequirementList(self.Log, config, topLevelPackage, requestedFiles) else: if localToolConfig.BuildPackageFilters is None or localToolConfig.BuildPackageFilters.ExtensionNameList is None: raise Exception( "localToolConfig.BuildPackageFilters.ExtensionNameList not set" ) Builder.BuildPackages( generatorContext, config, packages, localToolConfig.BuildVariantsDict, localToolConfig.RemainingArgs, localToolConfig.ForAllExe, platformGeneratorPlugin, localToolConfig.EnableContentBuilder, localToolConfig.ForceClaimInstallArea, localToolConfig.BuildThreads, localToolConfig.Command)