Configuration

Revision as of 14:04, 17 April 2006 by Manus (Talk | contribs)

General ideas

  • as much as possible independant from the system (windows/unix)
  • one file with multiple configurations (eg. debug, release build)
  • include/exclude as regexp pattern
  • global ignore patterns (eg. cvs/svn)
  • include other configuration files (eg. to add a library just include the config file of the library)
  • relative paths
  • actions before/after run/compile (eg. start a server)

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

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.)

File: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 library has an associated target. A cluster can have a parent cluster. An override cluster has a some groups it overrides.

indexing
	description: "The configuration system."
	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
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
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
indexing
	description: "A library."
	date: "$Date$"
	revision: "$Revision$"
 
class
	CONF_LIBRARY
 
inherit
	CONF_GROUP
 
feature
 
	library_target: CONF_TARGET
			-- The library target.
 
end
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
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

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

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

files/eiffelstudio/eiffelstudio.ace

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

Questions and Problems

Multiple library usage

Problem

System Application

library A
library B
System A

library C
    option Yes
System B

library C
    option No

We have a conflict for the option on library C.

Solution

If the library is directly used in Application, use the this options, otherwise use the options of the Application system.

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\*

Configuration file format

Configuration file format page

Migration

Configuration migration

Degree 6

Configuration degree 6

Ideas for better conditions

Configuration conditions