Example #1
0
def start():
	cli = CommandLineInterface()
	if not cli.parse():
  		cli.print_usage()
  		return False;
      
	print( "*************************************************************************")
	print( "*************************************************************************")
	print( "--> Starting " + Globals.build_target_ + " Build")
	build_target = Globals.build_target_
	if build_target in Globals.allowed_build_types_:
		code_builder = MainCode()
		return code_builder.start()
	elif build_target == "archive":	
		archive_builder = Archiver()
		return archive_builder.start(build_parameters)
	elif build_target == "thirdparty" or build_target == "thirdpartylean":
		code_builder = ThirdPartyLibraries()
		return code_builder.start()
	elif build_target == "documentation":
		documentation_builder = Documentation()
		return documentation_builder.start()
	elif build_target == "modelrunner":
		model_runner = ModelRunner()
		return model_runner.start()
	elif build_target == "clean":
		cleaner = Cleaner()
		return cleaner.clean()
	elif build_target == "cleanall":
		cleaner = Cleaner()
		return cleaner.clean_all()
	elif build_target == "rlibrary":
		"""
			r_path = '' 
			if Globals.operating_system_ == 'windows':
			print( "find windows R")
			r_path = system_info.find_exe_path('R.exe') 
			else:
			r_path = system_info.find_exe_path('R')  
			print( "R path = " + r_path  )
			if r_path == '':
			return Globals.PrintError("R is not in the current path please add R to your path.")  
		"""
		rlibrary = Rlibrary()
		return rlibrary.start()
	elif build_target == "installer":
		"""
			if Globals.operating_system_ == 'linux':
			return Globals.PrintError('Building Windows installer under linux is not supported')
		"""
		installer = Installer()
		return installer.start()
	elif build_target == "deb":
		"""
			if Globals.operating_system_ == 'windows':
			return Globals.PrintError('Building linux .deb under Windows is not supported')
		"""
		deb_builder = DebBuilder()
		return deb_builder.start(build_parameters)
	return False # Default return from this, we didn't find a run mode
Example #2
0
    def __init__(self, model):
        self._model = model
        self._atsVariables = AtsVariables(self._model.getAts())

        self._taggedDescription = Documentation.TaggedDocstring()
        self._taggedDescription.parse(self._model.getDescription())
        self._tags = Documentation.DictWrapper(self._taggedDescription)
        self._role = self._model.getRole()

        # extract starttime/stoptime
        element = self._model.getDomElements("testcase-started")[0]
        self._startTimestamp = float(element.attribute('timestamp'))

        element = self._model.getDomElements("testcase-stopped")[0]
        self._stopTimestamp = float(element.attribute('timestamp'))
 def visitFunction(self, node, parent=None):
     if parent and node.name == 'body' and len(
             node.argnames) > 0 and node.argnames[0] == 'self':
         # This is the body function of a Test Case.
         # We should reference its docstring and arguments for Test Case parameters documentation.
         parent.argumentsDocstring = Documentation.trim(node.doc)
         parent.arguments = node.argnames[1:]
	def visitClass(self, node, parent = None):
		role = None
		if len(node.bases) > 0 and "TestCase" in [hasattr(x, 'name') and x.name or None for x in node.bases]:
			role = "testcase"
		elif len(node.bases) > 0 and "Preamble" in [hasattr(x, 'name') and x.name or None for x in node.bases]:
			role = "preamble"
		elif len(node.bases) > 0 and "Postamble" in [hasattr(x, 'name') and x.name or None for x in node.bases]:
			role = "postamble"

		if role:
			# This is a TestCase/Preamble/Postamble instance.
			currentTestCase = TestCaseVariables(node.name, docstring = Documentation.trim(node.doc).decode('utf-8'), role = role)
			self._results.append(currentTestCase)
			# Search for its body() function.
			self.walkChildren(node.code, currentTestCase)
    def visitClass(self, node, parent=None):
        role = None
        if len(node.bases) > 0 and "TestCase" in [
                hasattr(x, 'name') and x.name or None for x in node.bases
        ]:
            role = "testcase"
        elif len(node.bases) > 0 and "Preamble" in [
                hasattr(x, 'name') and x.name or None for x in node.bases
        ]:
            role = "preamble"
        elif len(node.bases) > 0 and "Postamble" in [
                hasattr(x, 'name') and x.name or None for x in node.bases
        ]:
            role = "postamble"

        if role:
            # This is a TestCase/Preamble/Postamble instance.
            currentTestCase = TestCaseVariables(node.name,
                                                docstring=Documentation.trim(
                                                    node.doc).decode('utf-8'),
                                                role=role)
            self._results.append(currentTestCase)
            # Search for its body() function.
            self.walkChildren(node.code, currentTestCase)
