wx.Build.BaseAction Class Reference

Inheritance diagram for wx.Build.BaseAction:

Inheritance graph

List of all members.

Public Member Functions

delegate void AdderSerializable (System.Xml.Serialization.IXmlSerializable arg)
virtual void AppendBooCode (List< string > booCodeLines, string indention, BuildToolFamilyEnv env)
virtual void AppendToBooPreamble (BuildToolFamilyEnv env, List< string > importModules, List< string > booDeclarations, List< string > booDefinitions)
bool AreAllMandatoryVarsDefined ()
void CollectChoicePoints (IDictionary< string, ICollection< string >> collectionOfChoicePoints)
virtual bool ContainsPrerequisite (IBuildProduct prereq)
abstract ICollection
< IBuildProduct
GetPrerequisites ()
virtual
System.Diagnostics.ProcessStartInfo 
GetProgramStartInfo (BuildToolFamilyEnv env)
abstract ICollection
< IBuildProduct
GetTargets ()
virtual DateTime GetValidity ()
virtual DateTime GetValidityDemand ()
DateTime GetValidityTargets ()
virtual bool TargetsAreConsistent (DateTime validityOfBuildSystem)

Static Public Member Functions

static bool ReadCollection (System.Xml.XmlReader reader, AdderSerializable collectorForResults, string outerElementName, string innerElementName)
static
System.Xml.Serialization.IXmlSerializable 
ReadSerializable (System.Xml.XmlReader reader, string elementName)
static void WriteCollectionOfSerializables (System.Xml.XmlWriter writer, System.Collections.IEnumerable serializables, string outerElementName, string innerElementName)
static void WriteSerializable (System.Xml.XmlWriter writer, System.Xml.Serialization.IXmlSerializable obj, string elementName)

Protected Member Functions

void ReadProject (System.Xml.XmlReader reader)
void WriteProject (System.Xml.XmlWriter writer)

Properties

virtual FeatureList Features [get]
virtual ICollection
< Type > 
ParameterTypes [get]
BuildProject Project [get, set]
virtual IDictionary
< string,
EnvironmentVarInfo
UsedVars [get]


Detailed Description

Some helpers that may be useful implementing wx.Build.IBuildAction.

Member Function Documentation

delegate void wx.Build.BaseAction.AdderSerializable ( System.Xml.Serialization.IXmlSerializable  arg  ) 

Will be called in ReadCollection() if a new object has been found.

Parameters:
arg The object that has been found.

virtual void wx.Build.BaseAction.AppendBooCode ( List< string >  booCodeLines,
string  indention,
BuildToolFamilyEnv  env 
) [virtual]

This implementation will look for a program start info that implements this actions. If program start info is null, this implementation will raise an exception. Overload this if you have to create another implementation providing this feature.

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 will be appended to this writer.
indention A string that shall preceed all created lines.
Exceptions:
NotSupportedException Will be thrown if this feature is not supported.
See also:
GetProgrammStartInfo

Reimplemented in wx.Build.FileTestAction, wx.Build.Cxx.GCC.GccAsCompiler, wx.Build.Cxx.GCC.GccAsLinker, wx.Build.Cxx.GCC.WindRes, wx.Build.Mono.Gmcs, wx.Build.MS.Cl, wx.Build.MS.Link, wx.Build.MS.RC, wx.Build.MS.Csc, wx.Build.Release.ReplaceVersionInRCFile, and wx.Build.Release.CopyFileAction.

virtual void wx.Build.BaseAction.AppendToBooPreamble ( BuildToolFamilyEnv  env,
List< string >  importModules,
List< string >  booDeclarations,
List< string >  booDefinitions 
) [virtual]

This will be called for any action provider before IBuildAction.AppendBooCode() is called. This provides action providers with the opportunity to import modules and create variables for global options.

Parameters:
importModules List of modules that shall be imported. Add required modules here. Each module will be imported exactly once (even if it occurs more than once in the list).
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.
A typical use is the import of modules that will be used in the later BOO code that builds the project.
            void AppendToBooPreamble(System.IO.TextWriter booCodeLines)
            {
                booCodeLines.Add("import System.Diagnostics");
                booCodeLines.Add("Process=System.Diagnostics.Process");
            }

