def test_location(): elocation.move ("eve", "eve2") elocation.copy ("eve2", "eve3") elocation.delete ("eve3") elocation.move ("eve2", "eve") print (elocation.base_directory()) print (elocation.trunk_source()) print (elocation.eve_source()) print (elocation.eweasel()) print (elocation.nightly()) print (elocation.build()) print (elocation.eweasel_build())
def update_environment_variables(): # ISE_PLATFORM if not "ISE_PLATFORM" in os.environ or os.getenv("ISE_PLATFORM") != d_ise_platform: set_persistent_environment_variable("ISE_PLATFORM", d_ise_platform) # ISE_EIFFEL version, path = get_installed_version() if "ISE_EIFFEL" in os.environ and path == None: SystemLogger.debug ("WARNING: No nightly build available. Using ISE_EIFFEL = " + os.getenv("ISE_EIFFEL")) elif not "ISE_EIFFEL" in os.environ or os.getenv("ISE_EIFFEL") != path: set_persistent_environment_variable("ISE_EIFFEL", path) # else: # raise Exception ("Could not set ISE_EIFFEL environment variable.") # ISE_C_COMPILER if not "ISE_C_COMPILER" in os.environ or os.getenv("ISE_C_COMPILER") != d_ise_c_compiler: set_persistent_environment_variable("ISE_C_COMPILER", d_ise_c_compiler) # EIFFEL_SRC eiffel_source = os.path.realpath(elocation.trunk_source()) if not "EIFFEL_SRC" in os.environ or os.getenv("EIFFEL_SRC") != eiffel_source: set_persistent_environment_variable("EIFFEL_SRC", eiffel_source) # EWEASEL if not "EWEASEL" in os.environ or os.getenv("EWEASEL") != elocation.eweasel(): set_persistent_environment_variable("EWEASEL", elocation.eweasel()) # ISE_LIBRARY eiffel_source = os.path.realpath(elocation.trunk_source()) if not "ISE_LIBRARY" in os.environ or os.getenv("ISE_LIBRARY") != eiffel_source: set_persistent_environment_variable("ISE_LIBRARY", eiffel_source) # PATH: EiffelStudio # TODO: update PATH contents # Temporary path update for execution in same session os.environ['PATH'] = os.path.join(os.getenv("ISE_EIFFEL"), 'studio', 'spec', os.getenv("ISE_PLATFORM"), 'bin') + os.pathsep + os.environ['PATH'] if platform.system() != "Windows": with open (os.path.join (elocation.base_directory(), 'scripts', 'nightly.unix.sh'), 'w') as l_file: l_file.write ('export ISE_EIFFEL=') l_file.write (path) l_file.write ('\n') return
# - [Windows only] 7zip - installed at default location C:\Program Files\7-zip # ============================================================================ # TODO # http://www.tutorialspoint.com/python/python_gui_programming.htm import config import elocation # <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> # SETUP VARIABLES # <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> # Base directory where EiffelStudio will be installed # EiffelStudio will be installed in a subdirectory EiffelStudioXY_zzzzzz v_dir_eiffelstudio_base = elocation.base_directory() #"." # Set this to a string of a specific version of EiffelStudio that is already installed (i.e. "12345") v_force_es_version = None # Directory where EVE source will be checked out #v_dir_eve_source = "./eve" v_dir_eve_source = elocation.trunk_source() # Directory where generated deliveries will be saved v_dir_delivery = "./delivery" v_dir_delivery_remote = r"\\fs.meyer.inf.ethz.ch\web\htdocs\research\eve\builds" v_remote_base_url = r"http://se.inf.ethz.ch/research/eve/builds" # Directory where Boogie/Z3 bundle is installed v_dir_boogie = "./eve/Delivery/studio/tools/boogie"
def compile_runtime(): builddir = os.path.join (elocation.build(), "runtime") build_libdir = None sourcedir = os.path.join (elocation.trunk_source(), "C") scriptdir = os.path.join (elocation.base_directory(), "scripts") shell_command = os.path.expandvars (d_shell_command_raw) # TODO: Incremental compilation. copy_files (os.path.join (scriptdir, "*lua*"), sourcedir) elocation.delete (os.path.join (sourcedir, "config.sh")) config_sh = os.environ ["ISE_PLATFORM"] old_path = os.environ ["PATH"] if config_sh == 'win64': os.environ ["PATH"] = os.path.dirname (shell_command) + ':' + old_path config_sh = 'windows-x86-64-' + os.environ ['ISE_C_COMPILER'] if config_sh == 'win32': os.environ ["PATH"] = dirname (shell_command) + ':' + old_path config_sh = 'windows-x86-' + os.environ ['ISE_C_COMPILER'] elocation.copy (os.path.expandvars (os.path.join (sourcedir, "CONFIGS", config_sh)), os.path.join (sourcedir, "config.sh")) run_command ([shell_command, "config_lua.SH"], sourcedir) run_command ([shell_command, "eif_config_h.SH"], sourcedir) run_command ([shell_command, "eif_size_h.SH"], os.path.join (sourcedir, "run-time")) copy_files (os.path.join (sourcedir, "*.h"), os.path.join (sourcedir, "run-time")) os.environ ['PATH'] = old_path if platform.system() == 'Windows': # Shell and Nmake based build system: run_command ([os.path.join(sourcedir, "Configure.bat"), "clean"], sourcedir) run_command ([os.path.join(sourcedir, "Configure.bat"), d_windows_runtime_flag, 'm'], sourcedir) l_config_location = os.path.expandvars (os.path.join("$ISE_EIFFEL", "studio", "config", "$ISE_PLATFORM", "$ISE_C_COMPILER")) copy_files (os.path.join (sourcedir, "config.sh"), l_config_location) build_libdir = os.path.join (sourcedir, 'run-time', 'LIB') # Premake based build system: # run_command ([os.path.join (sourcedir, 'premake4.exe'), "vs2010"], sourcedir) # run_command (['msbuild.exe', 'EiffelRunTime.sln', '/upgrade'], builddir) # run_command (["msbuild.exe", "EiffelRunTime.sln"], builddir) # build_libdir = os.path.join (builddir, 'spec', 'lib') else: # Shell and make based build system: # run_command (["make", "clobber"], sourcedir) # run_command (["./quick_configure"], sourcedir) # build_libdir = os.path.join (sourcedir, 'run-time') # Premake based build system: # NOTE: This is a workaround for a current problem: # Two files are called stack.c # We therefore create a symlink between these files. l_stack_ipc = os.path.join (sourcedir, "ipc", "shared", "stack_ipc.c") if not os.path.exists (l_stack_ipc): os.symlink (os.path.join (os.path.dirname (l_stack_ipc), "stack.c"), l_stack_ipc) if os.path.exists (os.path.join (builddir, "Makefile")): run_command (["make", "clean"], builddir) run_command (["premake4", "gmake"], sourcedir) #TODO: Get the correct link_command from config.sh (sharedlink Bash variable) fix_makefiles (os.path.join (builddir, "*_shared.make"), 'ld') make_command = ["make"] #make_command = make_command + ["config=release"] # Release #make_command = make_command + ["verbose=y"] # Verbose output run_command (make_command, builddir) copy_files (os.path.join (sourcedir, "config.sh"), d_target_includedir_raw) build_libdir = os.path.join (builddir, "spec", "lib") # Copy public header files and all run-times. copy_files (os.path.join (sourcedir, "run-time", "*.h"), d_target_includedir_raw) copy_files (os.path.join (sourcedir, "run-time", "eif_stack.decl"), d_target_includedir_raw) copy_files (os.path.join (sourcedir, "run-time", "eif_stack.interface"), d_target_includedir_raw) copy_files (os.path.join (build_libdir, "*finalized.*"), d_target_libdir_raw) copy_files (os.path.join (build_libdir, "*wkbench.*"), d_target_libdir_raw) # Compile the various C support libraries needed by Eiffel libraries. compile_libraries (d_platform_libs) compile_libraries (d_shared_libs)