def _internal_compile (self, X_code, additional_commands): ec_path = os.path.expandvars (os.path.join ("$ISE_EIFFEL", "studio", "spec", "$ISE_PLATFORM", "bin", _append_exe('ec'))) ecf_path = os.path.join (self._project_path, self._ecf) # Print some information about the compilation step in the console. SystemLogger.info("EiffelStudio: " + ec_path) SystemLogger.info("ECF: " + ecf_path) SystemLogger.info("Target: " + self._target) SystemLogger.info("ISE_EIFFEL: " + os.environ['ISE_EIFFEL']) SystemLogger.info("ISE_LIBRARY: " + os.environ['ISE_LIBRARY']) SystemLogger.info("EIFFEL_SRC: " + os.environ['EIFFEL_SRC']) if os.path.isfile (ecf_path): # Invoke the Eiffel compiler with the right arguments. command = [ec_path, '-config', ecf_path, '-batch'] + additional_commands code = eutils.execute (command, SystemLogger.get_file(), self._project_path) # Check if the compilation was successful and store last_result. generated_binary = os.path.join (self._project_path, 'EIFGENs', self._target, X_code, self._binary) if code == 0 and generated_binary != None and os.path.isfile (generated_binary): self._last_result = generated_binary SystemLogger.success ("Compilation of Eiffel project " + ecf_path + " (" + self._target + ") successful.") else: self._last_result = None SystemLogger.error ("Compilation of Eiffel project " + ecf_path + " (" + self._target + ") failed.") else: SystemLogger.error("ECF file '" + ecf_path + "' does not exist")
def run_command (command, directory): eutils.execute (command, SystemLogger.get_file(), os.path.expandvars (directory))