Example #1
0
	def preFlightCheck( self ):
		self.__makeTool = maketools.getMakeTool()
		if not self.getCommand():
			self._setCommand( self.__makeTool.getCommand() )
		if not self.getCommandSearchPaths():
			self._setCommandSearchPaths( self.__makeTool.getCommandSearchPaths() )
		self.getMakeTool().checkVersion()
Example #2
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 )
Example #3
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 )
Example #4
0
def check_dependencies():

	def check_plugins( plugins ):
		failed_list = []
		for plugin_class in plugins:
			plugin = plugin_class()
			try:
				plugin.resolveCommand()
			except ( MomException, ConfigurationError ):
				# try to get a sane plugin identifier
				if hasattr( plugin, 'getCommand' ):
					pluginName = plugin.getCommand()
				if not pluginName and hasattr( plugin, 'getName' ):
					pluginName = plugin.getName()
				if not pluginName:
					pluginName = plugin.__class__.__name__
				assert( pluginName )

				failed_list.append( pluginName )
		return failed_list

	def print_warning( missing_list, optional = False, type = '' ):
		if not missing_list:
			return

		type = type + ' '
		missing = ' '.join( missing_list )
		if optional:
			force = 'may'
		else:
			force = 'will'
		print( "WARNING: You appear to be missing some {0}dependencies: {1}".format( type, missing ) )
		print( "This {0} cause test failures and will break some {1}functionality.".format( force, type ) )

	MApplication()

	missing = check_plugins( DEPENDENCIES )
	try:
		import lxml
		lxml.__path__ # remove unused warning
	except ImportError:
		missing.append( 'lxml' )

	optional_missing = check_plugins( OPTIONAL_DEPENDENCIES )

	cxx_missing = check_plugins( CXX_DEPENDENCIES )
	try:
		getMakeTool().checkVersion()
	except ( MomException, ConfigurationError ):
		cxx_missing.append( '/'.join( getMakeToolNames() ) )
	python_missing = check_plugins( PYTHON_DEPENDENCIES )

	print_warning( missing )
	print_warning( optional_missing, True, 'optional' )
	print_warning( cxx_missing, True, 'C++' )
	print_warning( python_missing, True, 'Python' )

	# check if this was called directly, if yes: wait for user input on missing deps
	if __name__ == "__main__":
		if missing or optional_missing or cxx_missing or python_missing:
			try:
				raw_input( 'Press "Enter" to continue...' )
			except KeyboardInterrupt:
				print( '' )
				sys.exit( 1 )
Example #5
0
	def __init__( self, name = None ):
		PackageProvider.__init__( self, name )
		self.__makeTool = maketools.getMakeTool()
		self._setCommand( self.__makeTool.getCommand() )
		self._setCommandSearchPaths( self.__makeTool.getCommandSearchPaths() )
		self._setCommandArguments( ["package"] )