Reimplemented in wx.Build.Cxx.GCC.GccAsCompiler, wx.Build.Cxx.GCC.GccAsLinker, wx.Build.Cxx.GCC.WindRes, wx.Build.Mono.Gmcs, wx.Build.MS.Cl, wx.Build.MS.Link, wx.Build.MS.RC, and wx.Build.MS.Csc.

bool wx.Build.BaseAction.AreAllMandatoryVarsDefined (  ) 

True iff all mandatory environment variables are defined. The project cannot be made if this is false.

void wx.Build.BaseAction.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");

virtual bool wx.Build.BaseAction.ContainsPrerequisite ( IBuildProduct  prereq  )  [virtual]

True iff prereq is among the GetPrerequisites().

Reimplemented in wx.Build.Net.CSharpAssemblyProject, wx.Build.Net.CSharpCodeProvider, wx.Build.Cxx.GCC.WindRes, wx.Build.Mono.Gmcs, wx.Build.MS.Cl, wx.Build.MS.Link, wx.Build.MS.RC, wx.Build.MS.Csc, and wx.Build.Cxx.wxWidgets.

abstract ICollection<IBuildProduct> wx.Build.BaseAction.GetPrerequisites (  )  [pure virtual]

Collection of the prerequisites of this action.

Implemented in wx.Build.FileTestAction, wx.Build.Net.CSharpAssemblyProject, wx.Build.Cxx.DynamicLibraryProject, wx.Build.Net.CSharpCodeProvider, wx.Build.Cxx.GCC.GccAsCompiler, wx.Build.Cxx.GCC.GccAsLinker, wx.Build.Cxx.GCC.WindRes, wx.Build.Mono.Gmcs, wx.Build.MS.Cl, wx.Build.MS.Link, wx.Build.MS.RC, wx.Build.MS.Csc, wx.Build.MS.Al, wx.Build.Release.MakeReleaseProject, wx.Build.Release.ReplaceVersionInRCFile, wx.Build.Release.ReplaceVersionInCSharpFile, wx.Build.Release.CopyFileAction, and wx.Build.Cxx.wxWidgets.

virtual System.Diagnostics.ProcessStartInfo wx.Build.BaseAction.GetProgramStartInfo ( BuildToolFamilyEnv  env  )  [virtual]

This simply returns null and may serve as standard implementation of those actions that do not use System.Diagnostics.Process.

Reimplemented in wx.Build.Cxx.GCC.GccAsCompiler, wx.Build.Cxx.GCC.GccAsLinker, wx.Build.Cxx.GCC.WindRes, wx.Build.Mono.Gmcs, wx.Build.MS.Cl, wx.Build.MS.Link, wx.Build.MS.RC, and wx.Build.MS.Csc.

abstract ICollection<IBuildProduct> wx.Build.BaseAction.GetTargets (  )  [pure virtual]

Collection of the targets or products of this action.

Implemented in wx.Build.FileTestAction, wx.Build.Net.CSharpAssemblyProject, wx.Build.Cxx.DynamicLibraryProject, wx.Build.Net.CSharpCodeProvider, wx.Build.Cxx.GCC.GccAsCompiler, wx.Build.Cxx.GCC.GccAsLinker, wx.Build.Cxx.GCC.WindRes, wx.Build.Mono.Gmcs, wx.Build.MS.Cl, wx.Build.MS.Link, wx.Build.MS.RC, wx.Build.MS.Csc, wx.Build.MS.Al, wx.Build.Release.MakeReleaseProject, wx.Build.Release.ReplaceVersionInRCFile, wx.Build.Release.ReplaceVersionInCSharpFile, wx.Build.Release.CopyFileAction, and wx.Build.Cxx.wxWidgets.

virtual DateTime wx.Build.BaseAction.GetValidity (  )  [virtual]

This is the timestamp representing how current the prerequisites are. The standard implementation will use be the latest validity of a prerequisite.

Reimplemented in wx.Build.BuildProject, and wx.Build.Cxx.wxWidgets.

virtual DateTime wx.Build.BaseAction.GetValidityDemand (  )  [virtual]

This is the timestamp representing the latest change of a prerequisite. The standard implementation will use be the latest validity of a prerequisite.

Reimplemented in wx.Build.BuildProject, and wx.Build.Cxx.wxWidgets.

DateTime wx.Build.BaseAction.GetValidityTargets (  ) 