Example #6
0
def start():
	cli = CommandLineInterface()
	if not cli.parse():
  		cli.print_usage()
  		return False;
      
	print( "*************************************************************************")
	print( "*************************************************************************")
	
	Globals.buildtools_directory_ = os.getcwd()
	Globals.root_directory_ = os.path.realpath(Globals.buildtools_directory_ + "/../")
	Globals.boost_source_directory_ = os.path.realpath(Globals.root_directory_ + "/Boost")
	Globals.build_directory_ = os.path.realpath(Globals.root_directory_ + "/Build/" + Globals.operating_system_ )
	Globals.boost_directory_ = os.path.realpath(Globals.build_directory_ + "/Boost")
	
	print('--> Directory: ' + Globals.root_directory_)

	if not os.path.exists(Globals.build_directory_):
		if not os.path.exists(Globals.root_directory_ + "/Build"):
			os.mkdir(Globals.root_directory_ + "/Build")
		os.mkdir(Globals.build_directory_)
	
	print( "--> Starting " + Globals.build_target_ + " Build")
	build_target = Globals.build_target_
	if build_target == "release":
		code_builder = Release()
		return code_builder.start()
	elif build_target == "archive":	
		archive_builder = Archiver()
		return archive_builder.start()
	elif build_target == "boost":
		code_builder = Boost()
		return code_builder.start()
	elif build_target == "documentation":
		documentation_builder = Documentation()
		return documentation_builder.start()
	elif build_target == "unittests":
		unit_tests = UnitTests()
		return unit_tests.start()
	elif build_target == "examples":
		examples = Examples()
		return examples.start()
	elif build_target == "clean":
		cleaner = Cleaner()
		return cleaner.clean()
	elif build_target == "rlibrary":
		rlibrary = RLibrary()
		return rlibrary.start()
	elif build_target == "rinstall":
		Globals.install_r_library = "true"
		rlibrary = RLibrary()
		return rlibrary.start()
	elif build_target == "installer":
		installer = Installer()
		return installer.start()
#	elif build_target == "deb":
#		deb_builder = DebBuilder()
#		return deb_builder.start(build_parameters)
	elif build_target == "version":
		version = Version()
		return version.create_version_header()
	return False # Default return from this, we didn't find a run mode
