Exemplo n.º 1
0
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())
Exemplo n.º 2
0
def install():
    assert os.environ["ISE_EIFFEL"] != None, "ISE_EIFFEL is not set."
    assert os.environ["ISE_PLATFORM"] != None, "ISE_PLATFORM is not set."
    assert os.environ["ISE_LIBRARY"] != None, "ISE_LIBRARY is no set."
    assert os.environ["EWEASEL"] != None, "EWEASEL is not set."

    update()

    l_path = os.path.expandvars(os.path.join("$EWEASEL", "source", "eweasel.ecf"))
    l_project = ecompile.EiffelProject(l_path, "eweasel_mt", "eweasel-mt")
    if l_project.finalize():
        l_target_dir = os.path.expandvars(os.path.join("$EWEASEL", "spec", "$ISE_PLATFORM", "bin"))
        if not os.path.exists(l_target_dir):
            os.makedirs(l_target_dir)
        elocation.copy(l_project.last_result(), l_target_dir)
        l_project.clean()
        SystemLogger.success("Eweasel installation successful.")
        SystemLogger.warning("Make sure that $EWEASEL/spec/$ISE_PLATFORM/bin is in your PATH variable!")
    else:
        SystemLogger.error("Installation of eweasel failed.")
Exemplo n.º 3
0
def make_delivery():
	SystemLogger.info("Generating new delivery")

	eve_version = esvn.info_local_revision_number(v_dir_eve_source) #TODO
	delivery_name = 'eve_' + str(eve_version)
	delivery_path = os.path.realpath(os.path.join(v_dir_delivery, delivery_name))
	# generate finalized version
	check_environment_variables()
	compile_runtime()
	update_version_number()
	finalize_eve('bench')
	revert_version_number()
	# copy EiffelStudio to delivery destination (this copies the runtime)
	elocation.copy(os.getenv("ISE_EIFFEL"), delivery_path)
	# copy finalized eve to delivery destination
	eve_exe_source = os.path.join(v_dir_eve_source, 'Eiffel', 'Ace', 'EIFGENs', 'bench', 'F_code', d_eve_exe_name)
	eve_exe_target = os.path.join(delivery_path, 'studio', 'spec', os.getenv("ISE_PLATFORM"), 'bin', d_eve_exe_name)
	elocation.copy(eve_exe_source, eve_exe_target)
	# AutoProof: copy update to base library
	source = os.path.join(v_dir_eve_source, 'library', 'base', 'eve')
	target = os.path.join(delivery_path, 'library', 'base', 'eve')
	elocation.copy(source, target)
	source = os.path.join(v_dir_eve_source, 'library', 'base', 'base2')
	target = os.path.join(delivery_path, 'library', 'base', 'base2')
	elocation.copy(source, target)
	source = os.path.join(v_dir_eve_source, 'library', 'base', 'mml')
	target = os.path.join(delivery_path, 'library', 'base', 'mml')
	elocation.copy(source, target)
	source = os.path.join(v_dir_eve_source, 'library', 'base', 'base-eve.ecf')
	target = os.path.join(delivery_path, 'library', 'base', 'base-eve.ecf')
	elocation.copy(source, target)
	# AutoProof: copy ecf for precompile
	source = os.path.join(v_dir_eve_source, 'Delivery', 'precomp', 'spec', 'platform', 'base-eve.ecf')
	target = os.path.join(delivery_path, 'precomp', 'spec', os.getenv("ISE_PLATFORM"), 'base-eve.ecf')
	elocation.copy(source, target)
	# AutoProof: copy Boogie files
	source = os.path.join(v_dir_eve_source, 'Delivery', 'studio', 'tools', 'autoproof')
	target = os.path.join(delivery_path, 'studio', 'tools', 'autoproof')
	elocation.copy(source, target)
	# copy Boogie to delivery destination
	boogie_target = os.path.join(delivery_path, 'studio', 'tools', 'boogie')
	elocation.copy(v_dir_boogie, boogie_target)
	# copy libraries to delivery destination
	source = os.path.join(v_dir_eve_source, 'library', 'fixing')
	target = os.path.join(delivery_path, 'library', 'fixing')
	elocation.copy(source, target)
# TODO
	# copy install/run scripts to destination
	source = os.path.join(v_dir_eve_source, 'Delivery', 'run_eve.bat')
	target = os.path.join(delivery_path, 'run_eve.bat')
	elocation.copy(source, target)
	source = os.path.join(v_dir_eve_source, 'Delivery', 'run_eve.py')
	target = os.path.join(delivery_path, 'run_eve.py')
	elocation.copy(source, target)
	# generate zip archive
	archive_path = eutils.compress(delivery_path, delivery_name + "-" + d_ise_platform)
	delivery_file = os.path.join(v_dir_delivery, os.path.basename(archive_path))
	elocation.move(archive_path, delivery_file)
	# clean up
	elocation.delete(delivery_path)
	SystemLogger.success("Delivery " + delivery_name + " finished")
	# upload zip to server
	result = None
	if os.path.exists(v_dir_delivery_remote):
		remote_file = os.path.join(v_dir_delivery_remote, os.path.basename(delivery_file))
		elocation.copy(delivery_file, remote_file)
		SystemLogger.success("Delivery copied to remote location")
		result = v_remote_base_url + '/' + os.path.basename(delivery_file)
	else:
		if v_dir_delivery_remote != None:
			SystemLogger.error("Remote location (" + v_dir_delivery_remote + ") does not exist")
	return result
Exemplo n.º 4
0
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)