This is the earliest validiy of a target.

static bool wx.Build.BaseAction.ReadCollection ( System.Xml.XmlReader  reader,
AdderSerializable  collectorForResults,
string  outerElementName,
string  innerElementName 
) [static]

Reads a collection of serializable objects from the provided XML source.

Parameters:
reader XML source
collectorForResults This will add the created results to this collection.
outerElementName name of the XML element that will embrace all elements.
innerElementName Name of the XML element that contains the information of a single serialized object.
Returns:
True if the outer element name has been found. False if this has not been able to parse a term complying with the expected content.

void wx.Build.BaseAction.ReadProject ( System.Xml.XmlReader  reader  )  [protected]

Reads the features as serialized by WriteFeatures().

Parameters:
reader The source of serialized data

static System.Xml.Serialization.IXmlSerializable wx.Build.BaseAction.ReadSerializable ( System.Xml.XmlReader  reader,
string  elementName 
) [static]

This reads a serilization that has been created by WriteSerializable(). This only works if an instance of the serialized obejct can be created without arguments.

Parameters:
reader The serialization will be read from this source.
elementName Name of the XML element that encapsulates the serialization.
Returns:
The object instance that has been created from the serialized information.
WriteSerializable

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

This simply tests whether the oldest validity of the targets is equal to or more current than the validity of the prerequisites.

Parameters:
validityOfBuildSystem indicates the last change of either this DLL or the assembly defining the project. changes to the build system or the project definition affect of course the validity of the produced targets. Use System.DateTime.MinValue if you do not know or want this to be neglected.

Reimplemented in wx.Build.Cxx.wxWidgets.

static void wx.Build.BaseAction.WriteCollectionOfSerializables ( System.Xml.XmlWriter  writer,
System.Collections.IEnumerable  serializables,
string  outerElementName,
string  innerElementName 
) [static]

Serializes a collection of serializable objects.

Parameters:
writer This method will write the serialization to this destination.
serializables The collection of object to serialize. All objects must implement System.Xml.Serialization.IXmlSerializable.
outerElementName name of the XML element that will embrace all elements.
innerElementName Name of the XML element that contains the information of a single serialized object.

void wx.Build.BaseAction.WriteProject ( System.Xml.XmlWriter  writer  )  [protected]

This will serialize the feature list in an XML element "feature-list".

Parameters:
writer Destination of serialized data.

static void wx.Build.BaseAction.WriteSerializable ( System.Xml.XmlWriter  writer,
System.Xml.Serialization.IXmlSerializable  obj,
string  elementName 
) [static]

Helper to serialize objects of unknown class. This will create an element of the provided element name and attach attributes "assembly" and "type" to this element. These elements will describe the type of the object to serialize. Then, embedded into this new element, the object will be asked to place its serialization.

Parameters:
obj The object that shall be serialized. May be null
elementName Name of the XML element that will be created.
writer The information will be written to this destination.

Use this method to serialize member variables of unknown type like e.g. wx.Build.IFileProducts. Often, projects refer to members where the only known information is: This implements wx.Build.IFileProducts. The project does not need to know more facts with one exception: When deserializing a XML serialization, the project needs to know the exact class because an object instance has to be created. This method will serialize the corresponding information in such a form, that ReadSerializable() can be used to read the written instance.


Property Documentation

virtual FeatureList wx.Build.BaseAction.Features [get]

Returns the features that are associated with this action. This feature list usually comes from the BuildProject that created this action. Overload this for projects!!!

Reimplemented in wx.Build.BuildProject.

virtual ICollection<Type> wx.Build.BaseAction.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. The return value of this implementation is null .

Reimplemented in wx.Build.Mono.Gmcs, wx.Build.MS.Cl, wx.Build.MS.Csc, and wx.Build.Cxx.wxWidgets.

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

The project that requested this action.

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

This returns null since useually shell variables are not used by actions.

Reimplemented in wx.Build.Cxx.GCC.GccAsCompiler, wx.Build.Cxx.GCC.WindRes, wx.Build.MS.Cl, wx.Build.MS.Link, wx.Build.MS.RC, wx.Build.Release.MakeReleaseProject, wx.Build.Release.ReplaceVersionInRCFile, wx.Build.Release.ReplaceVersionInCSharpFile, and wx.Build.Cxx.wxWidgets.


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