Example #7
0
def start():
  print '-- Checking for dateutil Python module'
  if 'dateutil' not in sys.modules:
    return Globals.PrintError("Python requires the module dateutil for the build system to work")
  print '-- Checking for datetime Python module'
  if 'datetime' not in sys.modules:
    return Globals.PrintError("Python requires the module datetime for the build system to work")
  print '-- Checking for re Python module'
  if 're' not in sys.modules:
    return Globals.PrintError("Python requires the module re for the build system to work")
  print '-- Checking for distutils Python module'
  if 'distutils' not in sys.modules:
    return Globals.PrintError("Python requires the module distutils for the build system to work")
  
  build_target = ""
  build_parameters = ""
  
  """
  Handle build information already passed in
  """
  if len(sys.argv) > 1 and len(str(sys.argv[1])) > 1:
      build_target = sys.argv[1]
  if len(sys.argv) > 2 and len(str(sys.argv[2])) > 1:
      build_parameters = sys.argv[2] 

  if build_target == "":
    return Globals.PrintError('Please provide a valid build target. Use doBuild help to see list');
  if not build_target.lower() in Globals.allowed_build_targets_:
    return Globals.PrintError(build_target + " is not a valid build target")
    
  build_target = build_target.lower()    
  if build_target == "help":
    print_usage()
    return True
  if build_target == "check":
	print "--> All checks completed successfully"
	return True 

  if build_parameters != "": 
    build_parameters = build_parameters.lower()
  
  Globals.build_target_ = build_target
  Globals.build_parameters_ = build_parameters
  
  print " -- Build target: " + Globals.build_target_
  print " -- Build parameters: " + Globals.build_parameters_
  print ""
  
  if build_target in Globals.allowed_build_types_:      
    if not build_parameters in Globals.allowed_build_parameters_:
      return Globals.PrintError("Build parameter " + build_parameters + " is not valid")
    
    print "*************************************************************************"
    print "*************************************************************************"
    print "--> Starting " + Globals.build_target_ + " Build"
    code_builder = MainCode()
    if not code_builder.start(False):
      return False
  if build_target == "library":
    if not build_parameters in Globals.allowed_library_parameters_:
      return Globals.PrintError("Library build parameter" + build_parameters + " is not valid")
    print "*************************************************************************"
    print "*************************************************************************"
    print "--> Starting " + Globals.build_target_ + " Build"
    code_builder = MainCode()
    if not code_builder.start(True):
      return False
  elif build_target == "frontend":
    print "*************************************************************************" 
    print "*************************************************************************"
    print "--> Starting " + Globals.build_target_ + " Build"
    code_builder = FrontEnd()
    if not code_builder.start():
      return False      
  elif build_target == "archive":
    print "*************************************************************************"
    print "*************************************************************************"
    print "--> Starting " + Globals.build_target_ + " Build"
    archive_builder = Archiver()
    if not archive_builder.start(build_parameters):
      return False
  elif build_target == "thirdparty" or build_target == "thirdpartylean":
    print "*************************************************************************"
    print "*************************************************************************"
    print "--> Starting " + Globals.build_target_ + " Build"
    code_builder = ThirdPartyLibraries()
    if not code_builder.start():
      return False
  elif build_target == "documentation":
    print "*************************************************************************"
    print "*************************************************************************"
    print "--> Starting " + Globals.build_target_ + " Build"
    documentation_builder = Documentation()
    if not documentation_builder.start():
      return False
  elif build_target == "modelrunner":
    print "*************************************************************************"
    print "*************************************************************************"
    print "--> Starting " + Globals.build_target_ + " Build"
    model_runner = ModelRunner()
    if not model_runner.start():
      return False
  elif build_target == "clean":
    print "*************************************************************************"
    print "*************************************************************************"
    print "--> Cleaning all CASAL2 built files"
    cleaner = Cleaner()
    if not cleaner.clean():
      return False
  elif build_target == "cleanall":
    print "*************************************************************************"
    print "*************************************************************************"
    print "--> Cleaning all CASAL2 built files, including third party headers and libs"
    cleaner = Cleaner()
    if not cleaner.clean_all():
      return False
  elif build_target == "rlibrary":
    print "*************************************************************************"
    print "*************************************************************************"
    print "--> Starting " + Globals.build_target_ + " Build"   
    r_path = '' 
    if Globals.operating_system_ == 'windows':
      print "find windows R"
      r_path = system_info.find_exe_path('R.exe') 
    else:
      r_path = system_info.find_exe_path('R')  
    print "R path = " + r_path  
    if r_path == '':
      return Globals.PrintError("R is not in the current path please add R to your path.")  
    rlibrary = Rlibrary()
    if not rlibrary.start():
      return False
  elif build_target == "installer":
    print "*************************************************************************"
    print "*************************************************************************"
    print "--> Building CASAL2 Installer"
    if Globals.operating_system_ == 'linux':
      return Globals.PrintError('Building Windows installer under linux is not supported')
    installer = Installer()
    installer.start()
  elif build_target == "deb":
    print "*************************************************************************"
    print "*************************************************************************"
    print "--> Building CASAL2 .deb Installer"    
    if Globals.operating_system_ == 'windows':
      return Globals.PrintError('Building linux .deb under Windows is not supported')
    deb_builder = DebBuilder()
    if not deb_builder.start(build_parameters):
      return False    

  return True
