/[eiffelstudio]/branches/Eiffel_57_docking/Src/Eiffel/API/constants/eiffel_env.e
ViewVC logotype

Contents of /branches/Eiffel_57_docking/Src/Eiffel/API/constants/eiffel_env.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 62171 - (show annotations)
Tue Aug 1 01:27:17 2006 UTC (13 years, 4 months ago) by larryl
File size: 15251 byte(s)
First commit docking tabbed Eiffel Studio.
1 indexing
2
3 description:
4 "Environment for bitmaps, help, binaries, scripts...."
5 legal: "See notice at end of class."
6 status: "See notice at end of class."
7 date: "$Date$"
8 revision: "$Revision$"
9
10 class EIFFEL_ENV
11
12 inherit
13 SYSTEM_CONSTANTS
14
15 SHARED_EXEC_ENVIRONMENT
16
17 feature -- Status
18
19 check_environment_variable is
20 -- Check if $ISE_EIFFEL and $ISE_PLATFORM are correctly set?
21 local
22 temp: STRING
23 p: PRODUCT_NAMES
24 do
25 temp := Eiffel_installation_dir_name
26 create p
27 if (temp = Void) or else temp.is_empty then
28 io.error.put_string (p.Workbench_name)
29 io.error.put_string (": the environment variable $ISE_EIFFEL is not set%N")
30 (create {EXCEPTIONS}).die (-1)
31 end
32
33 temp := Eiffel_platform
34 if (temp = Void) or else temp.is_empty then
35 io.error.put_string (p.Workbench_name)
36 io.error.put_string (": the environment variable $ISE_PLATFORM is not set%N")
37 (create {EXCEPTIONS}).die (-1)
38 end
39
40 if Platform_constants.is_windows then
41 temp := Eiffel_c_compiler
42 if (temp = Void) or else temp.is_empty then
43 io.error.put_string (p.Workbench_name)
44 io.error.put_string (": the environment variable $ISE_C_COMPILER is not set%N")
45 (create {EXCEPTIONS}).die (-1)
46 end
47 end
48
49 if Execution_environment.get (ise_library_env) = Void then
50 Execution_environment.put (eiffel_installation_dir_name, ise_library_env)
51 end
52 end
53
54 feature -- Status report
55
56 is_workbench: BOOLEAN is
57 -- Are we running the workbench version of the compiler?
58 external
59 "C inline use %"eif_eiffel.h%""
60 alias
61 "EIF_IS_WORKBENCH"
62 end
63
64 feature -- Access: environment variable
65
66 Eiffel_installation_dir_name: STRING is
67 -- Installation of ISE Eiffel name.
68 once
69 Result := Execution_environment.get ("ISE_EIFFEL")
70 ensure
71 eiffel_installation_dir_name_not_void: Result /= Void
72 end
73
74 Eiffel_library: STRING is
75 -- ISE_LIBRARY name.
76 once
77 Result := Execution_environment.get ("ISE_LIBRARY")
78 ensure
79 eiffel_library_not_void: Result /= Void
80 end
81
82 Eiffel_c_compiler: STRING is
83 -- ISE_C_COMPILER name.
84 once
85 Result := Execution_environment.get ("ISE_C_COMPILER")
86 ensure
87 eiffel_c_compiler_not_void: platform_constants.is_windows implies Result /= Void
88 end
89
90 Eiffel_platform: STRING is
91 -- ISE_PLATFORM name.
92 once
93 Result := Execution_environment.get ("ISE_PLATFORM")
94 ensure
95 eiffel_platform_not_void: Result /= Void
96 end
97
98 Eiffel_defaults: STRING is
99 -- ISE_DEFAULTS name.
100 once
101 Result := Execution_environment.get ("ISE_DEFAULTS")
102 end
103
104 Eiffel_projects_directory: STRING is
105 -- ISE_PROJECRS name.
106 once
107 Result := Execution_environment.get ("ISE_PROJECTS")
108 end
109
110 eiffel_home: DIRECTORY_NAME is
111 -- Name of directory containing Eiffel specific data.
112 once
113 create Result.make_from_string (Home)
114 if platform_constants.is_windows then
115 Result.extend ("EiffelStudio")
116 else
117 Result.extend (".ec")
118 end
119 ensure
120 Eiffel_home_not_empty: Result /= Void
121 end
122
123 Home: STRING is
124 -- HOME name.
125 once
126 Result := execution_environment.home_directory_name
127 if Result = Void then
128 Result := ""
129 end
130 ensure
131 home_not_void: Result /= Void
132 end
133
134 Platform_abstraction: STRING is
135 -- Abstraction between Windows and Unix.
136 once
137 if Platform_constants.is_windows then
138 Result := "windows"
139 else
140 Result := "unix"
141 end
142 ensure
143 platform_abstraction_not_void: Result /= Void
144 end
145
146 short_studio_name: STRING is "studio"
147 -- Short version of EiffelStudio name.
148
149 docking_data_name: STRING is
150 -- Docking config data folder name
151 once
152 if not is_workbench then
153 Result := "docking"
154 else
155 Result := "docking_wb"
156 end
157 end
158
159 feature -- Access: file name
160
161 Eiffel_preferences: STRING is
162 -- Preferences location
163 local
164 fname: FILE_NAME
165 once
166 if Platform_constants.is_windows then
167 Result := "HKEY_CURRENT_USER\Software\ISE\Eiffel" +
168 Major_version_number.out + Minor_version_number.out + "\ec\Preferences"
169 else
170 create fname.make_from_string (eiffel_home)
171 fname.set_file_name (".ecrc" + Major_version_number.out + Minor_version_number.out)
172 Result := fname
173 end
174 if is_workbench then
175 Result.append ("_wkbench")
176 end
177 end
178
179 Templates_path: FILE_NAME is
180 -- Location of templates.
181 once
182 create Result.make_from_string (Eiffel_installation_dir_name)
183 Result.extend_from_array (<<short_studio_name, "help", "defaults">>)
184 end
185
186 Generation_templates_path: FILE_NAME is
187 -- Location of templates used in code generation.
188 once
189 create Result.make_from_string (Eiffel_installation_dir_name)
190 Result.extend_from_array (<<short_studio_name, "config", Eiffel_platform, "templates">>)
191 ensure
192 generation_templates_path_not_void: Result /= Void and not Result.is_empty
193 end
194
195 Assemblies_path: FILE_NAME is
196 -- Location of Eiffel Assembly Cache.
197 once
198 create Result.make_from_string ("$ISE_EIFFEL")
199 Result.extend_from_array (<<"dotnet", "assemblies">>)
200 end
201
202 Default_class_file: FILE_NAME is
203 once
204 Result := Templates_path.twin
205 Result.set_file_name (Default_class_filename)
206 end
207
208 Default_config_name: FILE_NAME is
209 once
210 create Result.make_from_string (Templates_path)
211 Result.set_file_name (Default_config_file)
212 end
213
214 Bitmaps_path: DIRECTORY_NAME is
215 once
216 create Result.make_from_string (Eiffel_installation_dir_name)
217 Result.extend_from_array (<<short_studio_name, "bitmaps">>)
218 end
219
220 Cursor_path: DIRECTORY_NAME is
221 once
222 create Result.make_from_string (Eiffel_installation_dir_name)
223 Result.extend_from_array (<<short_studio_name, "bitmaps", "cursor">>)
224 end
225
226 Library_path: DIRECTORY_NAME is
227 once
228 create Result.make_from_string (Eiffel_library)
229 Result.extend (library_directory_name)
230 end
231
232 Syntax_path: DIRECTORY_NAME is
233 once
234 create Result.make_from_string (Eiffel_installation_dir_name)
235 Result.extend_from_array (<<short_studio_name, "syntax">>)
236 end
237
238 Help_path: DIRECTORY_NAME is
239 once
240 create Result.make_from_string (Eiffel_installation_dir_name)
241 Result.extend_from_array (<<short_studio_name, "help", "errors">>)
242 end
243
244 Bin_path: FILE_NAME is
245 -- Partial file name that points to bin directory of Eiffel installation.
246 -- Therefore it is not a once function since we need to create
247 -- a new instance each time it is called so that caller can then
248 -- calls `set_file_name' on returned object.
249 do
250 create Result.make_from_string (Eiffel_installation_dir_name)
251 Result.extend_from_array (<<short_studio_name, "spec", Eiffel_platform, "bin">>)
252 end
253
254 Default_precompiled_location: DIRECTORY_NAME is
255 -- Default location for the precompiled base
256 -- $ISE_EIFFEL/precomp/spec/$ISE_PLATFORM
257 once
258 create Result.make_from_string (Eiffel_installation_dir_name)
259 Result.extend_from_array (<<"precomp", "spec", Eiffel_platform>>)
260 end
261
262 filter_path: DIRECTORY_NAME is
263 once
264 create Result.make_from_string (Eiffel_installation_dir_name)
265 Result.extend_from_array (<<short_studio_name, "filters">>)
266 end
267
268 profile_path: DIRECTORY_NAME is
269 -- Location of the profiler configuration files
270 once
271 create Result.make_from_string (Eiffel_installation_dir_name)
272 Result.extend_from_array(<<short_studio_name, "profiler">>)
273 end
274
275 predefined_metrics_file: FILE_NAME is
276 -- File to store predefined metrics
277 once
278 create Result.make_from_string (eiffel_installation_dir_name)
279 Result.extend_from_array (<<short_studio_name, "metrics">>)
280 Result.set_file_name ("predefined_metrics.xml")
281 ensure
282 predefined_metrics_file_not_void: Result /= Void
283 predefined_metrics_file_not_empty: not Result.is_empty
284 end
285
286 New_project_wizards_path: DIRECTORY_NAME is
287 -- Location of new project wizards.
288 once
289 create Result.make_from_string (Eiffel_installation_dir_name)
290 Result.extend_from_array (<<short_studio_name, "wizards", "new_projects">>)
291 end
292
293 precompilation_wizard_command_name: FILE_NAME is
294 -- Command to be executed to launch the precompilation wizard.
295 once
296 create Result.make_from_string (Eiffel_installation_dir_name)
297 Result.extend_from_array (<<short_studio_name, "wizards", "others", "precompile", "spec", Eiffel_platform>>)
298 Result.set_file_name ("wizard")
299 end
300
301 precompilation_wizard_resources_directory: DIRECTORY_NAME is
302 once
303 create Result.make_from_string (Eiffel_installation_dir_name)
304 Result.extend_from_array (<<short_studio_name, "wizards", "others", "precompile">>)
305 end
306
307 last_opened_projects_resource_name: STRING is "studio_recent_files"
308
309 general_preferences: FILE_NAME is
310 -- Platform independent preferences.
311 do
312 create Result.make_from_string (Eiffel_installation_dir_name)
313 Result.extend_from_array (<<"eifinit", short_studio_name>>)
314 Result.set_file_name ("default")
315 Result.add_extension ("xml")
316 ensure
317 general_preferences_not_void: Result /= Void
318 general_preferences_not_empty: not Result.is_empty
319 end
320
321 platform_preferences: FILE_NAME is
322 -- Platform specific preferences.
323 do
324 create Result.make_from_string (Eiffel_installation_dir_name)
325 Result.extend_from_array (<<"eifinit", short_studio_name, "spec", Platform_abstraction>>)
326 Result.set_file_name ("default")
327 Result.add_extension ("xml")
328 ensure
329 platform_preferences_not_void: Result /= Void
330 platform_preferences_not_empty: not Result.is_empty
331 end
332
333 compiler_configuration: FILE_NAME is
334 -- Platform specific system level resource specification file
335 -- ($ISE_EIFFEL/eifinit/application_name/spec/$ISE_PLATFORM)
336 require
337 Eiffel_installation_dir_name_not_void: Eiffel_installation_dir_name /= Void
338 Eiffel_platform: Eiffel_platform /= Void
339 do
340 create Result.make_from_string (Eiffel_installation_dir_name)
341 Result.extend_from_array (<<"eifinit", short_studio_name>>)
342 Result.set_file_name ("general")
343 Result.add_extension ("cfg")
344 ensure
345 compiler_configuration_not_void: Result /= Void
346 compiler_configuration_not_empty: not Result.is_empty
347 end
348
349 msil_culture_name: FILE_NAME is
350 -- Culture specification file
351 require
352 is_windows: Platform_constants.is_windows
353 once
354 create Result.make_from_string (Eiffel_installation_dir_name)
355 Result.extend_from_array (<<"eifinit", short_studio_name, "spec", Platform_abstraction>>)
356 Result.set_file_name ("culture")
357 end
358
359 tmp_directory: DIRECTORY_NAME is
360 -- Locate of the temporary directory
361 once
362 create Result.make
363 Result.set_directory ("tmp")
364 end
365
366 Ise_eac_browser_name: FILE_NAME is
367 -- Filename of EAC Browser application
368 once
369 create Result.make_from_string (Eiffel_installation_dir_name)
370 Result.extend_from_array (<<short_studio_name, "spec", Eiffel_platform, "bin">>)
371 Result.set_file_name (Eac_browser_file)
372 end
373
374 eiffelsoftware_runtime_path: STRING is
375 -- Path to EiffelSoftware.Runtime.dll
376 local
377 l_separator: CHARACTER
378 once
379 l_separator := (create {OPERATING_ENVIRONMENT}).directory_separator
380 create Result.make (short_studio_name.count + 63)
381 Result.append ("$ISE_EIFFEL")
382 Result.append_character (l_separator)
383 Result.append (short_studio_name)
384 Result.append_character (l_separator)
385 Result.append ("spec")
386 Result.append_character (l_separator)
387 Result.append ("$ISE_PLATFORM")
388 Result.append_character (l_separator)
389 Result.append ("lib")
390 Result.append_character (l_separator)
391 Result.append ("EiffelSoftware.Runtime.dll")
392 end
393
394 docking_standard_layout_path: FILE_NAME is
395 -- Path of standard docking layout.
396 local
397 l_dir: DIRECTORY
398 do
399 create Result.make_from_string (eiffel_home)
400 Result.extend_from_array (<<docking_data_name>>)
401
402 create l_dir.make (Result)
403 if not l_dir.exists then
404 l_dir.create_dir
405 if not l_dir.is_closed then
406 l_dir.close
407 end
408 end
409 ensure
410 folder_exist: (create {DIRECTORY}.make (Result)).exists
411 end
412
413 feature -- Access: command name
414
415 Freeze_command_name: FILE_NAME is
416 once
417 create Result.make_from_string (Eiffel_installation_dir_name)
418 Result.extend_from_array (<<short_studio_name, "spec", Eiffel_platform, "bin">>)
419 Result.set_file_name (Platform_constants.Finish_freezing_script)
420 end
421
422 Prelink_command_name: FILE_NAME is
423 once
424 create Result.make_from_string (Eiffel_installation_dir_name)
425 Result.extend_from_array (<<short_studio_name, "spec", Eiffel_platform, "bin">>)
426 Result.set_file_name (Prelink_script)
427 end
428
429 ec_command_name: FILE_NAME is
430 -- Complete path to `estudio'.
431 once
432 create Result.make_from_string (Eiffel_installation_dir_name)
433 Result.extend_from_array (<<short_studio_name, "spec", Eiffel_platform, "bin">>)
434 Result.set_file_name ("ec")
435 end
436
437 Estudio_command_name: FILE_NAME is
438 -- Complete path to `estudio'.
439 once
440 create Result.make_from_string (Eiffel_installation_dir_name)
441 Result.extend_from_array (<<short_studio_name, "spec", Eiffel_platform, "bin">>)
442 Result.set_file_name ("estudio")
443 end
444
445 feature -- Status
446
447 has_borland: BOOLEAN is
448 -- Is Borland C++ back-end C compiler?
449 once
450 Result := Platform_constants.is_windows and then Eiffel_c_compiler.is_equal ("bcb")
451 end
452
453 feature -- Version limitation
454
455 has_case: BOOLEAN is True
456 -- Does this version have the diagram tool?
457
458 has_metrics: BOOLEAN is True
459 -- Does this version have the metrics?
460
461 has_profiler: BOOLEAN is True
462 -- Does this version have the profiler?
463
464 has_documentation_generation: BOOLEAN is True
465 -- Does this version have the documentation generation?
466
467 has_xmi_generation: BOOLEAN is True
468 -- Does this version have the XMI generation?
469
470 has_dll_generation: BOOLEAN is True
471 -- Does this version have the DLL generation?
472
473 has_signable_generation: BOOLEAN is True;
474 -- Does this version allow the signing of .NET assemblies
475
476 feature -- Constants
477
478 ise_library_env: STRING is "ISE_LIBRARY"
479 -- Name of the ISE_LIBRARY environment variable.
480
481 library_directory_name: STRING is "library";
482 -- Name of the library directory.
483
484 indexing
485 copyright: "Copyright (c) 1984-2006, Eiffel Software"
486 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
487 licensing_options: "http://www.eiffel.com/licensing"
488 copying: "[
489 This file is part of Eiffel Software's Eiffel Development Environment.
490
491 Eiffel Software's Eiffel Development Environment is free
492 software; you can redistribute it and/or modify it under
493 the terms of the GNU General Public License as published
494 by the Free Software Foundation, version 2 of the License
495 (available at the URL listed under "license" above).
496
497 Eiffel Software's Eiffel Development Environment is
498 distributed in the hope that it will be useful, but
499 WITHOUT ANY WARRANTY; without even the implied warranty
500 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
501 See the GNU General Public License for more details.
502
503 You should have received a copy of the GNU General Public
504 License along with Eiffel Software's Eiffel Development
505 Environment; if not, write to the Free Software Foundation,
506 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
507 ]"
508 source: "[
509 Eiffel Software
510 356 Storke Road, Goleta, CA 93117 USA
511 Telephone 805-685-1006, Fax 805-685-6869
512 Website http://www.eiffel.com
513 Customer support http://support.eiffel.com
514 ]"
515
516 end -- class EIFFEL_ENV

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.23