def checkIfBuildWasSuccessful(): buildCheck = True if ACTION_BUILD in Settings.actions: for target in Settings.targets: for platform in Settings.targetPlatforms: for cpu in Settings.targetCPUs: if System.checkIfCPUIsSupportedForPlatform(cpu, platform): for configuration in Settings.targetConfigurations: if Summary.checkIfActionFailed( ACTION_BUILD, target, platform, cpu, configuration): buildCheck = False return buildCheck
def actionBackup(): """ Backups the latest build. """ Backup.init() for target in Settings.targets: for platform in Settings.targetPlatforms: for cpu in Settings.targetCPUs: if System.checkIfCPUIsSupportedForPlatform(cpu, platform): for configuration in Settings.targetConfigurations: if not Summary.checkIfActionFailed( ACTION_BUILD, target, platform, cpu, configuration): Backup.run(target, platform, cpu, configuration)
def actionBuild(): """ Build all specified targets for all specified platforms. """ #Init builder logger Builder.init() for target in Settings.targets: targetsToBuild, combineLibs, copyToOutput = Builder.getTargetGnPath( target) for platform in Settings.targetPlatforms: for cpu in Settings.targetCPUs: if System.checkIfCPUIsSupportedForPlatform(cpu, platform): for configuration in Settings.targetConfigurations: if not Summary.checkIfActionFailed( ACTION_PREPARE, target, platform, cpu, configuration): Logger.printStartActionMessage( 'Build ' + target + ' ' + platform + ' ' + cpu + ' ' + configuration, ColoredFormatter.YELLOW) result = Builder.run(target, targetsToBuild, platform, cpu, configuration, combineLibs, copyToOutput) Summary.addSummary(ACTION_BUILD, target, platform, cpu, configuration, result, Builder.executionTime) if result != NO_ERROR: Logger.printEndActionMessage( 'Failed building ' + target + ' ' + platform + ' ' + cpu + ' ' + configuration, ColoredFormatter.RED) #Terminate script execution if stopExecutionOnError is set to True in userdef shouldEndOnError(result) else: Logger.printEndActionMessage('Build ' + target + ' ' + platform + ' ' + cpu + ' ' + configuration) else: Logger.printColorMessage( 'Build cannot run because preparation has failed for ' + target + ' ' + platform + ' ' + cpu + ' ' + configuration, ColoredFormatter.YELLOW) Logger.printEndActionMessage( 'Build not run for ' + target + ' ' + platform + ' ' + cpu + ' ' + configuration, ColoredFormatter.YELLOW)
def actionPrepare(): """ Prepare dev environment for all specified targets and platforms. """ #Do preparation that is common for all platforms. Pass true if ortc is one of targets result = Preparation.setUp('ortc' in Settings.targets) if result != NO_ERROR: #Terminate execution, because prepration common for all targets and platforms has failed. System.stopExecution(result) for target in Settings.targets: for platform in Settings.targetPlatforms: for cpu in Settings.targetCPUs: if System.checkIfCPUIsSupportedForPlatform(cpu, platform): for configuration in Settings.targetConfigurations: Logger.printStartActionMessage( 'Prepare ' + target + ' ' + platform + ' ' + cpu + ' ' + configuration, ColoredFormatter.YELLOW) result = Preparation.run(target, platform, cpu, configuration) Summary.addSummary(ACTION_PREPARE, target, platform, cpu, configuration, result, Preparation.executionTime) if result != NO_ERROR: Logger.printEndActionMessage( 'Failed preparing ' + target + ' ' + platform + ' ' + cpu + ' ' + configuration, ColoredFormatter.RED) #Terminate script execution if stopExecutionOnError is set to True in userdef shouldEndOnError(result) else: Logger.printEndActionMessage('Prepare ' + target + ' ' + platform + ' ' + cpu + ' ' + configuration)