예제 #1
0
	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 )
예제 #2
0
	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 )
예제 #3
0
	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 )
예제 #4
0
	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
예제 #5
0
	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 )
예제 #6
0
	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 )
예제 #7
0
	def run( self ):
		try:
			return ShellCommandAction.run( self )
		finally:
			self.__tester.saveReport()
예제 #8
0
	def __init__( self, tester, command = None, timeout = None ):
		ShellCommandAction.__init__( self, command, timeout )
		self.__tester = tester
예제 #9
0
	def run( self ):
		try:
			return ShellCommandAction.run( self )
		finally:
			if self.__callback:
				self.__callback( self )
예제 #10
0
	def __init__( self, command = None, timeout = None, combineOutput = True, callback = None ):
		ShellCommandAction.__init__( self, command, timeout, combineOutput = combineOutput )
		self.__callback = callback