def makeCheckoutStep( self ): """Create steps to check out the source code""" assert self.getInstructions() step = self.getInstructions().getStep( 'checkout' ) cmd = [ self.getCommand(), '--non-interactive', 'checkout', '-r{0}'.format( self.getRevision() or 'HEAD' ), self.getUrl(), '.' ] checkout = ShellCommandAction( cmd, searchPaths = self.getCommandSearchPaths() ) checkout.setWorkingDirectory( self.getSrcDir() ) step.addMainAction( checkout )
def createConfigureActions( self ): if not self.getCommand(): raise NotImplementedError() command = [ self.getCommand() ] command.extend( self.getCommandArguments() ) action = ShellCommandAction( command, searchPaths = self.getCommandSearchPaths() ) action.setWorkingDirectory( self._getBuildDir() ) step = self.getInstructions().getStep( 'configure' ) step.addMainAction( action )
def createConfMakeActions( self ): tool = self.getMakeTool() # The make tool is discovered during pre-flight check. It is not set in query and describe mode, so don't assume it is. if tool: tool.setJobs( self.getJobsCount() ) command = [ tool.getCommand() ] command.extend( tool.getArguments() ) action = ShellCommandAction( command, searchPaths = getMakeTool().getCommandSearchPaths() ) action.setWorkingDirectory( self._getBuildDir() ) step = self.getInstructions().getStep( 'build' ) step.addMainAction( action )
def makePackageStep( self ): """Create package for the project.""" if self.getCommandArguments() == None: raise NotImplementedError() step = self.getInstructions().getStep( 'create-packages' ) command = [ self.getCommand() ] command.extend( self.getCommandArguments() ) makePackage = ShellCommandAction( command, searchPaths = self.getCommandSearchPaths() ) makePackage.setWorkingDirectory( self.getInstructions().getBuildDir() ) step.addMainAction( makePackage ) return makePackage
def createConfMakeInstallActions( self ): tool = self.getMakeTool() # The make tool is discovered during pre-flight check. It is not set in query and describe mode, so don't assume it is. if tool: # There's often problems with more than one make install job and it's I/O bound anyway tool.setJobs( 1 ) command = [ tool.getCommand() ] command.append( mApp().getSettings().get( Settings.MakeBuilderInstallTarget ) ) action = ShellCommandAction( command, searchPaths = getMakeTool().getCommandSearchPaths() ) action.setWorkingDirectory( self._getBuildDir() ) step = self.getInstructions().getStep( 'install' ) step.addMainAction( action )
def setup( self ): check_for_path( self.getDoxygenFile(), 'The doxygen configuration file name needs to be a nonempty string!' ) docsDir = os.path.join( self.getInstructions().getBaseDir(), self.getDocsDir() or self.getInstructions().getDocsDir() ) # create folders if necessary if self.getDocsDir(): # make docs folder step = self.getInstructions().getStep( 'create-folders' ) step.addMainAction( MkDirAction( docsDir ) ) # cleanup step = self.getInstructions().getStep( 'cleanup' ) step.addMainAction( RmDirAction( docsDir ) ) # run doxygen step = self.getInstructions().getStep( 'create-docs' ) cmd = [ self.getCommand(), str( self.getDoxygenFile() ) ] doxygenCall = ShellCommandAction( cmd, searchPaths = self.getCommandSearchPaths() ) doxygenCall.setWorkingDirectory( docsDir ) step.addMainAction( doxygenCall )
def run( self ): try: return ShellCommandAction.run( self ) finally: self.__tester.saveReport()
def __init__( self, tester, command = None, timeout = None ): ShellCommandAction.__init__( self, command, timeout ) self.__tester = tester
def run( self ): try: return ShellCommandAction.run( self ) finally: if self.__callback: self.__callback( self )
def __init__( self, command = None, timeout = None, combineOutput = True, callback = None ): ShellCommandAction.__init__( self, command, timeout, combineOutput = combineOutput ) self.__callback = callback