Example #8
0
def start():
  print '-- Checking for dateutil Python module'
  if 'dateutil' not in sys.modules:
    return Globals.PrintError("Python requires the module dateutil for the build system to work")
  print '-- Checking for datetime Python module'
  if 'datetime' not in sys.modules:
    return Globals.PrintError("Python requires the module datetime for the build system to work")
  print '-- Checking for re Python module'
  if 're' not in sys.modules:
    return Globals.PrintError("Python requires the module re for the build system to work")
  print '-- Checking for distutils Python module'
  if 'distutils' not in sys.modules:
    return Globals.PrintError("Python requires the module distutils for the build system to work")
  
  build_target = ""
  build_parameters = ""
  
  """
  Handle build information already passed in
  """
  if len(sys.argv) > 1 and len(str(sys.argv[1])) > 1:
      build_target = sys.argv[1]
  if len(sys.argv) > 2 and len(str(sys.argv[2])) > 1:
      build_parameters = sys.argv[2] 

  if build_target == "":
    return Globals.PrintError('Please provide a valid build target. Use doBuild help to see list');
  if not build_target.lower() in Globals.allowed_build_targets_:
    return Globals.PrintError(build_target + " is not a valid build target")
    
  build_target = build_target.lower()    
  if build_target == "help":
    print_usage()
    return True
  if build_target == "check":
	print "--> All checks completed successfully"
	return True 

  if build_parameters != "": 
    build_parameters = build_parameters.lower()
  
  Globals.build_target_ = build_target
  Globals.build_parameters_ = build_parameters
  
  print " -- Build target: " + Globals.build_target_
  print " -- Build parameters: " + Globals.build_parameters_
  print ""
  
  if build_target in Globals.allowed_build_types_:      
    if not build_parameters in Globals.allowed_build_parameters_:
      return Globals.PrintError("Build parameter " + build_parameters + " is not valid")
    
    print "*************************************************************************"
    print "*************************************************************************"
    print "--> Starting " + Globals.build_target_ + " Build"
    code_builder = MainCode()
    if not code_builder.start(False):
      return False
  if build_target == "thirdparty" or build_target == "thirdpartylean":
    print "*************************************************************************"
    print "*************************************************************************"
    print "--> Starting " + Globals.build_target_ + " Build"
    code_builder = ThirdPartyLibraries()
    if not code_builder.start():
      return False
  elif build_target == "clean":
    print "*************************************************************************"
    print "*************************************************************************"
    print "--> Cleaning all IBM built files"
    cleaner = Cleaner()
    if not cleaner.clean():
      return False
  elif build_target == "modelrunner":
    print "*************************************************************************"
    print "*************************************************************************"
    print "--> Starting " + Globals.build_target_ + " Build"
    model_runner = ModelRunner()
    if not model_runner.start():
      return False      
  elif build_target == "documentation":
    print "*************************************************************************"
    print "*************************************************************************"
    print "--> Starting " + Globals.build_target_ + " Build"
    documentation_builder = Documentation()
    if not documentation_builder.start():
      return False	  
  elif build_target == "cleanall":
    print "*************************************************************************"
    print "*************************************************************************"
    print "--> Cleaning all IBM built files, including third party headers and libs"
    cleaner = Cleaner()
    if not cleaner.clean_all():
      return False

  return True
