wx.Build.AlternativeBuildActions Class Reference

Inheritance diagram for wx.Build.AlternativeBuildActions:

Inheritance graph

List of all members.

Public Member Functions

 AlternativeBuildActions (string name, IBuildProduct target, CollectionOfBuildActions alternatives)
 AlternativeBuildActions (IBuildProduct target, CollectionOfBuildActions alternatives)
void AppendBooCode (List< string > booCodeLines, string indention, BuildToolFamilyEnv env)
void CollectChoicePoints (IDictionary< string, ICollection< string >> collectionOfChoicePoints)
bool ContainsPrerequisite (IBuildProduct prereq)
bool Execute (BuildToolFamilyEnv env, DateTime validityOfBuildSystem)
ICollection
< IBuildProduct
GetPrerequisites ()
System.Diagnostics.ProcessStartInfo GetProgramStartInfo (BuildToolFamilyEnv env)
ICollection
< RefToProject
GetProjects ()
ICollection
< IBuildProduct
GetTargets ()
DateTime GetValidity ()
DateTime GetValidityDemand ()
virtual bool TargetsAreConsistent (DateTime validityOfBuildSystem)

Properties

IBuildActionProvider ActionProvider [get]
CollectionOfBuildActions Alternatives [get]
FeatureList Features [get]
string Name [get]
int NoOfInstance [get]
ICollection< Type > ParameterTypes [get]
ActionPriority Priority [get]
BuildProject Project [get, set]
IBuildProduct Target [get]
IDictionary< string,
EnvironmentVarInfo
UsedVars [get]


Detailed Description

This class represents a collection of alternative build actions. Executing this collections means: Executing one of the mostly preferred actions. However, if this action fails at runtime, one of the next preferred actions will be tried. You may associate this alternative with a name. This serves as a hint in user guided building system. In such implementations of the build process, the user will be confronted with the name and a description of the avilable alternatives and asked for a decision. Alternatives without a name will not offer interactive services.

Constructor & Destructor Documentation

wx.Build.AlternativeBuildActions.AlternativeBuildActions ( IBuildProduct  target,
CollectionOfBuildActions  alternatives 
)

Creates an instance containing those actions in alternatives achieving target but without a name. Thus, interactive services cannot be provided.

Parameters:
target The target that will be achieved by each of the contained actions. Some actions my achieve additional or more spevific targets. But this target will be achieved by all contained alternative actions.
alternatives A collection of alternative actions sorted by priority. Please note, that instances of NamedAction will be used to associate an alternative with a name.

wx.Build.AlternativeBuildActions.AlternativeBuildActions ( string  name,
IBuildProduct  target,
CollectionOfBuildActions  alternatives 
)

Creates an instance containing those actions in alternatives achieving target .

Parameters:
name This shall be a spelling name designating the choice among the available alternatives. For instance, a C/C++ project supporting various compilers and linkers may produce alternatives for each supported compiler/linker. The choice among this alternatives could be something like "CCppCompiler". Different alternatives may share the same name. However, in that case the alternatives should be named consistently (refer to NamedAction). This property is currently used e.g. to produce BOO code.
target The target that will be achieved by each of the contained actions. Some actions my achieve additional or more spevific targets. But this target will be achieved by all contained alternative actions.
alternatives A collection of alternative actions sorted by priority. Please note, that instances of NamedAction will be used to associate an alternative with a name.


Member Function Documentation

void wx.Build.AlternativeBuildActions.AppendBooCode ( List< string >  booCodeLines,
string  indention,
BuildToolFamilyEnv  env 
)

This method will create BOO source code and append this code to the provided text writer.

Parameters:
env This is an environment that different tools of the same family may use to exchange information. This store is typically used to save information on configuration files or thinsgs of that kind that will be shared among all tools of the same family.
booCodeLines The code that will actually build something. Each list entry will be a line of code in the resulting BOO program.
indention A string that shall preceed all created lines.
Refer to IBuildActionProvider.AppendToBooPreamble() for an example.

This implementation will only provide

Exceptions:
NotSupportedException Will be thrown if this feature is not supported.

Implements wx.Build.IBuildAction.

void wx.Build.AlternativeBuildActions.CollectChoicePoints ( IDictionary< string, ICollection< string >>  collectionOfChoicePoints  ) 

This method collects all choice points within this action. Choice points are represented by a name and a collection of alternatives.

Parameters:
collectionOfChoicePoints The collection that will be extended by the choice points of this action.
The current implementation provides a choice point for the compilation and linking of C/C++ programs, "CppDevelopmentSystem" of the alternatives "GCC" and "MS VC". Thus, actions on C/C++ compilation will add the following choice point:
            if (!collectionOfChoicePoints.ContainsKey("CppDevelopmentSystem"))
                collectionOfChoicePoints.Add("CppDevelopmentSystem", new List&lt;string&gt;());
            collectionOfChoicePoints["CppDevelopmentSystem"].Add("GCC");
            collectionOfChoicePoints["CppDevelopmentSystem"].Add("MS VC");

