Ejemplo n.º 1
0
def TryBuildAndRun(toolAppContext: ToolAppContext, config: Config,
                   package: Package) -> Optional[JsonDictType]:
    if package.ResolvedPlatformNotSupported:
        return None
    if package.AbsolutePath is None:
        raise Exception("Invalid package")
    workDir = package.AbsolutePath
    tmpOutputFilename = IOUtil.Join(workDir, 'FslBuildDoc_AppArguments.json')
    try:
        # FslBuild.py --ForAllExe "(EXE) --System.Arguments.Save <filename>"

        toolFlowConfig = ToolFlowBuild.GetDefaultLocalConfig()
        toolFlowConfig.SetToolAppConfigValues(toolAppContext.ToolAppConfig)
        toolFlowConfig.ForAllExe = '(EXE) --System.Arguments.Save {0} -h'.format(
            tmpOutputFilename)
        buildFlow = ToolFlowBuild.ToolFlowBuild(toolAppContext)
        buildFlow.Process(workDir, config.ToolConfig, toolFlowConfig)

        return ReadJsonFile(tmpOutputFilename)
    except (Exception) as ex:
        if toolAppContext.LowLevelToolConfig.DebugEnabled:
            raise
        config.LogPrint(
            "Failed to build and run '{0}' due to exception {1}".format(
                package.Name, ex))
        return None
    finally:
        IOUtil.RemoveFile(tmpOutputFilename)
Ejemplo n.º 2
0
 def __BuildNow(self,
                config: Config,
                workDir: str,
                recursive: bool = False) -> None:
     toolFlowConfig = ToolFlowBuild.GetDefaultLocalConfig()
     toolFlowConfig.SetToolAppConfigValues(
         self.ToolAppContext.ToolAppConfig)
     toolFlowConfig.Recursive = recursive
     buildFlow = ToolFlowBuild.ToolFlowBuild(self.ToolAppContext)
     buildFlow.Process(workDir, config.ToolConfig, toolFlowConfig)
Ejemplo n.º 3
0
    def Process(self, currentDirPath: str, toolConfig: ToolConfig,
                localToolConfig: LocalToolConfig) -> None:
        #config = Config(self.Log, toolConfig, localToolConfig.PackageConfigurationType,
        #                localToolConfig.BuildVariantsDict, localToolConfig.AllowDevelopmentPlugins)

        # Take advantage of the --ForAllExe option in the builder
        toolAppContext = self.ToolAppContext
        toolFlowConfig = ToolFlowBuild.GetDefaultLocalConfig()
        toolFlowConfig.SetToolAppConfigValues(toolAppContext.ToolAppConfig)
        toolFlowConfig.RemainingArgs = ToolAppConfigDefaultValue.RemainingArgs
        toolFlowConfig.ForAllExe = '(EXE) {0}'.format(" ".join(
            localToolConfig.RemainingArgs))
        toolFlowConfig.PackageConfigurationType = localToolConfig.PackageConfigurationType

        buildFlow = ToolFlowBuild.ToolFlowBuild(toolAppContext)
        buildFlow.Process(currentDirPath, toolConfig, toolFlowConfig)