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