Difference between revisions of "Configuration"

(Added link to new ProjectFiles page)
(Settings)
 
(17 intermediate revisions by 3 users not shown)
Line 2: Line 2:
 
[[Category:Compiler]]
 
[[Category:Compiler]]
 
[[Category:Configuration]]
 
[[Category:Configuration]]
== General ideas ==
+
== General ==
* as much as possible independant from the system (windows/unix)
+
* independent from the platform (windows/unix/.NET) [conditions]
* one file with multiple configurations (eg. debug, release build)
+
* one file with multiple configurations (e.g. debug, release build) [targets]
* include/exclude as regexp pattern
+
* exclude as regexp pattern [file patterns]
* global ignore patterns (eg. cvs/svn)
+
* global ignore patterns (e.g. cvs/svn) [file patterns on targets]
* include other configuration files (eg. to add a library just include the config file of the library)
+
* libraries [library group]
* relative paths
+
* relative paths [paths relative to ecf file location]
* actions before/after run/compile (eg. start a server)
+
* actions before/after run/compile (e.g. start a server) [pre-/postcompile actions/tasks]
 
+
* variables [used in locations and for custom conditions] (see also [[ConfigurationVariables]] for predefined variables)
=== Things to implement ideas ===
+
* conditions (if windows then ... elseif unix then ... end)
+
* variables (user and predefined)
+
* inheritance of configuration
+
 
+
=== Other ===
+
* convert old ace files into new format
+
* *.epr vs *.ace
+
* [[ProjectFiles]]
+
 
+
== Possible implementation layout ==
+
 
+
Some more information are available here: http://www.ise/tools/public_zone/index.php?op=dl&path=/home/patrickr/public_html/Public/project_configuration.pdf (Part with two config files has changed to only one config file.)
+
 
+
[[Image:Configuration1.jpg]]
+
  
 
A system consists of multiple targets. A target can extend another target. A target can have some libraries, assemblies, clusters and override clusters.
 
A system consists of multiple targets. A target can extend another target. A target can have some libraries, assemblies, clusters and override clusters.
 
A library has an associated target. A cluster can have a parent cluster. An override cluster has a some groups it overrides.
 
A library has an associated target. A cluster can have a parent cluster. An override cluster has a some groups it overrides.
  
<code>[eiffel, N]
+
===Libraries===
indexing
+
A library specification includes needed clusters, assemblies, libraries, externals and tasks. If a library is included in a project only classes in not hidden clusters can be accessed from this project because everything else is considered a dependency of the library and not content of the library itself.
description: "The configuration system."
+
More information about libraries can be found on the [[Libraries]] page.
date: "$Date$"
+
revision: "$Revision$"
+
 
+
class
+
CONF_SYSTEM
+
 
+
feature
+
 
+
name: STRING
+
-- Name of the system.
+
 
+
uuid: STRING
+
-- UUID of this system. Used to uniquely identify libraries.
+
 
+
targets: LIST [CONF_TARGET]
+
-- The configuration targets.
+
 
+
library_target: CONF_TARGET
+
-- The target to use if this is used as a library.
+
+
compileable_targets: LIST [CONF_TARGET]
+
-- Targets that can be compiled (e.g. have a root feature).
+
end
+
</code>
+
 
+
<code>[eiffel, N]
+
indexing
+
description: "A configuration target."
+
date: "$Date$"
+
revision: "$Revision$"
+
 
+
class
+
CONF_TARGET
+
 
+
feature
+
 
+
name: STRING
+
-- Name of the target.
+
 
+
version: CONF_VERSION
+
-- Version number of the target.
+
 
+
extends: CONF_TARGET
+
-- If we extend another target, this is the other target.
+
 
+
libraries: LIST [CONF_LIBRARY]
+
-- The used libraries.
+
 
+
overrides: LIST [CONF_OVERRIDE]
+
-- The override clusters.
+
 