Example #9
0
def start():
    print '-- Checking for dateutil Python module'
    if 'dateutil' not in sys.modules:
        return Globals.PrintError(
            "Python requires the module dateutil for the build system to work")
    print '-- Checking for datetime Python module'
    if 'datetime' not in sys.modules:
        return Globals.PrintError(
            "Python requires the module datetime for the build system to work")
    print '-- Checking for re Python module'
    if 're' not in sys.modules:
        return Globals.PrintError(
            "Python requires the module re for the build system to work")
    print '-- Checking for distutils Python module'
    if 'distutils' not in sys.modules:
        return Globals.PrintError(
            "Python requires the module distutils for the build system to work"
        )

    build_target = ""
    build_parameters = ""
    """
  Handle build information already passed in
  """
    if len(sys.argv) > 1 and len(str(sys.argv[1])) > 1:
        build_target = sys.argv[1]
    if len(sys.argv) > 2 and len(str(sys.argv[2])) > 1:
        build_parameters = sys.argv[2]

    if build_target == "":
        return Globals.PrintError(
            'Please provide a valid build target. Use doBuild help to see list'
        )
    if not build_target.lower() in Globals.allowed_build_targets_:
        return Globals.PrintError(build_target +
                                  " is not a valid build target")

    build_target = build_target.lower()
    if build_target == "help":
        print_usage()
        return True
    if build_target == "check":
        print "--> All checks completed successfully"
        return True

    if build_parameters != "":
        build_parameters = build_parameters.lower()

    Globals.build_target_ = build_target
    Globals.build_parameters_ = build_parameters

    print " -- Build target: " + Globals.build_target_
    print " -- Build parameters: " + Globals.build_parameters_
    print ""

    if build_target in Globals.allowed_build_types_:
        if not build_parameters in Globals.allowed_build_parameters_:
            return Globals.PrintError("Build parameter " + build_parameters +
                                      " is not valid")

        print "*************************************************************************"
        print "*************************************************************************"
        print "--> Starting " + Globals.build_target_ + " Build"
        code_builder = MainCode()
        if not code_builder.start(False):
            return False
    if build_target == "library":
        if not build_parameters in Globals.allowed_library_parameters_:
            return Globals.PrintError("Library build parameter" +
                                      build_parameters + " is not valid")
        print "*************************************************************************"
        print "*************************************************************************"
        print "--> Starting " + Globals.build_target_ + " Build"
        code_builder = MainCode()
        if not code_builder.start(True):
            return False
    elif build_target == "frontend":
        print "*************************************************************************"
        print "*************************************************************************"
        print "--> Starting " + Globals.build_target_ + " Build"
        code_builder = FrontEnd()
        if not code_builder.start():
            return False
    elif build_target == "archive":
        print "*************************************************************************"
        print "*************************************************************************"
        print "--> Starting " + Globals.build_target_ + " Build"
        archive_builder = Archiver()
        if not archive_builder.start(build_parameters):
            return False
    elif build_target == "thirdparty" or build_target == "thirdpartylean":
        print "*************************************************************************"
        print "*************************************************************************"
        print "--> Starting " + Globals.build_target_ + " Build"
        code_builder = ThirdPartyLibraries()
        if not code_builder.start():
            return False
    elif build_target == "documentation":
        print "*************************************************************************"
        print "*************************************************************************"
        print "--> Starting " + Globals.build_target_ + " Build"
        documentation_builder = Documentation()
        if not documentation_builder.start():
            return False
    elif build_target == "modelrunner":
        print "*************************************************************************"
        print "*************************************************************************"
        print "--> Starting " + Globals.build_target_ + " Build"
        model_runner = ModelRunner()
        if not model_runner.start():
            return False
    elif build_target == "clean":
        print "*************************************************************************"
        print "*************************************************************************"
        print "--> Cleaning all CASAL2 built files"
        cleaner = Cleaner()
        if not cleaner.clean():
            return False
    elif build_target == "cleanall":
        print "*************************************************************************"
        print "*************************************************************************"
        print "--> Cleaning all CASAL2 built files, including third party headers and libs"
        cleaner = Cleaner()
        if not cleaner.clean_all():
            return False
    elif build_target == "rlibrary":
        print "*************************************************************************"
        print "*************************************************************************"
        print "--> Starting " + Globals.build_target_ + " Build"
        r_path = ''
        if Globals.operating_system_ == 'windows':
            print "find windows R"
            r_path = system_info.find_exe_path('R.exe')
        else:
            r_path = system_info.find_exe_path('R')
        print "R path = " + r_path
        if r_path == '':
            return Globals.PrintError(
                "R is not in the current path please add R to your path.")
        rlibrary = Rlibrary()
        if not rlibrary.start():
            return False
    elif build_target == "installer":
        print "*************************************************************************"
        print "*************************************************************************"
        print "--> Building CASAL2 Installer"
        if Globals.operating_system_ == 'linux':
            return Globals.PrintError(
                'Building Windows installer under linux is not supported')
        installer = Installer()
        installer.start()
    elif build_target == "deb":
        print "*************************************************************************"
        print "*************************************************************************"
        print "--> Building CASAL2 .deb Installer"
        if Globals.operating_system_ == 'windows':
            return Globals.PrintError(
                'Building linux .deb under Windows is not supported')
        deb_builder = DebBuilder()
        if not deb_builder.start(build_parameters):
            return False

    return True