Implements wx.Build.IBuildAction.

bool wx.Build.AlternativeBuildActions.ContainsPrerequisite ( IBuildProduct  prereq  ) 

True iff prereq is among the GetPrerequisites().

Implements wx.Build.IBuildAction.

bool wx.Build.AlternativeBuildActions.Execute ( BuildToolFamilyEnv  env,
DateTime  validityOfBuildSystem 
)

Execute the actions in the order of their priority and stop after first success. On rebuiding test whether targets are consistent. Do nothing, if consistent.

Implements wx.Build.IBuildAction.

ICollection<IBuildProduct> wx.Build.AlternativeBuildActions.GetPrerequisites (  ) 

Collection of all prerequisites of all contained actions. Note: Do not use this on rebuild to determine whether to start this or not. You may omit this on rebuild of the target is consistent with the prerequisite of at least ONE contained action, not ALL. TargetsAreConsistent() observes this.

Implements wx.Build.IBuildAction.

System.Diagnostics.ProcessStartInfo wx.Build.AlternativeBuildActions.GetProgramStartInfo ( BuildToolFamilyEnv  env  ) 

Returns null since this will not use the process class on execution.

Implements wx.Build.IBuildAction.

ICollection<RefToProject> wx.Build.AlternativeBuildActions.GetProjects (  ) 

This returns null because this does not imply build projects.

ICollection<IBuildProduct> wx.Build.AlternativeBuildActions.GetTargets (  ) 

This returns only the target passed to the CTor. All other targets are considered to be optional. They may be achieved if the corresponding action is taken. They may be missed on choosing different alternatives.

Implements wx.Build.IBuildAction.

DateTime wx.Build.AlternativeBuildActions.GetValidity (  ) 

The latest validity of a contained action.

Implements wx.Build.IBuildObject.

DateTime wx.Build.AlternativeBuildActions.GetValidityDemand (  ) 

The latest validity of a contained action.

Implements wx.Build.IBuildObject.

virtual bool wx.Build.AlternativeBuildActions.TargetsAreConsistent ( DateTime  validityOfBuildSystem  )  [virtual]

This returns true if at least one contained action is consistent.

Parameters:
validityOfBuildSystem indicates the last change of either this DLL or the assembly defining the project. So, all action will be repeated (even if rebuild is specified) if the project definition changes or the implementation of the build system has been enhanced since the final build. This argument will be computed and propagated by the project.

Implements wx.Build.IBuildAction.


Property Documentation

IBuildActionProvider wx.Build.AlternativeBuildActions.ActionProvider [get]

The class that created this action. This is often the action itself.

Implements wx.Build.IBuildAction.

CollectionOfBuildActions wx.Build.AlternativeBuildActions.Alternatives [get]

The collection of alternative actions that may be used to achieve the target.

FeatureList wx.Build.AlternativeBuildActions.Features [get]

All features of a contained action.

Implements wx.Build.IBuildAction.

string wx.Build.AlternativeBuildActions.Name [get]

This shall be a spelling name designating the choice among the available alternatives. For instance, a C/C++ project supporting various compilers and linkers may produce alternatives for each supported compiler/linker. The choice among this alternatives could be something like "CCppCompiler". Different alternatives may share the same name. However, in that case the alternatives should be named consistently (refer to NamedAction). This property is currently used e.g. to produce BOO code.

This can be empty of this alternative is not named.

Implements wx.Build.IBuildAction.

int wx.Build.AlternativeBuildActions.NoOfInstance [get]

Index of the instance. This will be used to create unique name. This will NOT be used to determine whether 2 actions are equivalent.

ICollection<Type> wx.Build.AlternativeBuildActions.ParameterTypes [get]

Returns a collection (typically an array) of relevant parameter types in the BuildConfig. This may be empty or null if instances of this class do not refer to parameter types.

Implements wx.Build.IBuildAction.

ActionPriority wx.Build.AlternativeBuildActions.Priority [get]

This returns the most important included priority.

Implements wx.Build.IBuildAction.

BuildProject wx.Build.AlternativeBuildActions.Project [get, set]

This will read the project from the alternatives. The setter is a NOP.

Implements wx.Build.IBuildAction.

IBuildProduct wx.Build.AlternativeBuildActions.Target [get]

The only target of this combined action.

IDictionary<string, EnvironmentVarInfo> wx.Build.AlternativeBuildActions.UsedVars [get]

All variables used by at least one contained action. If a variable is mandatory for one action but not required by another, the result will state that the variable is not required.

Implements wx.Build.IBuildAction.


The wx.NET Build System.   (c) 2009-2010 Harald Meyer auf'm Hofe