+
clusters: LIST [CONF_CLUSTER]
+
-- The normal clusters.
+
+
assemblies: LIST [CONF_ASSEMBLY]
+
-- The assemblies.
+
 
+
root: CONF_ROOT
+
-- The root feature.
+
 
+
options: CONF_OPTIONS
+
-- The options (assertions, debugs, warnings, ...)
+
 
+
file_rule: CONF_FILE_RULE
+
-- Globally exclude/include file rules.
+
 
+
external_include: LIST [CONF_EXTERNAL_INCLUDE]
+
-- Global external include files.
+
 
+
external_objec: LIST [CONF_EXTERNAL_OBJECT]
+
-- Global external object files.
+
 
+
external_ressource: LIST [CONF_EXTERNAL_RESSOURCE]
+
-- Global external ressource files.
+
 
+
pre_compile: LIST [CONF_ACTION]
+
-- Actions to be executed before compilation.
+
 
+
post_action: LIST [CONF_ACTION]
+
-- Actions to be executed after compilation.
+
 
+
variables: LIST [CONF_VARIABLE]
+
-- User defined variables.
+
end
+
</code>
+
 
+
<code>[eiffel, N]
+
indexing
+
description: "Base class for configuration groups."
+
date: "$Date$"
+
revision: "$Revision$"
+
 
+
class
+
CONF_GROUP
+
 
+
inherit
+
CONF_CONDITIONED
+
 
+
feature
+
 
+
name: STRING
+
-- The name of the group.
+
 
+
directory: CONF_DIRECTORY
+
-- The directory of the group.
+
 
+
options: CONF_OPTIONS
+
-- The options (assertions, debugs, warnings, ...)
+
 
+
name_prefix: STRING
+
-- An optional name prefix for this group.
+
 
+
renaming: HASH_TABLE [STRING, STRING]
+
-- Mapping of renamed classes from the old name to the new name.
+
 