Example #10
0
# fax: ++49-241-80-22242
# email: [email protected]
# www: http://www.openwns.org
# _____________________________________________________________________________
#
# openWNS is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License version 2 as published by the
# Free Software Foundation;
#
# openWNS is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
# details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

import wnsbase.playground.Core
import Documentation

core = wnsbase.playground.Core.getCore()

if not core.hasPlugin("Documentation"):
    core.registerPlugin("Documentation")

    docuCommand = Documentation.DocuCommand()

    core.registerCommand(docuCommand)
 def __init__(self, name, docstring, role):
     self._name = name
     self._role = role
     self._taggedDescription = Documentation.TaggedDocstring()
     self._taggedDescription.parse(docstring)
     self._tags = Documentation.DictWrapper(self._taggedDescription)
Example #12
0
def start():
	cli = CommandLineInterface()
	if not cli.parse():
  		cli.print_usage()
  		return False
      
	print("*************************************************************************")
	print("*************************************************************************")
	print(f"--> Starting {Globals.build_target_} Build")
	build_target = Globals.build_target_
	build_parameters = Globals.build_parameters_

	# Build Version
	version = Version()
	version.create_version_header()

	if build_target == "version":
		version = Version()
		version.create_version_header(display_output=True)
	elif build_target in Globals.allowed_build_types_:
		code_builder = MainCode()
		return code_builder.start()
	elif build_target == "library":
		if not build_parameters in Globals.allowed_library_parameters_:
			return Globals.PrintError(f"Library build parameter {build_parameters} is not valid")
		print("--> Starting " + Globals.build_target_ + " Build")
		code_builder = MainCode()
		return code_builder.start(build_library=True)			
	elif build_target == "frontend":
		print("--> Starting " + Globals.build_target_ + " Build")
		code_builder = FrontEnd()
		return code_builder.start()
	elif build_target == "archive":	
		archive_builder = Archiver()
		return archive_builder.start(build_parameters)
	elif build_target == "thirdparty" or build_target == "thirdpartylean":
		code_builder = ThirdPartyLibraries()
		return code_builder.start()
	elif build_target == "documentation":
		documentation_builder = Documentation()
		return documentation_builder.start()
	elif build_target == "modelrunner":
		model_runner = ModelRunner()
		return model_runner.start()
	elif build_target == "unittests":
		unit_tests = UnitTests()
		return unit_tests.start()	
	elif build_target == "clean":
		cleaner = Cleaner()
		return cleaner.clean()	
	elif build_target == "cleancache":
		cleaner = Cleaner()
		return cleaner.clean_cache()
	elif build_target == "clean_all":
		cleaner = Cleaner()
		return cleaner.clean_all()
	elif build_target == "rlibrary":
		rlibrary = Rlibrary()
		return rlibrary.start()
	elif build_target == "installer":
		if Globals.operating_system_ == 'linux':
			return Globals.PrintError('Building Windows installer under linux is not supported')		
		installer = Installer()
		return installer.start()
	elif build_target == "deb":
		if Globals.operating_system_ == 'windows':
			return Globals.PrintError('Building linux .deb under Windows is not supported')
		deb_builder = DebBuilder()
		return deb_builder.start(build_parameters)
	return False # Default return from this, we didn't find a run mode
	def visitFunction(self, node, parent = None):
		if parent and node.name == 'body' and len(node.argnames) > 0 and node.argnames[0] == 'self':
			# This is the body function of a Test Case.
			# We should reference its docstring and arguments for Test Case parameters documentation.
			parent.argumentsDocstring = Documentation.trim(node.doc)
			parent.arguments = node.argnames[1:]