+
class_options: HASH_TABLE [CONF_OPTION, STRING
+
-- Classes with specific options.
+
 
+
end
+
</code>
+
 
+
<code>[eiffel, N]
+
indexing
+
description: "A library."
+
date: "$Date$"
+
revision: "$Revision$"
+
 
+
class
+
CONF_LIBRARY
+
 
+
inherit
+
CONF_GROUP
+
 
+
feature
+
 
+
library_target: CONF_TARGET
+
-- The library target.
+
 
+
end
+
</code>
+
 
+
<code>[eiffel, N]
+
indexing
+
description: "A project cluster."
+
date: "$Date$"
+
revision: "$Revision$"
+
 
+
class
+
CONF_CLUSTER
+
 
+
inherit
+
CONF_GROUP
+
 
+
feature
+
is_recursive: BOOLEAN
+
-- Are subdirectories included recursively?
+
 
+
parent: CONF_CLUSTER
+
-- An optional parent cluster.
+
 
+
dependencies: LIST [CONF_GROUP]
+
-- Dependencies to other groups.
+
 
+
file_rule: CONF_FILE_RULE
+
-- Globally exclude/include file rules.
+
 
+
is_visible (a_feature, a_class: STRING): BOOLEAN
+
-- Is a feature of this cluster visible?
+
end
+
</code>
+
<code>[eiffel, N]
+
indexing
+
description: "Clusters that override other groups."
+
date: "$Date$"
+
revision: "$Revision$"
+
 
+
class
+
CONF_OVERRIDE
+
 
+
inherit
+
CONF_CLUSTER
+
 
+
feature
+
 
+
override: LIST [CONF_GROUP]
+
-- The groups that this cluster overrides.
+
 
+
end
+
</code>
+
 
+
CONF_CONDITIONED is a class that allows to specify for which platform, build tuple something is enabled. Conditioned are: CONF_ACTION (pre-/postcompile actions), CONF_EXTERNAL_(INCLUDE|OBJECT|RESSOURCE), CONF_GROUP
+
 
+
== Pseudocode example configuration ==
+
files/eiffelvision/eiffelvision.ace
+
<pre>
+
system EiffelVision
+
 
+
target Library
+
    version 2.0.0.1
+
    uuid 15ac36b5-2c65-41e9-8309-c504dd430a0b
+
 
+
    library base
+
        files/base/base.ace
+
 
+
    cluster vision
+
        files/vision
+
        recursive
+
        uses base
+
   
+
    external_include
+
        files/include/common.h [(all, all)]
+
        files/include/windows.h [(windows, all)]
+
        files/include/gtk [(unix, all)]
+
 
+
    external_objects
+
        files/obj/windows.o [(windows, all)]
+
        files/obj/gtk.o [(unix, all)]
+
        files/obj/debug.o [(unix, workbench)]
+
 
+
target Debug extends Library
+
 
+
    cluster debug
+
        files/debug
+
        recursive
+
        uses base, vision
+
 
+
    root debug:ROOT_CLASS:make
+
 
+
</pre>
+
 
+
files/eiffelstudio/eiffelstudio.ace
+
<pre>
+
system EiffelStudio
+
    version 5.0.0.1
+
    uuid 9a8d3871-ef44-484c-9029-c52d17df40f0
+
 
+
target Common
+
 
+
    variable gobo_setting="some settings"
+
 
+
    exclude
+
        ^\.svn$
+
 
+
    library base
+
        files/base/base.ace
+
 
+
    library gobo
+
        files/gobo/gobo.ace
+
        rename "some_class" as "new_class"
+
        prefix "gobo_"
+
 
+
    cluster compiler
+
        files/compiler
+
            uses base, gobo
+
 
+
    root compiler:ROOT_CLASS:make
+
 
+
target Console extends Common
+
 
+
    cluster console
+
        files/console
+
            uses base, gobo, compiler
+
 
+
    cluster mysub (console)
+
        $/mysub
+
 
+
target Workbench extends Common
+
 
+
    library eiffelvision
+
        files/eiffelvision/eiffelvision.ace
+
 
+
    cluster workbench
+
        files/workbench
+
            uses base, gobo, eiffelvision, compiler
+
</pre>
+
 
+
== Questions and Problems ==
+
 
+
*Specify use of other clusters? '''Yes'''
+
*Variables? '''If not defined, take environment variable.'''
+
*Path relative to ace file? '''Yes'''
+
*When are two libraries the same? '''UUID: http://www.famkruithof.net/guid-uuid-random.html'''
+
=== Multiple library usage ===
+
====Problem====
+
<pre>
+
System Application
+
 
+
library A
+
library B
+
</pre>
+
<pre>
+
System A
+
 
+
library C
+
    option Yes
+
</pre>
+
<pre>
+
System B
+
 
+
library C
+
    option No
+
</pre>
+
We have a conflict for the option on library C.
+
  
====Solution====
+
===Overrides===
If the library is directly used in Application, use the this options, otherwise use the options of the Application system.
+
It is possible to specify override clusters in a project (but not in a library). Classes in there with the same name as classes in other clusters/libraries will override those other classes. That means they will replace the implementation of the other class.
  
 
===File pattern===
 
===File pattern===
The file pattern match against the relative path in unix format in a cluster.
+
The file pattern match against the relative path in Unix format in a cluster.
 
e.g. if the cluster is in C:\mycluster
 
e.g. if the cluster is in C:\mycluster
  
Line 389: Line 71:
 
</table>
 
</table>
  
== Configuration file format ==
+
=== Settings ===
[[ConfigurationFileFormat|Configuration file format page]]
+
{| border=1
 
+
! Name !! Description !! Value range !! Default value
== Migration ==
+
|-
[[ConfigurationMigration|Configuration migration]]
+
| address_expression || Are simplified address expressions enabled? || true/false || false
 
+
|-
== Degree 6 ==
+
| array_optimization || unused || true/false ||
[[ConfigurationDegree6|Configuration degree 6]]
+
|-
 
+
| automatic_backup || Automatically generate a backup during recompilation? || true/false || false
== Ideas for better conditions ==
+
|-
[[ConfigurationConditions|Configuration conditions]]
+
| check_generic_creation_constraint || Check generic creation constraint? || true/false || true
 +
|-
 +
| check_vape || Enforce VAPE validity constraint? || true/false || true
 +
|-
 +
| console_application || Is the project a console application? || true/false || false
 +
|-
 +
| force_32bits || Force compilation for 32bits? (.NET only) || true/false || false
 +
|-
 +
| cls_compliant || Should generated assemblies be marked as CLS compliant? || true/false || true
 +
|-
 +
| dead_code_removal || Should unused code be removed? || true/false || true
 +
|-
 +
| dotnet_naming_convention || Should names follow the .NET naming convention? || true/false || false
 +
|-
 +
| dynamic_runtime || Should the generated executable use a shared library of the runtime? || true/false || false
 +
|-
 +
| enforce_unique_class_names || Should class names be unique even in libraries? || true/false || false
 +
|-
 +
| exception_trace || Should a complete exception trace be generated in the finalized version? || true/false || false
 +
|-
 +
| executable_name || Name of the generated binary. || configuration string || use system name
 +
|-
 +
| full_type_checking || Full type checking? || true/false || false
 +
|-
 +
| il_verifiable || Should the generated binary be IL verifiable? || true/false || true
 +
|-
 +
| inlining || Should inlining be enabled? || true/false || true
 +
|-
 +
| inlining_size || Maximal number of instructions in a feature for the feature to be inlined. || integer 0..100 || 0
 +
|-
 +
| java_generation || unused || true/false ||
 +
|-
 +
| library_root || Absolute path to use as base for relative paths. || path || location of the ecf file
 +
|-
 +
| line_generation || Generate extra information for external debuggers? || true/false || false
 +
|-
 +
| metadata_cache_path || Location where information about external assemblies is stored. || path || $ISE_EIFFEL\dotnet\assemblies
 +
|-
 +
| msil_assembly_compatibility || unused || true/false ||
 +
|-
 +
| msil_classes_per_module || Number of classes generated per .NET module during incremental compilation. Increasing this value will slow down the incremental recompilation, but speed up the time to load the assembly while debugging in workbench mode. || integer > 0 || 5
 +
|-
 +
| msil_clr_version || Version of the .NET runtime to use. || installed .NET version || highest installed .NET version
 +
|-
 +
| msil_culture || MSIL culture || string ||
 +
|-
 +
| msil_generation || Generate .NET code? || true/false || false
 +
|-
 +
| msil_generation_type || Type of binary to generate. || exe/dll || exe
 +
|-
 +
| msil_key_file_name || Key to be able to add the generated binary to the Global Assembly Cache (GAC). || file ||
 +
|-
 +
| msil_use_optimized_precompile || Use an optimized version of a precompile? || true/false || false
 +
|-
 +
| multithreaded || Generate a multithreaded application? || true/false || false
 +
|-
 +
| old_verbatim_strings || Use the old format for verbatim strings? || true/false || false
 +
|-
 +
| platform || Override the detected platform to use in conditions. || valid platform as in conditions || detected platform
 +
|-
 +
| external_runtime || External runtime || file ||
 +
|-
 +
| shared_library_definition || Specify the file the compiler uses to generate the exported functions. || file ||
 +
|-
 +
| use_cluster_name_as_namespace || Should cluster names be used as namespaces?  || true/false || true
 +
|-
 +
| use_all_cluster_name_as_namespace || Should names of folders in recursive clusters be used as namespaces? || true/false || true
 +
|}

Latest revision as of 11:54, 30 October 2006

General

  • independent from the platform (windows/unix/.NET) [conditions]
  • one file with multiple configurations (e.g. debug, release build) [targets]
  • exclude as regexp pattern [file patterns]
  • global ignore patterns (e.g. cvs/svn) [file patterns on targets]
  • libraries [library group]
  • relative paths [paths relative to ecf file location]
  • actions before/after run/compile (e.g. start a server) [pre-/postcompile actions/tasks]
  • variables [used in locations and for custom conditions] (see also ConfigurationVariables for predefined variables)

A system consists of multiple targets. A target can extend another target. A target can have some libraries, assemblies, clusters and override clusters. A library has an associated target. A cluster can have a parent cluster. An override cluster has a some groups it overrides.

Libraries

A library specification includes needed clusters, assemblies, libraries, externals and tasks. If a library is included in a project only classes in not hidden clusters can be accessed from this project because everything else is considered a dependency of the library and not content of the library itself. More information about libraries can be found on the Libraries page.

Overrides

It is possible to specify override clusters in a project (but not in a library). Classes in there with the same name as classes in other clusters/libraries will override those other classes. That means they will replace the implementation of the other class.

File pattern

The file pattern match against the relative path in Unix format in a cluster. e.g. if the cluster is in C:\mycluster

Pattern Matches

storage/table

   C:\mycluster\storage\table\*
   C:\mycluster\storage\table.e
   C:\mycluster\something\storage\table\*

^/storage/table/

   C:\mycluster\storage\table\*

^/.*/test/

   C:\mycluster\a\test\*
   C:\mycluster\b\test\*

/test/

   C:\mycluster\a\test\*
   C:\mycluster\b\test\*
   C:\mycluster\something\table\test\*

Settings

Name Description Value range Default value
address_expression Are simplified address expressions enabled? true/false false
array_optimization unused true/false
automatic_backup Automatically generate a backup during recompilation? true/false false
check_generic_creation_constraint Check generic creation constraint? true/false true
check_vape Enforce VAPE validity constraint? true/false true
console_application Is the project a console application? true/false false
force_32bits Force compilation for 32bits? (.NET only) true/false false
cls_compliant Should generated assemblies be marked as CLS compliant? true/false true
dead_code_removal Should unused code be removed? true/false true
dotnet_naming_convention Should names follow the .NET naming convention? true/false false
dynamic_runtime Should the generated executable use a shared library of the runtime? true/false false
enforce_unique_class_names Should class names be unique even in libraries? true/false false
exception_trace Should a complete exception trace be generated in the finalized version? true/false false
executable_name Name of the generated binary. configuration string use system name
full_type_checking Full type checking? true/false false
il_verifiable Should the generated binary be IL verifiable? true/false true
inlining Should inlining be enabled? true/false true
inlining_size Maximal number of instructions in a feature for the feature to be inlined. integer 0..100 0
java_generation unused true/false
library_root Absolute path to use as base for relative paths. path location of the ecf file
line_generation Generate extra information for external debuggers? true/false false
metadata_cache_path Location where information about external assemblies is stored. path $ISE_EIFFEL\dotnet\assemblies
msil_assembly_compatibility unused true/false
msil_classes_per_module Number of classes generated per .NET module during incremental compilation. Increasing this value will slow down the incremental recompilation, but speed up the time to load the assembly while debugging in workbench mode. integer > 0 5
msil_clr_version Version of the .NET runtime to use. installed .NET version highest installed .NET version
msil_culture MSIL culture string
msil_generation Generate .NET code? true/false false
msil_generation_type Type of binary to generate. exe/dll exe
msil_key_file_name Key to be able to add the generated binary to the Global Assembly Cache (GAC). file
msil_use_optimized_precompile Use an optimized version of a precompile? true/false false
multithreaded Generate a multithreaded application? true/false false
old_verbatim_strings Use the old format for verbatim strings? true/false false
platform Override the detected platform to use in conditions. valid platform as in conditions detected platform
external_runtime External runtime file
shared_library_definition Specify the file the compiler uses to generate the exported functions. file
use_cluster_name_as_namespace Should cluster names be used as namespaces? true/false true
use_all_cluster_name_as_namespace Should names of folders in recursive clusters be used as namespaces? true/false true