From 5e4d6cab00cb29cd088ab7b62ab13aff103b64cb Mon Sep 17 00:00:00 2001 From: onefang Date: Sun, 19 May 2019 21:24:15 +1000 Subject: Dump OpenSim 0.9.0.1 into it's own branch. --- Prebuild/src/Core/Nodes/AuthorNode.cs | 124 +-- Prebuild/src/Core/Nodes/CleanFilesNode.cs | 158 +-- Prebuild/src/Core/Nodes/CleanupNode.cs | 168 +-- Prebuild/src/Core/Nodes/ConfigurationNode.cs | 372 +++---- .../src/Core/Nodes/ConfigurationNodeCollection.cs | 142 +-- Prebuild/src/Core/Nodes/DataNode.cs | 172 +-- Prebuild/src/Core/Nodes/DatabaseProjectNode.cs | 186 ++-- Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs | 126 +-- Prebuild/src/Core/Nodes/DescriptionNode.cs | 124 +-- Prebuild/src/Core/Nodes/ExcludeNode.cs | 78 +- Prebuild/src/Core/Nodes/FileNode.cs | 456 ++++---- Prebuild/src/Core/Nodes/FilesNode.cs | 284 ++--- Prebuild/src/Core/Nodes/MatchNode.cs | 458 ++++---- Prebuild/src/Core/Nodes/OptionsNode.cs | 1178 ++++++++++---------- Prebuild/src/Core/Nodes/ProcessNode.cs | 166 +-- Prebuild/src/Core/Nodes/ProjectNode.cs | 1024 ++++++++--------- Prebuild/src/Core/Nodes/ReferenceNode.cs | 218 ++-- Prebuild/src/Core/Nodes/ReferencePathNode.cs | 124 +-- Prebuild/src/Core/Nodes/SolutionNode.cs | 516 ++++----- 19 files changed, 3037 insertions(+), 3037 deletions(-) (limited to 'Prebuild/src/Core/Nodes') diff --git a/Prebuild/src/Core/Nodes/AuthorNode.cs b/Prebuild/src/Core/Nodes/AuthorNode.cs index 4c415bb..e4b024f 100644 --- a/Prebuild/src/Core/Nodes/AuthorNode.cs +++ b/Prebuild/src/Core/Nodes/AuthorNode.cs @@ -5,16 +5,16 @@ Copyright (c) 2007 C.J. Adams-Collier (cjac@colliertech.org) Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -* Redistributions of source code must retain the above copyright notice, this list of conditions - and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright notice, this list of conditions - and the following disclaimer in the documentation and/or other materials provided with the - distribution. -* The name of the author may not be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +* Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions + and the following disclaimer in the documentation and/or other materials provided with the + distribution. +* The name of the author may not be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY @@ -32,56 +32,56 @@ using Prebuild.Core.Utilities; namespace Prebuild.Core.Nodes { - /// - /// - /// - [DataNode("Author")] - public class AuthorNode : DataNode - { - #region Fields - - private string m_Signature; - - #endregion - - #region Properties - - /// - /// Gets the signature. - /// - /// The signature. - public string Signature - { - get - { - return m_Signature; - } - } - - #endregion - - #region Public Methods - - /// - /// Parses the specified node. - /// - /// The node. - public override void Parse(XmlNode node) - { - if( node == null ) - { - throw new ArgumentNullException("node"); - } - - m_Signature = Helper.InterpolateForEnvironmentVariables(node.InnerText); - if(m_Signature == null) - { - m_Signature = ""; - } - - m_Signature = m_Signature.Trim(); - } - - #endregion - } + /// + /// + /// + [DataNode("Author")] + public class AuthorNode : DataNode + { + #region Fields + + private string m_Signature; + + #endregion + + #region Properties + + /// + /// Gets the signature. + /// + /// The signature. + public string Signature + { + get + { + return m_Signature; + } + } + + #endregion + + #region Public Methods + + /// + /// Parses the specified node. + /// + /// The node. + public override void Parse(XmlNode node) + { + if( node == null ) + { + throw new ArgumentNullException("node"); + } + + m_Signature = Helper.InterpolateForEnvironmentVariables(node.InnerText); + if(m_Signature == null) + { + m_Signature = ""; + } + + m_Signature = m_Signature.Trim(); + } + + #endregion + } } diff --git a/Prebuild/src/Core/Nodes/CleanFilesNode.cs b/Prebuild/src/Core/Nodes/CleanFilesNode.cs index dc2da9a..bd564d5 100644 --- a/Prebuild/src/Core/Nodes/CleanFilesNode.cs +++ b/Prebuild/src/Core/Nodes/CleanFilesNode.cs @@ -1,80 +1,80 @@ -#region BSD License -/* -Copyright (c) 2007 C.J. Adams-Collier (cjac@colliertech.org) - -Redistribution and use in source and binary forms, with or without modification, are permitted -provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this list of conditions - and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright notice, this list of conditions - and the following disclaimer in the documentation and/or other materials provided with the - distribution. -* The name of the author may not be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#endregion - -using System; -using System.Collections.Generic; -using System.Xml; - -using Prebuild.Core.Attributes; -using Prebuild.Core.Interfaces; -using Prebuild.Core.Utilities; - -namespace Prebuild.Core.Nodes -{ - [DataNode("CleanFiles")] - public class CleanFilesNode : DataNode - { - #region Fields - - private string m_Pattern; - - #endregion - - #region Properties - - /// - /// Gets the signature. - /// - /// The signature. - public string Pattern - { - get - { - return m_Pattern; - } - } - - #endregion - - #region Public Methods - - /// - /// Parses the specified node. - /// - /// The node. - public override void Parse(XmlNode node) - { - if (node == null) - { - throw new ArgumentNullException("node"); - } - - m_Pattern = Helper.AttributeValue(node, "pattern", String.Empty); ; - m_Pattern = m_Pattern.Trim(); - } - - #endregion - } +#region BSD License +/* +Copyright (c) 2007 C.J. Adams-Collier (cjac@colliertech.org) + +Redistribution and use in source and binary forms, with or without modification, are permitted +provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions + and the following disclaimer in the documentation and/or other materials provided with the + distribution. +* The name of the author may not be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#endregion + +using System; +using System.Collections.Generic; +using System.Xml; + +using Prebuild.Core.Attributes; +using Prebuild.Core.Interfaces; +using Prebuild.Core.Utilities; + +namespace Prebuild.Core.Nodes +{ + [DataNode("CleanFiles")] + public class CleanFilesNode : DataNode + { + #region Fields + + private string m_Pattern; + + #endregion + + #region Properties + + /// + /// Gets the signature. + /// + /// The signature. + public string Pattern + { + get + { + return m_Pattern; + } + } + + #endregion + + #region Public Methods + + /// + /// Parses the specified node. + /// + /// The node. + public override void Parse(XmlNode node) + { + if (node == null) + { + throw new ArgumentNullException("node"); + } + + m_Pattern = Helper.AttributeValue(node, "pattern", String.Empty); ; + m_Pattern = m_Pattern.Trim(); + } + + #endregion + } } \ No newline at end of file diff --git a/Prebuild/src/Core/Nodes/CleanupNode.cs b/Prebuild/src/Core/Nodes/CleanupNode.cs index a9b77eb..f334ea3 100644 --- a/Prebuild/src/Core/Nodes/CleanupNode.cs +++ b/Prebuild/src/Core/Nodes/CleanupNode.cs @@ -1,85 +1,85 @@ -#region BSD License -/* -Copyright (c) 2007 C.J. Adams-Collier (cjac@colliertech.org) - -Redistribution and use in source and binary forms, with or without modification, are permitted -provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this list of conditions - and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright notice, this list of conditions - and the following disclaimer in the documentation and/or other materials provided with the - distribution. -* The name of the author may not be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#endregion - -using System; -using System.Collections.Generic; -using System.Xml; - -using Prebuild.Core.Attributes; -using Prebuild.Core.Interfaces; - -namespace Prebuild.Core.Nodes -{ - [DataNode("Cleanup")] - public class CleanupNode : DataNode - { - #region Fields - - private List m_CleanFiles = new List(); - - #endregion - - #region Properties - - /// - /// Gets the signature. - /// - /// The signature. - public List CleanFiles - { - get - { - return m_CleanFiles; - } - } - - #endregion - - #region Public Methods - - /// - /// Parses the specified node. - /// - /// The node. - public override void Parse(XmlNode node) - { - if( node == null ) - { - throw new ArgumentNullException("node"); - } - - foreach (XmlNode child in node.ChildNodes) - { - IDataNode dataNode = Kernel.Instance.ParseNode(child, this); - if (dataNode is CleanFilesNode) - { - m_CleanFiles.Add((CleanFilesNode)dataNode); - } - } - } - - #endregion - } +#region BSD License +/* +Copyright (c) 2007 C.J. Adams-Collier (cjac@colliertech.org) + +Redistribution and use in source and binary forms, with or without modification, are permitted +provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions + and the following disclaimer in the documentation and/or other materials provided with the + distribution. +* The name of the author may not be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#endregion + +using System; +using System.Collections.Generic; +using System.Xml; + +using Prebuild.Core.Attributes; +using Prebuild.Core.Interfaces; + +namespace Prebuild.Core.Nodes +{ + [DataNode("Cleanup")] + public class CleanupNode : DataNode + { + #region Fields + + private List m_CleanFiles = new List(); + + #endregion + + #region Properties + + /// + /// Gets the signature. + /// + /// The signature. + public List CleanFiles + { + get + { + return m_CleanFiles; + } + } + + #endregion + + #region Public Methods + + /// + /// Parses the specified node. + /// + /// The node. + public override void Parse(XmlNode node) + { + if( node == null ) + { + throw new ArgumentNullException("node"); + } + + foreach (XmlNode child in node.ChildNodes) + { + IDataNode dataNode = Kernel.Instance.ParseNode(child, this); + if (dataNode is CleanFilesNode) + { + m_CleanFiles.Add((CleanFilesNode)dataNode); + } + } + } + + #endregion + } } \ No newline at end of file diff --git a/Prebuild/src/Core/Nodes/ConfigurationNode.cs b/Prebuild/src/Core/Nodes/ConfigurationNode.cs index cd2f740..a101799 100644 --- a/Prebuild/src/Core/Nodes/ConfigurationNode.cs +++ b/Prebuild/src/Core/Nodes/ConfigurationNode.cs @@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -* Redistributions of source code must retain the above copyright notice, this list of conditions - and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright notice, this list of conditions - and the following disclaimer in the documentation and/or other materials provided with the - distribution. -* The name of the author may not be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +* Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions + and the following disclaimer in the documentation and/or other materials provided with the + distribution. +* The name of the author may not be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY @@ -32,185 +32,185 @@ using Prebuild.Core.Utilities; namespace Prebuild.Core.Nodes { - /// - /// - /// - [DataNode("Configuration")] - public class ConfigurationNode : DataNode, ICloneable, IComparable - { - #region Fields - - private string m_Name = "unknown"; - private string m_Platform = "AnyCPU"; - private OptionsNode m_Options; - - #endregion - - #region Constructors - - /// - /// Initializes a new instance of the class. - /// - public ConfigurationNode() - { - m_Options = new OptionsNode(); - } - - #endregion - - #region Properties - - /// - /// Gets or sets the parent. - /// - /// The parent. - public override IDataNode Parent - { - get - { - return base.Parent; - } - set - { - base.Parent = value; - if(base.Parent is SolutionNode) - { - SolutionNode node = (SolutionNode)base.Parent; - if(node != null && node.Options != null) - { - node.Options.CopyTo(m_Options); - } - } - } - } - - /// - /// Identifies the platform for this specific configuration. - /// - public string Platform - { - get - { - return m_Platform; - } - set - { - switch ((value + "").ToLower()) - { - case "x86": - case "x64": - m_Platform = value; - break; - case "itanium": - m_Platform = "Itanium"; - break; - default: - m_Platform = "AnyCPU"; - break; - } - } - } - - /// - /// Gets the name. - /// - /// The name. - public string Name - { - get - { - return m_Name; - } - } - - /// - /// Gets the name and platform for the configuration. - /// - /// The name and platform. - public string NameAndPlatform - { - get - { + /// + /// + /// + [DataNode("Configuration")] + public class ConfigurationNode : DataNode, ICloneable, IComparable + { + #region Fields + + private string m_Name = "unknown"; + private string m_Platform = "AnyCPU"; + private OptionsNode m_Options; + + #endregion + + #region Constructors + + /// + /// Initializes a new instance of the class. + /// + public ConfigurationNode() + { + m_Options = new OptionsNode(); + } + + #endregion + + #region Properties + + /// + /// Gets or sets the parent. + /// + /// The parent. + public override IDataNode Parent + { + get + { + return base.Parent; + } + set + { + base.Parent = value; + if(base.Parent is SolutionNode) + { + SolutionNode node = (SolutionNode)base.Parent; + if(node != null && node.Options != null) + { + node.Options.CopyTo(m_Options); + } + } + } + } + + /// + /// Identifies the platform for this specific configuration. + /// + public string Platform + { + get + { + return m_Platform; + } + set + { + switch ((value + "").ToLower()) + { + case "x86": + case "x64": + m_Platform = value; + break; + case "itanium": + m_Platform = "Itanium"; + break; + default: + m_Platform = "AnyCPU"; + break; + } + } + } + + /// + /// Gets the name. + /// + /// The name. + public string Name + { + get + { + return m_Name; + } + } + + /// + /// Gets the name and platform for the configuration. + /// + /// The name and platform. + public string NameAndPlatform + { + get + { string platform = m_Platform; if (platform == "AnyCPU") platform = "Any CPU"; - return String.Format("{0}|{1}", m_Name, platform); - } - } - - /// - /// Gets or sets the options. - /// - /// The options. - public OptionsNode Options - { - get - { - return m_Options; - } - set - { - m_Options = value; - } - } - - #endregion - - #region Public Methods - - /// - /// Parses the specified node. - /// - /// The node. - public override void Parse(XmlNode node) - { - m_Name = Helper.AttributeValue(node, "name", m_Name); - Platform = Helper.AttributeValue(node, "platform", m_Platform); - - if (node == null) - { - throw new ArgumentNullException("node"); - } - foreach(XmlNode child in node.ChildNodes) - { - IDataNode dataNode = Kernel.Instance.ParseNode(child, this); - if(dataNode is OptionsNode) - { - ((OptionsNode)dataNode).CopyTo(m_Options); - } - } - } - - /// - /// Copies to. - /// - /// The conf. - public void CopyTo(ConfigurationNode conf) - { - m_Options.CopyTo(conf.m_Options); - } - - #endregion - - #region ICloneable Members - - /// - /// Creates a new object that is a copy of the current instance. - /// - /// - /// A new object that is a copy of this instance. - /// - public object Clone() - { - ConfigurationNode ret = new ConfigurationNode(); - ret.m_Name = m_Name; - ret.m_Platform = m_Platform; - m_Options.CopyTo(ret.m_Options); - return ret; - } - - #endregion + return String.Format("{0}|{1}", m_Name, platform); + } + } + + /// + /// Gets or sets the options. + /// + /// The options. + public OptionsNode Options + { + get + { + return m_Options; + } + set + { + m_Options = value; + } + } + + #endregion + + #region Public Methods + + /// + /// Parses the specified node. + /// + /// The node. + public override void Parse(XmlNode node) + { + m_Name = Helper.AttributeValue(node, "name", m_Name); + Platform = Helper.AttributeValue(node, "platform", m_Platform); + + if (node == null) + { + throw new ArgumentNullException("node"); + } + foreach(XmlNode child in node.ChildNodes) + { + IDataNode dataNode = Kernel.Instance.ParseNode(child, this); + if(dataNode is OptionsNode) + { + ((OptionsNode)dataNode).CopyTo(m_Options); + } + } + } + + /// + /// Copies to. + /// + /// The conf. + public void CopyTo(ConfigurationNode conf) + { + m_Options.CopyTo(conf.m_Options); + } + + #endregion + + #region ICloneable Members + + /// + /// Creates a new object that is a copy of the current instance. + /// + /// + /// A new object that is a copy of this instance. + /// + public object Clone() + { + ConfigurationNode ret = new ConfigurationNode(); + ret.m_Name = m_Name; + ret.m_Platform = m_Platform; + m_Options.CopyTo(ret.m_Options); + return ret; + } + + #endregion #region IComparable Members @@ -221,5 +221,5 @@ namespace Prebuild.Core.Nodes } #endregion - } + } } diff --git a/Prebuild/src/Core/Nodes/ConfigurationNodeCollection.cs b/Prebuild/src/Core/Nodes/ConfigurationNodeCollection.cs index 7c59ac5..eba6550 100644 --- a/Prebuild/src/Core/Nodes/ConfigurationNodeCollection.cs +++ b/Prebuild/src/Core/Nodes/ConfigurationNodeCollection.cs @@ -1,71 +1,71 @@ -#region BSD License -/* -Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com) - -Redistribution and use in source and binary forms, with or without modification, are permitted -provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this list of conditions - and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright notice, this list of conditions - and the following disclaimer in the documentation and/or other materials provided with the - distribution. -* The name of the author may not be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#endregion - -using System.Collections.Generic; - -namespace Prebuild.Core.Nodes -{ - /// - /// Implements a specialized list of configuration nodes which allows for lookup via - /// configuration name and platform. - /// - public class ConfigurationNodeCollection : List - { - #region Properties - - public ConfigurationNode this[string nameAndPlatform] - { - get - { - foreach (ConfigurationNode configurationNode in this) - { - if (configurationNode.NameAndPlatform == nameAndPlatform) - { - return configurationNode; - } - } - - return null; - } - - set - { - // See if the node - ConfigurationNode configurationNode = this[nameAndPlatform]; - - if (configurationNode != null) - { - this[IndexOf(configurationNode)] = value; - } - else - { - Add(value); - } - } - } - - #endregion - } -} +#region BSD License +/* +Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com) + +Redistribution and use in source and binary forms, with or without modification, are permitted +provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions + and the following disclaimer in the documentation and/or other materials provided with the + distribution. +* The name of the author may not be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#endregion + +using System.Collections.Generic; + +namespace Prebuild.Core.Nodes +{ + /// + /// Implements a specialized list of configuration nodes which allows for lookup via + /// configuration name and platform. + /// + public class ConfigurationNodeCollection : List + { + #region Properties + + public ConfigurationNode this[string nameAndPlatform] + { + get + { + foreach (ConfigurationNode configurationNode in this) + { + if (configurationNode.NameAndPlatform == nameAndPlatform) + { + return configurationNode; + } + } + + return null; + } + + set + { + // See if the node + ConfigurationNode configurationNode = this[nameAndPlatform]; + + if (configurationNode != null) + { + this[IndexOf(configurationNode)] = value; + } + else + { + Add(value); + } + } + } + + #endregion + } +} diff --git a/Prebuild/src/Core/Nodes/DataNode.cs b/Prebuild/src/Core/Nodes/DataNode.cs index 318b13c..4f20588 100644 --- a/Prebuild/src/Core/Nodes/DataNode.cs +++ b/Prebuild/src/Core/Nodes/DataNode.cs @@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -* Redistributions of source code must retain the above copyright notice, this list of conditions - and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright notice, this list of conditions - and the following disclaimer in the documentation and/or other materials provided with the - distribution. -* The name of the author may not be used to endorse or promote products derived from this software - without specific prior written permission. +* Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions + and the following disclaimer in the documentation and/or other materials provided with the + distribution. +* The name of the author may not be used to endorse or promote products derived from this software + without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY @@ -32,86 +32,86 @@ using System.IO; namespace Prebuild.Core.Nodes { - /// - /// - /// - public abstract class DataNode : IDataNode - { - #region Fields + /// + /// + /// + public abstract class DataNode : IDataNode + { + #region Fields - private IDataNode parent; - string[] m_WebTypes = new string[] { "aspx", "ascx", "master", "ashx", "asmx" }; + private IDataNode parent; + string[] m_WebTypes = new string[] { "aspx", "ascx", "master", "ashx", "asmx" }; - #endregion + #endregion - #region IDataNode Members + #region IDataNode Members - /// - /// Gets or sets the parent. - /// - /// The parent. - public virtual IDataNode Parent - { - get - { - return parent; - } - set - { - parent = value; - } - } - public string[] WebTypes - { - get { return m_WebTypes; } - } - /// - /// Parses the specified node. - /// - /// The node. - public virtual void Parse(XmlNode node) - { - } - public BuildAction GetBuildActionByFileName(string fileName) - { - string extension = Path.GetExtension(fileName).ToLower(); - foreach (string type in WebTypes) - { - if (extension == type) - return BuildAction.Content; - } - return BuildAction.Compile; - } - /// - /// Parses the file type to figure out what type it is - /// - /// - public SubType GetSubTypeByFileName(string fileName) - { - string extension = System.IO.Path.GetExtension(fileName).ToLower(); - string designer = String.Format(".designer{0}", extension); - string path = fileName.ToLower(); - if (extension == ".resx") - { - return SubType.Designer; - } - else if (path.EndsWith(".settings")) - { - return SubType.Settings; - } - else - { - - foreach (string type in WebTypes) - { + /// + /// Gets or sets the parent. + /// + /// The parent. + public virtual IDataNode Parent + { + get + { + return parent; + } + set + { + parent = value; + } + } + public string[] WebTypes + { + get { return m_WebTypes; } + } + /// + /// Parses the specified node. + /// + /// The node. + public virtual void Parse(XmlNode node) + { + } + public BuildAction GetBuildActionByFileName(string fileName) + { + string extension = Path.GetExtension(fileName).ToLower(); + foreach (string type in WebTypes) + { + if (extension == type) + return BuildAction.Content; + } + return BuildAction.Compile; + } + /// + /// Parses the file type to figure out what type it is + /// + /// + public SubType GetSubTypeByFileName(string fileName) + { + string extension = System.IO.Path.GetExtension(fileName).ToLower(); + string designer = String.Format(".designer{0}", extension); + string path = fileName.ToLower(); + if (extension == ".resx") + { + return SubType.Designer; + } + else if (path.EndsWith(".settings")) + { + return SubType.Settings; + } + else + { + + foreach (string type in WebTypes) + { if (path.EndsWith(type)) - { - return SubType.CodeBehind; - } - } - } - return SubType.Code; - } - #endregion - } + { + return SubType.CodeBehind; + } + } + } + return SubType.Code; + } + #endregion + } } diff --git a/Prebuild/src/Core/Nodes/DatabaseProjectNode.cs b/Prebuild/src/Core/Nodes/DatabaseProjectNode.cs index 20095c3..278ecd8 100644 --- a/Prebuild/src/Core/Nodes/DatabaseProjectNode.cs +++ b/Prebuild/src/Core/Nodes/DatabaseProjectNode.cs @@ -1,93 +1,93 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Xml; - -using Prebuild.Core.Attributes; -using Prebuild.Core.Interfaces; -using Prebuild.Core.Utilities; - -namespace Prebuild.Core.Nodes -{ - [DataNode("DatabaseProject")] - public class DatabaseProjectNode : DataNode - { - string name; - string path; - string fullpath; - Guid guid = Guid.NewGuid(); - readonly List authors = new List(); - readonly List references = new List(); - - public Guid Guid - { - get { return guid; } - } - - public string Name - { - get { return name; } - } - - public string Path - { - get { return path; } - } - - public string FullPath - { - get { return fullpath; } - } - - public IEnumerable References - { - get { return references; } - } - - public override void Parse(XmlNode node) - { - name = Helper.AttributeValue(node, "name", name); - path = Helper.AttributeValue(node, "path", name); - - try - { - fullpath = Helper.ResolvePath(path); - } - catch - { - throw new WarningException("Could not resolve Solution path: {0}", path); - } - - Kernel.Instance.CurrentWorkingDirectory.Push(); - - try - { - Helper.SetCurrentDir(fullpath); - - if (node == null) - { - throw new ArgumentNullException("node"); - } - - foreach (XmlNode child in node.ChildNodes) - { - IDataNode dataNode = Kernel.Instance.ParseNode(child, this); - - if (dataNode == null) - continue; - - if (dataNode is AuthorNode) - authors.Add((AuthorNode)dataNode); - else if (dataNode is DatabaseReferenceNode) - references.Add((DatabaseReferenceNode)dataNode); - } - } - finally - { - Kernel.Instance.CurrentWorkingDirectory.Pop(); - } - - base.Parse(node); - } - } -} +using System; +using System.Collections.Generic; +using System.Text; +using System.Xml; + +using Prebuild.Core.Attributes; +using Prebuild.Core.Interfaces; +using Prebuild.Core.Utilities; + +namespace Prebuild.Core.Nodes +{ + [DataNode("DatabaseProject")] + public class DatabaseProjectNode : DataNode + { + string name; + string path; + string fullpath; + Guid guid = Guid.NewGuid(); + readonly List authors = new List(); + readonly List references = new List(); + + public Guid Guid + { + get { return guid; } + } + + public string Name + { + get { return name; } + } + + public string Path + { + get { return path; } + } + + public string FullPath + { + get { return fullpath; } + } + + public IEnumerable References + { + get { return references; } + } + + public override void Parse(XmlNode node) + { + name = Helper.AttributeValue(node, "name", name); + path = Helper.AttributeValue(node, "path", name); + + try + { + fullpath = Helper.ResolvePath(path); + } + catch + { + throw new WarningException("Could not resolve Solution path: {0}", path); + } + + Kernel.Instance.CurrentWorkingDirectory.Push(); + + try + { + Helper.SetCurrentDir(fullpath); + + if (node == null) + { + throw new ArgumentNullException("node"); + } + + foreach (XmlNode child in node.ChildNodes) + { + IDataNode dataNode = Kernel.Instance.ParseNode(child, this); + + if (dataNode == null) + continue; + + if (dataNode is AuthorNode) + authors.Add((AuthorNode)dataNode); + else if (dataNode is DatabaseReferenceNode) + references.Add((DatabaseReferenceNode)dataNode); + } + } + finally + { + Kernel.Instance.CurrentWorkingDirectory.Pop(); + } + + base.Parse(node); + } + } +} diff --git a/Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs b/Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs index 97c3964..974b74e 100644 --- a/Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs +++ b/Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs @@ -1,63 +1,63 @@ -using System; -using Prebuild.Core.Attributes; -using Prebuild.Core.Utilities; - -namespace Prebuild.Core.Nodes -{ - [DataNode("DatabaseReference")] - public class DatabaseReferenceNode : DataNode - { - string name; - Guid providerId; - string connectionString; - - public string Name - { - get { return name; } - } - - public Guid ProviderId - { - get { return providerId; } - } - - public string ConnectionString - { - get { return connectionString; } - } - - public override void Parse(System.Xml.XmlNode node) - { - name = Helper.AttributeValue(node, "name", name); - - string providerName = Helper.AttributeValue(node, "providerName", string.Empty); - if (providerName != null) - { - switch (providerName) - { - // digitaljeebus: pulled from HKLM\SOFTWARE\Microsoft\VisualStudio\9.0\DataProviders\* - // Not sure if these will help other operating systems, or if there's a better way. - case "Microsoft.SqlServerCe.Client.3.5": - providerId = new Guid("7C602B5B-ACCB-4acd-9DC0-CA66388C1533"); break; - case "System.Data.OleDb": - providerId = new Guid("7F041D59-D76A-44ed-9AA2-FBF6B0548B80"); break; - case "System.Data.OracleClient": - providerId = new Guid("8F5C5018-AE09-42cf-B2CC-2CCCC7CFC2BB"); break; - case "System.Data.SqlClient": - providerId = new Guid("91510608-8809-4020-8897-FBA057E22D54"); break; - case "System.Data.Odbc": - providerId = new Guid("C3D4F4CE-2C48-4381-B4D6-34FA50C51C86"); break; - - default: - throw new ArgumentOutOfRangeException("providerName", providerName, "Could not provider name to an id."); - } - } - else - providerId = new Guid(Helper.AttributeValue(node, "providerId", Guid.Empty.ToString("B"))); - - connectionString = Helper.AttributeValue(node, "connectionString", connectionString); - - base.Parse(node); - } - } -} +using System; +using Prebuild.Core.Attributes; +using Prebuild.Core.Utilities; + +namespace Prebuild.Core.Nodes +{ + [DataNode("DatabaseReference")] + public class DatabaseReferenceNode : DataNode + { + string name; + Guid providerId; + string connectionString; + + public string Name + { + get { return name; } + } + + public Guid ProviderId + { + get { return providerId; } + } + + public string ConnectionString + { + get { return connectionString; } + } + + public override void Parse(System.Xml.XmlNode node) + { + name = Helper.AttributeValue(node, "name", name); + + string providerName = Helper.AttributeValue(node, "providerName", string.Empty); + if (providerName != null) + { + switch (providerName) + { + // digitaljeebus: pulled from HKLM\SOFTWARE\Microsoft\VisualStudio\9.0\DataProviders\* + // Not sure if these will help other operating systems, or if there's a better way. + case "Microsoft.SqlServerCe.Client.3.5": + providerId = new Guid("7C602B5B-ACCB-4acd-9DC0-CA66388C1533"); break; + case "System.Data.OleDb": + providerId = new Guid("7F041D59-D76A-44ed-9AA2-FBF6B0548B80"); break; + case "System.Data.OracleClient": + providerId = new Guid("8F5C5018-AE09-42cf-B2CC-2CCCC7CFC2BB"); break; + case "System.Data.SqlClient": + providerId = new Guid("91510608-8809-4020-8897-FBA057E22D54"); break; + case "System.Data.Odbc": + providerId = new Guid("C3D4F4CE-2C48-4381-B4D6-34FA50C51C86"); break; + + default: + throw new ArgumentOutOfRangeException("providerName", providerName, "Could not provider name to an id."); + } + } + else + providerId = new Guid(Helper.AttributeValue(node, "providerId", Guid.Empty.ToString("B"))); + + connectionString = Helper.AttributeValue(node, "connectionString", connectionString); + + base.Parse(node); + } + } +} diff --git a/Prebuild/src/Core/Nodes/DescriptionNode.cs b/Prebuild/src/Core/Nodes/DescriptionNode.cs index d1293a0..713b47c 100644 --- a/Prebuild/src/Core/Nodes/DescriptionNode.cs +++ b/Prebuild/src/Core/Nodes/DescriptionNode.cs @@ -5,16 +5,16 @@ Copyright (c) 2007 C.J. Adams-Collier (cjac@colliertech.org) Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -* Redistributions of source code must retain the above copyright notice, this list of conditions - and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright notice, this list of conditions - and the following disclaimer in the documentation and/or other materials provided with the - distribution. -* The name of the author may not be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +* Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions + and the following disclaimer in the documentation and/or other materials provided with the + distribution. +* The name of the author may not be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY @@ -32,56 +32,56 @@ using Prebuild.Core.Utilities; namespace Prebuild.Core.Nodes { - /// - /// The object representing the /Prebuild/Solution/Project/Description element - /// - [DataNode("Description")] - public class DescriptionNode : DataNode - { - #region Fields - - private string m_Value; - - #endregion - - #region Properties - - /// - /// Gets the description Value. - /// - /// The description Value. - public string Value - { - get - { - return m_Value; - } - } - - #endregion - - #region Public Methods - - /// - /// Parses the specified node. - /// - /// The node. - public override void Parse(XmlNode node) - { - if( node == null ) - { - throw new ArgumentNullException("node"); - } - - m_Value = Helper.InterpolateForEnvironmentVariables(node.InnerText); - if(m_Value == null) - { - m_Value = ""; - } - - m_Value = m_Value.Trim(); - } - - #endregion - } + /// + /// The object representing the /Prebuild/Solution/Project/Description element + /// + [DataNode("Description")] + public class DescriptionNode : DataNode + { + #region Fields + + private string m_Value; + + #endregion + + #region Properties + + /// + /// Gets the description Value. + /// + /// The description Value. + public string Value + { + get + { + return m_Value; + } + } + + #endregion + + #region Public Methods + + /// + /// Parses the specified node. + /// + /// The node. + public override void Parse(XmlNode node) + { + if( node == null ) + { + throw new ArgumentNullException("node"); + } + + m_Value = Helper.InterpolateForEnvironmentVariables(node.InnerText); + if(m_Value == null) + { + m_Value = ""; + } + + m_Value = m_Value.Trim(); + } + + #endregion + } } diff --git a/Prebuild/src/Core/Nodes/ExcludeNode.cs b/Prebuild/src/Core/Nodes/ExcludeNode.cs index 7f04cba..addbdb4 100644 --- a/Prebuild/src/Core/Nodes/ExcludeNode.cs +++ b/Prebuild/src/Core/Nodes/ExcludeNode.cs @@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -* Redistributions of source code must retain the above copyright notice, this list of conditions - and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright notice, this list of conditions - and the following disclaimer in the documentation and/or other materials provided with the - distribution. -* The name of the author may not be used to endorse or promote products derived from this software - without specific prior written permission. +* Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions + and the following disclaimer in the documentation and/or other materials provided with the + distribution. +* The name of the author may not be used to endorse or promote products derived from this software + without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY @@ -32,31 +32,31 @@ using Prebuild.Core.Utilities; namespace Prebuild.Core.Nodes { - /// - /// - /// - [DataNode("Exclude")] - public class ExcludeNode : DataNode - { - #region Fields + /// + /// + /// + [DataNode("Exclude")] + public class ExcludeNode : DataNode + { + #region Fields private string m_Pattern = ""; - #endregion + #endregion - #region Properties + #region Properties - /// - /// Gets the name. - /// - /// The name. - public string Name - { - get - { - return m_Pattern; - } - } + /// + /// Gets the name. + /// + /// The name. + public string Name + { + get + { + return m_Pattern; + } + } /// /// Gets the pattern. @@ -72,18 +72,18 @@ namespace Prebuild.Core.Nodes #endregion - #region Public Methods + #region Public Methods - /// - /// Parses the specified node. - /// - /// The node. - public override void Parse(XmlNode node) - { + /// + /// Parses the specified node. + /// + /// The node. + public override void Parse(XmlNode node) + { m_Pattern = Helper.AttributeValue( node, "name", m_Pattern ); m_Pattern = Helper.AttributeValue(node, "pattern", m_Pattern ); - } + } - #endregion - } + #endregion + } } diff --git a/Prebuild/src/Core/Nodes/FileNode.cs b/Prebuild/src/Core/Nodes/FileNode.cs index b313ffa..c66f123 100644 --- a/Prebuild/src/Core/Nodes/FileNode.cs +++ b/Prebuild/src/Core/Nodes/FileNode.cs @@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -* Redistributions of source code must retain the above copyright notice, this list of conditions - and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright notice, this list of conditions - and the following disclaimer in the documentation and/or other materials provided with the - distribution. -* The name of the author may not be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +* Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions + and the following disclaimer in the documentation and/or other materials provided with the + distribution. +* The name of the author may not be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY @@ -34,193 +34,193 @@ using Prebuild.Core.Targets; namespace Prebuild.Core.Nodes { - /// - /// - /// - public enum BuildAction - { - /// - /// - /// - None, - /// - /// - /// - Compile, - /// - /// - /// - Content, - /// - /// - /// - EmbeddedResource, - /// - /// - /// - ApplicationDefinition, - /// - /// - /// - Page, + /// + /// + /// + public enum BuildAction + { /// - /// + /// + /// + None, + /// + /// + /// + Compile, + /// + /// + /// + Content, + /// + /// + /// + EmbeddedResource, + /// + /// + /// + ApplicationDefinition, + /// + /// + /// + Page, + /// + /// /// Copy - } - - /// - /// - /// - public enum SubType - { - /// - /// - /// - Code, - /// - /// - /// - Component, + } + + /// + /// + /// + public enum SubType + { /// - /// + /// + /// + Code, + /// + /// + /// + Component, + /// + /// /// Designer, - /// - /// - /// - Form, - /// - /// - /// - Settings, - /// - /// - /// - UserControl, - /// - /// - /// - CodeBehind, - } - - public enum CopyToOutput - { - Never, - Always, - PreserveNewest - } - - /// - /// - /// - [DataNode("File")] - public class FileNode : DataNode - { - #region Fields - - private string m_Path; - private string m_ResourceName = ""; - private BuildAction? m_BuildAction; - private bool m_Valid; - private SubType? m_SubType; - private CopyToOutput m_CopyToOutput = CopyToOutput.Never; - private bool m_Link = false; - private string m_LinkPath = string.Empty; + /// + /// + /// + Form, + /// + /// + /// + Settings, + /// + /// + /// + UserControl, + /// + /// + /// + CodeBehind, + } + + public enum CopyToOutput + { + Never, + Always, + PreserveNewest + } + + /// + /// + /// + [DataNode("File")] + public class FileNode : DataNode + { + #region Fields + + private string m_Path; + private string m_ResourceName = ""; + private BuildAction? m_BuildAction; + private bool m_Valid; + private SubType? m_SubType; + private CopyToOutput m_CopyToOutput = CopyToOutput.Never; + private bool m_Link = false; + private string m_LinkPath = string.Empty; private bool m_PreservePath = false; - #endregion - - #region Properties - - /// - /// - /// - public string Path - { - get - { - return m_Path; - } - } - - /// - /// - /// - public string ResourceName - { - get - { - return m_ResourceName; - } - } - - /// - /// - /// - public BuildAction BuildAction - { - get - { - if (m_BuildAction != null) - return m_BuildAction.Value; - else - return GetBuildActionByFileName(this.Path); - - } - } - - public CopyToOutput CopyToOutput - { - get - { - return this.m_CopyToOutput; - } - } - - public bool IsLink - { - get - { - return this.m_Link; - } - } - - public string LinkPath - { - get - { - return this.m_LinkPath; - } - } - /// - /// - /// - public SubType SubType - { - get - { - if (m_SubType != null) - return m_SubType.Value; - else - return GetSubTypeByFileName(this.Path); - } - } - - /// - /// - /// - public bool IsValid - { - get - { - return m_Valid; - } - } + #endregion + + #region Properties + + /// + /// + /// + public string Path + { + get + { + return m_Path; + } + } + + /// + /// + /// + public string ResourceName + { + get + { + return m_ResourceName; + } + } + + /// + /// + /// + public BuildAction BuildAction + { + get + { + if (m_BuildAction != null) + return m_BuildAction.Value; + else + return GetBuildActionByFileName(this.Path); + + } + } + + public CopyToOutput CopyToOutput + { + get + { + return this.m_CopyToOutput; + } + } + public bool IsLink + { + get + { + return this.m_Link; + } + } + + public string LinkPath + { + get + { + return this.m_LinkPath; + } + } /// - /// + /// + /// + public SubType SubType + { + get + { + if (m_SubType != null) + return m_SubType.Value; + else + return GetSubTypeByFileName(this.Path); + } + } + + /// + /// + /// + public bool IsValid + { + get + { + return m_Valid; + } + } + + /// + /// /// /// /// @@ -232,61 +232,61 @@ namespace Prebuild.Core.Nodes } } - #endregion + #endregion - #region Public Methods + #region Public Methods - /// - /// - /// - /// - public override void Parse(XmlNode node) - { - string buildAction = Helper.AttributeValue(node, "buildAction", String.Empty); - if (buildAction != string.Empty) - m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction), buildAction); - string subType = Helper.AttributeValue(node, "subType", string.Empty); - if (subType != String.Empty) - m_SubType = (SubType)Enum.Parse(typeof(SubType), subType); + /// + /// + /// + /// + public override void Parse(XmlNode node) + { + string buildAction = Helper.AttributeValue(node, "buildAction", String.Empty); + if (buildAction != string.Empty) + m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction), buildAction); + string subType = Helper.AttributeValue(node, "subType", string.Empty); + if (subType != String.Empty) + m_SubType = (SubType)Enum.Parse(typeof(SubType), subType); Console.WriteLine("[FileNode]:BuildAction is {0}", buildAction); - m_ResourceName = Helper.AttributeValue(node, "resourceName", m_ResourceName.ToString()); - this.m_Link = bool.Parse(Helper.AttributeValue(node, "link", bool.FalseString)); - if ( this.m_Link == true ) - { - this.m_LinkPath = Helper.AttributeValue( node, "linkPath", string.Empty ); - } - this.m_CopyToOutput = (CopyToOutput) Enum.Parse(typeof(CopyToOutput), Helper.AttributeValue(node, "copyToOutput", this.m_CopyToOutput.ToString())); + m_ResourceName = Helper.AttributeValue(node, "resourceName", m_ResourceName.ToString()); + this.m_Link = bool.Parse(Helper.AttributeValue(node, "link", bool.FalseString)); + if ( this.m_Link == true ) + { + this.m_LinkPath = Helper.AttributeValue( node, "linkPath", string.Empty ); + } + this.m_CopyToOutput = (CopyToOutput) Enum.Parse(typeof(CopyToOutput), Helper.AttributeValue(node, "copyToOutput", this.m_CopyToOutput.ToString())); this.m_PreservePath = bool.Parse( Helper.AttributeValue( node, "preservePath", bool.FalseString ) ); - if( node == null ) - { - throw new ArgumentNullException("node"); - } - - m_Path = Helper.InterpolateForEnvironmentVariables(node.InnerText); - if(m_Path == null) - { - m_Path = ""; - } - - m_Path = m_Path.Trim(); - m_Valid = true; - if(!File.Exists(m_Path)) - { - m_Valid = false; - Kernel.Instance.Log.Write(LogType.Warning, "File does not exist: {0}", m_Path); - } + if( node == null ) + { + throw new ArgumentNullException("node"); + } + + m_Path = Helper.InterpolateForEnvironmentVariables(node.InnerText); + if(m_Path == null) + { + m_Path = ""; + } + + m_Path = m_Path.Trim(); + m_Valid = true; + if(!File.Exists(m_Path)) + { + m_Valid = false; + Kernel.Instance.Log.Write(LogType.Warning, "File does not exist: {0}", m_Path); + } if (System.IO.Path.GetExtension(m_Path) == ".settings") { m_SubType = SubType.Settings; m_BuildAction = BuildAction.None; } - } + } - #endregion - } + #endregion + } } diff --git a/Prebuild/src/Core/Nodes/FilesNode.cs b/Prebuild/src/Core/Nodes/FilesNode.cs index 16658f3..58b54fb 100644 --- a/Prebuild/src/Core/Nodes/FilesNode.cs +++ b/Prebuild/src/Core/Nodes/FilesNode.cs @@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -* Redistributions of source code must retain the above copyright notice, this list of conditions - and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright notice, this list of conditions - and the following disclaimer in the documentation and/or other materials provided with the - distribution. -* The name of the author may not be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +* Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions + and the following disclaimer in the documentation and/or other materials provided with the + distribution. +* The name of the author may not be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY @@ -34,36 +34,36 @@ using System.IO; namespace Prebuild.Core.Nodes { - /// - /// - /// - [DataNode("Files")] - public class FilesNode : DataNode - { - #region Fields - - private readonly List m_Files = new List(); - private readonly Dictionary m_BuildActions = new Dictionary(); - private readonly Dictionary m_SubTypes = new Dictionary(); - private readonly Dictionary m_ResourceNames = new Dictionary(); - private readonly Dictionary m_CopyToOutputs = new Dictionary(); - private readonly Dictionary m_Links = new Dictionary(); - private readonly Dictionary m_LinkPaths = new Dictionary(); + /// + /// + /// + [DataNode("Files")] + public class FilesNode : DataNode + { + #region Fields + + private readonly List m_Files = new List(); + private readonly Dictionary m_BuildActions = new Dictionary(); + private readonly Dictionary m_SubTypes = new Dictionary(); + private readonly Dictionary m_ResourceNames = new Dictionary(); + private readonly Dictionary m_CopyToOutputs = new Dictionary(); + private readonly Dictionary m_Links = new Dictionary(); + private readonly Dictionary m_LinkPaths = new Dictionary(); private readonly Dictionary m_PreservePaths = new Dictionary(); private readonly Dictionary m_DestinationPath = new Dictionary(); private readonly NameValueCollection m_CopyFiles = new NameValueCollection(); - #endregion + #endregion - #region Properties + #region Properties - public int Count - { - get - { - return m_Files.Count; - } - } + public int Count + { + get + { + return m_Files.Count; + } + } public string[] Destinations { @@ -75,19 +75,19 @@ namespace Prebuild.Core.Nodes get { return m_CopyFiles.Count; } } - #endregion + #endregion - #region Public Methods + #region Public Methods - public BuildAction GetBuildAction(string file) - { - if(!m_BuildActions.ContainsKey(file)) - { - return BuildAction.Compile; - } + public BuildAction GetBuildAction(string file) + { + if(!m_BuildActions.ContainsKey(file)) + { + return BuildAction.Compile; + } - return m_BuildActions[file]; - } + return m_BuildActions[file]; + } public string GetDestinationPath(string file) { @@ -103,57 +103,57 @@ namespace Prebuild.Core.Nodes return m_CopyFiles.GetValues(dest); } - public CopyToOutput GetCopyToOutput(string file) - { - if (!m_CopyToOutputs.ContainsKey(file)) - { - return CopyToOutput.Never; - } - return m_CopyToOutputs[file]; - } - - public bool GetIsLink(string file) - { - if (!m_Links.ContainsKey(file)) - { - return false; - } - return m_Links[file]; - } + public CopyToOutput GetCopyToOutput(string file) + { + if (!m_CopyToOutputs.ContainsKey(file)) + { + return CopyToOutput.Never; + } + return m_CopyToOutputs[file]; + } + + public bool GetIsLink(string file) + { + if (!m_Links.ContainsKey(file)) + { + return false; + } + return m_Links[file]; + } public bool Contains(string file) { return m_Files.Contains(file); } - public string GetLinkPath( string file ) - { - if ( !m_LinkPaths.ContainsKey( file ) ) - { - return string.Empty; - } - return m_LinkPaths[ file ]; - } - - public SubType GetSubType(string file) - { - if(!m_SubTypes.ContainsKey(file)) - { - return SubType.Code; - } - - return m_SubTypes[file]; - } - - public string GetResourceName(string file) - { - if(!m_ResourceNames.ContainsKey(file)) - { - return string.Empty; - } - - return m_ResourceNames[file]; - } + public string GetLinkPath( string file ) + { + if ( !m_LinkPaths.ContainsKey( file ) ) + { + return string.Empty; + } + return m_LinkPaths[ file ]; + } + + public SubType GetSubType(string file) + { + if(!m_SubTypes.ContainsKey(file)) + { + return SubType.Code; + } + + return m_SubTypes[file]; + } + + public string GetResourceName(string file) + { + if(!m_ResourceNames.ContainsKey(file)) + { + return string.Empty; + } + + return m_ResourceNames[file]; + } public bool GetPreservePath( string file ) { @@ -165,45 +165,45 @@ namespace Prebuild.Core.Nodes return m_PreservePaths[ file ]; } - public override void Parse(XmlNode node) - { - if( node == null ) - { - throw new ArgumentNullException("node"); - } - foreach(XmlNode child in node.ChildNodes) - { - IDataNode dataNode = Kernel.Instance.ParseNode(child, this); - if(dataNode is FileNode) - { - FileNode fileNode = (FileNode)dataNode; - if(fileNode.IsValid) - { - if (!m_Files.Contains(fileNode.Path)) - { - m_Files.Add(fileNode.Path); - m_BuildActions[fileNode.Path] = fileNode.BuildAction; - m_SubTypes[fileNode.Path] = fileNode.SubType; - m_ResourceNames[fileNode.Path] = fileNode.ResourceName; + public override void Parse(XmlNode node) + { + if( node == null ) + { + throw new ArgumentNullException("node"); + } + foreach(XmlNode child in node.ChildNodes) + { + IDataNode dataNode = Kernel.Instance.ParseNode(child, this); + if(dataNode is FileNode) + { + FileNode fileNode = (FileNode)dataNode; + if(fileNode.IsValid) + { + if (!m_Files.Contains(fileNode.Path)) + { + m_Files.Add(fileNode.Path); + m_BuildActions[fileNode.Path] = fileNode.BuildAction; + m_SubTypes[fileNode.Path] = fileNode.SubType; + m_ResourceNames[fileNode.Path] = fileNode.ResourceName; m_PreservePaths[ fileNode.Path ] = fileNode.PreservePath; m_Links[ fileNode.Path ] = fileNode.IsLink; - m_LinkPaths[ fileNode.Path ] = fileNode.LinkPath; - m_CopyToOutputs[ fileNode.Path ] = fileNode.CopyToOutput; - - } - } - } - else if(dataNode is MatchNode) - { - foreach(string file in ((MatchNode)dataNode).Files) - { + m_LinkPaths[ fileNode.Path ] = fileNode.LinkPath; + m_CopyToOutputs[ fileNode.Path ] = fileNode.CopyToOutput; + + } + } + } + else if(dataNode is MatchNode) + { + foreach(string file in ((MatchNode)dataNode).Files) + { MatchNode matchNode = (MatchNode)dataNode; - if (!m_Files.Contains(file)) - { - m_Files.Add(file); - if (matchNode.BuildAction == null) + if (!m_Files.Contains(file)) + { + m_Files.Add(file); + if (matchNode.BuildAction == null) m_BuildActions[file] = GetBuildActionByFileName(file); - else + else m_BuildActions[file] = matchNode.BuildAction.Value; if (matchNode.BuildAction == BuildAction.Copy) @@ -212,27 +212,27 @@ namespace Prebuild.Core.Nodes m_DestinationPath[file] = matchNode.DestinationPath; } - m_SubTypes[file] = matchNode.SubType == null ? GetSubTypeByFileName(file) : matchNode.SubType.Value; + m_SubTypes[file] = matchNode.SubType == null ? GetSubTypeByFileName(file) : matchNode.SubType.Value; m_ResourceNames[ file ] = matchNode.ResourceName; m_PreservePaths[ file ] = matchNode.PreservePath; m_Links[ file ] = matchNode.IsLink; - m_LinkPaths[ file ] = matchNode.LinkPath; - m_CopyToOutputs[ file ] = matchNode.CopyToOutput; - - } - } - } - } - } - - // TODO: Check in to why StringCollection's enumerator doesn't implement - // IEnumerator? - public IEnumerator GetEnumerator() - { - return m_Files.GetEnumerator(); - } - - #endregion + m_LinkPaths[ file ] = matchNode.LinkPath; + m_CopyToOutputs[ file ] = matchNode.CopyToOutput; + + } + } + } + } + } + + // TODO: Check in to why StringCollection's enumerator doesn't implement + // IEnumerator? + public IEnumerator GetEnumerator() + { + return m_Files.GetEnumerator(); + } + + #endregion } } diff --git a/Prebuild/src/Core/Nodes/MatchNode.cs b/Prebuild/src/Core/Nodes/MatchNode.cs index 000bde9..fe02277 100644 --- a/Prebuild/src/Core/Nodes/MatchNode.cs +++ b/Prebuild/src/Core/Nodes/MatchNode.cs @@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -* Redistributions of source code must retain the above copyright notice, this list of conditions - and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright notice, this list of conditions - and the following disclaimer in the documentation and/or other materials provided with the - distribution. -* The name of the author may not be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +* Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions + and the following disclaimer in the documentation and/or other materials provided with the + distribution. +* The name of the author may not be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY @@ -35,51 +35,51 @@ using Prebuild.Core.Utilities; namespace Prebuild.Core.Nodes { - /// - /// - /// - [DataNode("Match")] - public class MatchNode : DataNode - { - #region Fields + /// + /// + /// + [DataNode("Match")] + public class MatchNode : DataNode + { + #region Fields private readonly List m_Files = new List(); - private Regex m_Regex; - private BuildAction? m_BuildAction; - private SubType? m_SubType; - string m_ResourceName = ""; - private CopyToOutput m_CopyToOutput; - private bool m_Link; - private string m_LinkPath; + private Regex m_Regex; + private BuildAction? m_BuildAction; + private SubType? m_SubType; + string m_ResourceName = ""; + private CopyToOutput m_CopyToOutput; + private bool m_Link; + private string m_LinkPath; private bool m_PreservePath; private string m_Destination = ""; private readonly List m_Exclusions = new List(); - #endregion - - #region Properties - - /// - /// - /// - public IEnumerable Files - { - get - { - return m_Files; - } - } - - /// - /// - /// - public BuildAction? BuildAction - { - get - { - return m_BuildAction; - } - } + #endregion + + #region Properties + + /// + /// + /// + public IEnumerable Files + { + get + { + return m_Files; + } + } + + /// + /// + /// + public BuildAction? BuildAction + { + get + { + return m_BuildAction; + } + } public string DestinationPath { @@ -88,50 +88,50 @@ namespace Prebuild.Core.Nodes return m_Destination; } } - /// - /// - /// - public SubType? SubType - { - get - { - return m_SubType; - } - } - - public CopyToOutput CopyToOutput - { - get - { - return m_CopyToOutput; - } - } - - public bool IsLink - { - get - { - return m_Link; - } - } - - public string LinkPath - { - get - { - return m_LinkPath; - } - } - /// - /// - /// - public string ResourceName - { - get - { - return m_ResourceName; - } - } + /// + /// + /// + public SubType? SubType + { + get + { + return m_SubType; + } + } + + public CopyToOutput CopyToOutput + { + get + { + return m_CopyToOutput; + } + } + + public bool IsLink + { + get + { + return m_Link; + } + } + + public string LinkPath + { + get + { + return m_LinkPath; + } + } + /// + /// + /// + public string ResourceName + { + get + { + return m_ResourceName; + } + } public bool PreservePath { @@ -141,27 +141,27 @@ namespace Prebuild.Core.Nodes } } - #endregion - - #region Private Methods - - /// - /// Recurses the directories. - /// - /// The path. - /// The pattern. - /// if set to true [recurse]. - /// if set to true [use regex]. - private void RecurseDirectories(string path, string pattern, bool recurse, bool useRegex, List exclusions) - { - Match match; - try - { - string[] files; - - Boolean excludeFile; - if(!useRegex) - { + #endregion + + #region Private Methods + + /// + /// Recurses the directories. + /// + /// The path. + /// The pattern. + /// if set to true [recurse]. + /// if set to true [use regex]. + private void RecurseDirectories(string path, string pattern, bool recurse, bool useRegex, List exclusions) + { + Match match; + try + { + string[] files; + + Boolean excludeFile; + if(!useRegex) + { try { files = Directory.GetFiles(path, pattern); @@ -169,7 +169,7 @@ namespace Prebuild.Core.Nodes catch (IOException) { // swallow weird IOException error when running in a virtual box - // guest OS on a network share when the host OS is not Windows. + // guest OS on a network share when the host OS is not Windows. // This seems to happen on network shares // when no files match, and may be related to this report: // http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=254546 @@ -177,20 +177,20 @@ namespace Prebuild.Core.Nodes files = null; } - if(files != null) - { - foreach (string file in files) - { + if(files != null) + { + foreach (string file in files) + { excludeFile = false; - string fileTemp; - if (file.Substring(0,2) == "./" || file.Substring(0,2) == ".\\") - { - fileTemp = file.Substring(2); - } - else - { - fileTemp = file; - } + string fileTemp; + if (file.Substring(0,2) == "./" || file.Substring(0,2) == ".\\") + { + fileTemp = file.Substring(2); + } + else + { + fileTemp = file; + } // Check all excludions and set flag if there are any hits. foreach ( ExcludeNode exclude in exclusions ) @@ -205,18 +205,18 @@ namespace Prebuild.Core.Nodes m_Files.Add( fileTemp ); } - } - } + } + } // don't call return here, because we may need to recursively search directories below // this one, even if no matches were found in this directory. - } - else - { - try - { - files = Directory.GetFiles(path); - } + } + else + { + try + { + files = Directory.GetFiles(path); + } catch (IOException) { // swallow weird IOException error when running in a virtual box @@ -248,12 +248,12 @@ namespace Prebuild.Core.Nodes } } } - } - - if(recurse) - { - string[] dirs = Directory.GetDirectories(path); - if(dirs != null && dirs.Length > 0) + } + + if(recurse) + { + string[] dirs = Directory.GetDirectories(path); + if(dirs != null && dirs.Length > 0) { foreach (string str in dirs) { @@ -265,96 +265,96 @@ namespace Prebuild.Core.Nodes RecurseDirectories(Helper.NormalizePath(str), pattern, recurse, useRegex, exclusions); } } - } - } - catch(DirectoryNotFoundException) - { - return; - } - catch(ArgumentException) - { - return; - } - } - - #endregion - - #region Public Methods - - /// - /// - /// - /// - public override void Parse(XmlNode node) - { - if( node == null ) - { - throw new ArgumentNullException("node"); - } - string path = Helper.AttributeValue(node, "path", "."); - string pattern = Helper.AttributeValue(node, "pattern", "*"); + } + } + catch(DirectoryNotFoundException) + { + return; + } + catch(ArgumentException) + { + return; + } + } + + #endregion + + #region Public Methods + + /// + /// + /// + /// + public override void Parse(XmlNode node) + { + if( node == null ) + { + throw new ArgumentNullException("node"); + } + string path = Helper.AttributeValue(node, "path", "."); + string pattern = Helper.AttributeValue(node, "pattern", "*"); string destination = Helper.AttributeValue(node, "destination", string.Empty); - bool recurse = (bool)Helper.TranslateValue(typeof(bool), Helper.AttributeValue(node, "recurse", "false")); - bool useRegex = (bool)Helper.TranslateValue(typeof(bool), Helper.AttributeValue(node, "useRegex", "false")); - string buildAction = Helper.AttributeValue(node, "buildAction", String.Empty); - if (buildAction != string.Empty) - m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction), buildAction); - - - //TODO: Figure out where the subtype node is being assigned - //string subType = Helper.AttributeValue(node, "subType", string.Empty); - //if (subType != String.Empty) - // m_SubType = (SubType)Enum.Parse(typeof(SubType), subType); - m_ResourceName = Helper.AttributeValue(node, "resourceName", m_ResourceName); - m_CopyToOutput = (CopyToOutput) Enum.Parse(typeof(CopyToOutput), Helper.AttributeValue(node, "copyToOutput", m_CopyToOutput.ToString())); - m_Link = bool.Parse(Helper.AttributeValue(node, "link", bool.FalseString)); - if ( m_Link ) - { - m_LinkPath = Helper.AttributeValue( node, "linkPath", string.Empty ); - } + bool recurse = (bool)Helper.TranslateValue(typeof(bool), Helper.AttributeValue(node, "recurse", "false")); + bool useRegex = (bool)Helper.TranslateValue(typeof(bool), Helper.AttributeValue(node, "useRegex", "false")); + string buildAction = Helper.AttributeValue(node, "buildAction", String.Empty); + if (buildAction != string.Empty) + m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction), buildAction); + + + //TODO: Figure out where the subtype node is being assigned + //string subType = Helper.AttributeValue(node, "subType", string.Empty); + //if (subType != String.Empty) + // m_SubType = (SubType)Enum.Parse(typeof(SubType), subType); + m_ResourceName = Helper.AttributeValue(node, "resourceName", m_ResourceName); + m_CopyToOutput = (CopyToOutput) Enum.Parse(typeof(CopyToOutput), Helper.AttributeValue(node, "copyToOutput", m_CopyToOutput.ToString())); + m_Link = bool.Parse(Helper.AttributeValue(node, "link", bool.FalseString)); + if ( m_Link ) + { + m_LinkPath = Helper.AttributeValue( node, "linkPath", string.Empty ); + } m_PreservePath = bool.Parse( Helper.AttributeValue( node, "preservePath", bool.FalseString ) ); if ( buildAction == "Copy") m_Destination = destination; - if(path != null && path.Length == 0) - path = ".";//use current directory - - //throw new WarningException("Match must have a 'path' attribute"); - - if(pattern == null) - { - throw new WarningException("Match must have a 'pattern' attribute"); - } - - path = Helper.NormalizePath(path); - if(!Directory.Exists(path)) - { - throw new WarningException("Match path does not exist: {0}", path); - } - - try - { - if(useRegex) - { - m_Regex = new Regex(pattern); - } - } - catch(ArgumentException ex) - { - throw new WarningException("Could not compile regex pattern: {0}", ex.Message); - } - - - foreach(XmlNode child in node.ChildNodes) - { - IDataNode dataNode = Kernel.Instance.ParseNode(child, this); - if(dataNode is ExcludeNode) - { - ExcludeNode excludeNode = (ExcludeNode)dataNode; + if(path != null && path.Length == 0) + path = ".";//use current directory + + //throw new WarningException("Match must have a 'path' attribute"); + + if(pattern == null) + { + throw new WarningException("Match must have a 'pattern' attribute"); + } + + path = Helper.NormalizePath(path); + if(!Directory.Exists(path)) + { + throw new WarningException("Match path does not exist: {0}", path); + } + + try + { + if(useRegex) + { + m_Regex = new Regex(pattern); + } + } + catch(ArgumentException ex) + { + throw new WarningException("Could not compile regex pattern: {0}", ex.Message); + } + + + foreach(XmlNode child in node.ChildNodes) + { + IDataNode dataNode = Kernel.Instance.ParseNode(child, this); + if(dataNode is ExcludeNode) + { + ExcludeNode excludeNode = (ExcludeNode)dataNode; m_Exclusions.Add( excludeNode ); - } - } + } + } RecurseDirectories( path, pattern, recurse, useRegex, m_Exclusions ); @@ -371,8 +371,8 @@ namespace Prebuild.Core.Nodes throw new WarningException("Match" + projectName + " returned no files: {0}{1}", Helper.EndPath(path), pattern); } m_Regex = null; - } + } - #endregion - } + #endregion + } } diff --git a/Prebuild/src/Core/Nodes/OptionsNode.cs b/Prebuild/src/Core/Nodes/OptionsNode.cs index 577de71..d45bd34 100644 --- a/Prebuild/src/Core/Nodes/OptionsNode.cs +++ b/Prebuild/src/Core/Nodes/OptionsNode.cs @@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -* Redistributions of source code must retain the above copyright notice, this list of conditions - and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright notice, this list of conditions - and the following disclaimer in the documentation and/or other materials provided with the - distribution. -* The name of the author may not be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +* Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions + and the following disclaimer in the documentation and/or other materials provided with the + distribution. +* The name of the author may not be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY @@ -34,273 +34,273 @@ using Prebuild.Core.Utilities; namespace Prebuild.Core.Nodes { - /// - /// - /// - [DataNode("Options")] - public class OptionsNode : DataNode - { - #region Fields - - private static readonly Dictionary m_OptionFields = new Dictionary(); - - [OptionNode("CompilerDefines")] - private string m_CompilerDefines = ""; - - /// - /// - /// - public string CompilerDefines - { - get - { - return m_CompilerDefines; - } - set - { - m_CompilerDefines = value; - } - } - - [OptionNode("OptimizeCode")] - private bool m_OptimizeCode; - - /// - /// - /// - public bool OptimizeCode - { - get - { - return m_OptimizeCode; - } - set - { - m_OptimizeCode = value; - } - } - - [OptionNode("CheckUnderflowOverflow")] - private bool m_CheckUnderflowOverflow; - - /// - /// - /// - public bool CheckUnderflowOverflow - { - get - { - return m_CheckUnderflowOverflow; - } - set - { - m_CheckUnderflowOverflow = value; - } - } - - [OptionNode("AllowUnsafe")] - private bool m_AllowUnsafe; - - /// - /// - /// - public bool AllowUnsafe - { - get - { - return m_AllowUnsafe; - } - set - { - m_AllowUnsafe = value; - } - } - - [OptionNode("PreBuildEvent")] - private string m_PreBuildEvent; - - /// - /// - /// - public string PreBuildEvent - { - get - { - return m_PreBuildEvent; - } - set - { - m_PreBuildEvent = value; - } - } - - [OptionNode("PostBuildEvent")] - private string m_PostBuildEvent; - - /// - /// - /// - public string PostBuildEvent - { - get - { - return m_PostBuildEvent; - } - set - { - m_PostBuildEvent = value; - } - } - - [OptionNode("PreBuildEventArgs")] - private string m_PreBuildEventArgs; - - /// - /// - /// - public string PreBuildEventArgs - { - get - { - return m_PreBuildEventArgs; - } - set - { - m_PreBuildEventArgs = value; - } - } - - [OptionNode("PostBuildEventArgs")] - private string m_PostBuildEventArgs; - - /// - /// - /// - public string PostBuildEventArgs - { - get - { - return m_PostBuildEventArgs; - } - set - { - m_PostBuildEventArgs = value; - } - } - - [OptionNode("RunPostBuildEvent")] - private string m_RunPostBuildEvent; - - /// - /// - /// - public string RunPostBuildEvent - { - get - { - return m_RunPostBuildEvent; - } - set - { - m_RunPostBuildEvent = value; - } - } - - [OptionNode("RunScript")] - private string m_RunScript; - - /// - /// - /// - public string RunScript - { - get - { - return m_RunScript; - } - set - { - m_RunScript = value; - } - } - - [OptionNode("WarningLevel")] - private int m_WarningLevel = 4; - - /// - /// - /// - public int WarningLevel - { - get - { - return m_WarningLevel; - } - set - { - m_WarningLevel = value; - } - } - - [OptionNode("WarningsAsErrors")] - private bool m_WarningsAsErrors; - - /// - /// - /// - public bool WarningsAsErrors - { - get - { - return m_WarningsAsErrors; - } - set - { - m_WarningsAsErrors = value; - } - } - - [OptionNode("SuppressWarnings")] - private string m_SuppressWarnings = ""; - - /// - /// - /// - public string SuppressWarnings - { - get - { - return m_SuppressWarnings; - } - set - { - m_SuppressWarnings = value; - } - } - - [OptionNode("OutputPath")] - private string m_OutputPath = "bin/"; - - /// - /// - /// - public string OutputPath - { - get - { - return m_OutputPath; - } - set - { - m_OutputPath = value; - } - } + /// + /// + /// + [DataNode("Options")] + public class OptionsNode : DataNode + { + #region Fields + + private static readonly Dictionary m_OptionFields = new Dictionary(); + + [OptionNode("CompilerDefines")] + private string m_CompilerDefines = ""; + + /// + /// + /// + public string CompilerDefines + { + get + { + return m_CompilerDefines; + } + set + { + m_CompilerDefines = value; + } + } + + [OptionNode("OptimizeCode")] + private bool m_OptimizeCode; + + /// + /// + /// + public bool OptimizeCode + { + get + { + return m_OptimizeCode; + } + set + { + m_OptimizeCode = value; + } + } + + [OptionNode("CheckUnderflowOverflow")] + private bool m_CheckUnderflowOverflow; + + /// + /// + /// + public bool CheckUnderflowOverflow + { + get + { + return m_CheckUnderflowOverflow; + } + set + { + m_CheckUnderflowOverflow = value; + } + } + + [OptionNode("AllowUnsafe")] + private bool m_AllowUnsafe; + + /// + /// + /// + public bool AllowUnsafe + { + get + { + return m_AllowUnsafe; + } + set + { + m_AllowUnsafe = value; + } + } + + [OptionNode("PreBuildEvent")] + private string m_PreBuildEvent; + + /// + /// + /// + public string PreBuildEvent + { + get + { + return m_PreBuildEvent; + } + set + { + m_PreBuildEvent = value; + } + } + + [OptionNode("PostBuildEvent")] + private string m_PostBuildEvent; + + /// + /// + /// + public string PostBuildEvent + { + get + { + return m_PostBuildEvent; + } + set + { + m_PostBuildEvent = value; + } + } + + [OptionNode("PreBuildEventArgs")] + private string m_PreBuildEventArgs; + + /// + /// + /// + public string PreBuildEventArgs + { + get + { + return m_PreBuildEventArgs; + } + set + { + m_PreBuildEventArgs = value; + } + } + + [OptionNode("PostBuildEventArgs")] + private string m_PostBuildEventArgs; + + /// + /// + /// + public string PostBuildEventArgs + { + get + { + return m_PostBuildEventArgs; + } + set + { + m_PostBuildEventArgs = value; + } + } + + [OptionNode("RunPostBuildEvent")] + private string m_RunPostBuildEvent; + + /// + /// + /// + public string RunPostBuildEvent + { + get + { + return m_RunPostBuildEvent; + } + set + { + m_RunPostBuildEvent = value; + } + } + + [OptionNode("RunScript")] + private string m_RunScript; + + /// + /// + /// + public string RunScript + { + get + { + return m_RunScript; + } + set + { + m_RunScript = value; + } + } + + [OptionNode("WarningLevel")] + private int m_WarningLevel = 4; + + /// + /// + /// + public int WarningLevel + { + get + { + return m_WarningLevel; + } + set + { + m_WarningLevel = value; + } + } + + [OptionNode("WarningsAsErrors")] + private bool m_WarningsAsErrors; + + /// + /// + /// + public bool WarningsAsErrors + { + get + { + return m_WarningsAsErrors; + } + set + { + m_WarningsAsErrors = value; + } + } + + [OptionNode("SuppressWarnings")] + private string m_SuppressWarnings = ""; + + /// + /// + /// + public string SuppressWarnings + { + get + { + return m_SuppressWarnings; + } + set + { + m_SuppressWarnings = value; + } + } + + [OptionNode("OutputPath")] + private string m_OutputPath = "bin/"; + + /// + /// + /// + public string OutputPath + { + get + { + return m_OutputPath; + } + set + { + m_OutputPath = value; + } + } [OptionNode("GenerateDocumentation")] private bool m_GenerateDocumentation; /// - /// + /// /// public bool GenerateDocumentation { @@ -314,321 +314,321 @@ namespace Prebuild.Core.Nodes } } - [OptionNode("GenerateXmlDocFile")] - private bool m_GenerateXmlDocFile; - - /// - /// - /// - public bool GenerateXmlDocFile - { - get - { - return m_GenerateXmlDocFile; - } - set - { - m_GenerateXmlDocFile = value; - } - } - - [OptionNode("XmlDocFile")] - private string m_XmlDocFile = ""; - - /// - /// - /// - public string XmlDocFile - { - get - { - return m_XmlDocFile; - } - set - { - m_XmlDocFile = value; - } - } - - [OptionNode("KeyFile")] - private string m_KeyFile = ""; - - /// - /// - /// - public string KeyFile - { - get - { - return m_KeyFile; - } - set - { - m_KeyFile = value; - } - } - - [OptionNode("DebugInformation")] - private bool m_DebugInformation; - - /// - /// - /// - public bool DebugInformation - { - get - { - return m_DebugInformation; - } - set - { - m_DebugInformation = value; - } - } - - [OptionNode("RegisterComInterop")] - private bool m_RegisterComInterop; - - /// - /// - /// - public bool RegisterComInterop - { - get - { - return m_RegisterComInterop; - } - set - { - m_RegisterComInterop = value; - } - } - - [OptionNode("RemoveIntegerChecks")] - private bool m_RemoveIntegerChecks; - - /// - /// - /// - public bool RemoveIntegerChecks - { - get - { - return m_RemoveIntegerChecks; - } - set - { - m_RemoveIntegerChecks = value; - } - } - - [OptionNode("IncrementalBuild")] - private bool m_IncrementalBuild; - - /// - /// - /// - public bool IncrementalBuild - { - get - { - return m_IncrementalBuild; - } - set - { - m_IncrementalBuild = value; - } - } - - [OptionNode("BaseAddress")] - private string m_BaseAddress = "285212672"; - - /// - /// - /// - public string BaseAddress - { - get - { - return m_BaseAddress; - } - set - { - m_BaseAddress = value; - } - } - - [OptionNode("FileAlignment")] - private int m_FileAlignment = 4096; - - /// - /// - /// - public int FileAlignment - { - get - { - return m_FileAlignment; - } - set - { - m_FileAlignment = value; - } - } - - [OptionNode("NoStdLib")] - private bool m_NoStdLib; - - /// - /// - /// - public bool NoStdLib - { - get - { - return m_NoStdLib; - } - set - { - m_NoStdLib = value; - } - } - - private readonly List m_FieldsDefined = new List(); - - #endregion - - #region Constructors - - /// - /// Initializes the class. - /// - static OptionsNode() - { - Type t = typeof(OptionsNode); - - foreach(FieldInfo f in t.GetFields(BindingFlags.NonPublic | BindingFlags.Instance)) - { - object[] attrs = f.GetCustomAttributes(typeof(OptionNodeAttribute), false); - if(attrs == null || attrs.Length < 1) - { - continue; - } - - OptionNodeAttribute ona = (OptionNodeAttribute)attrs[0]; - m_OptionFields[ona.NodeName] = f; - } - } - - #endregion - - #region Properties - - /// - /// Gets the at the specified index. - /// - /// - public object this[string index] - { - get - { - if(!m_OptionFields.ContainsKey(index)) - { - return null; - } - - FieldInfo f = m_OptionFields[index]; - return f.GetValue(this); - } - } - - /// - /// Gets the at the specified index. - /// - /// - public object this[string index, object defaultValue] - { - get - { - object valueObject = this[index]; - if(valueObject != null && valueObject is string && ((string)valueObject).Length == 0) - { - return defaultValue; - } - return valueObject; - } - } - - - #endregion - - #region Private Methods - - private void FlagDefined(string name) - { - if(!m_FieldsDefined.Contains(name)) - { - m_FieldsDefined.Add(name); - } - } - - private void SetOption(string nodeName, string val) - { - lock(m_OptionFields) - { - if(!m_OptionFields.ContainsKey(nodeName)) - { - return; - } - - FieldInfo f = m_OptionFields[nodeName]; - f.SetValue(this, Helper.TranslateValue(f.FieldType, val)); - FlagDefined(f.Name); - } - } - - #endregion - - #region Public Methods - - /// - /// Parses the specified node. - /// - /// The node. - public override void Parse(XmlNode node) - { - if( node == null ) - { - throw new ArgumentNullException("node"); - } - - foreach(XmlNode child in node.ChildNodes) - { - SetOption(child.Name, Helper.InterpolateForEnvironmentVariables(child.InnerText)); - } - } - - /// - /// Copies to. - /// - /// The opt. - public void CopyTo(OptionsNode opt) - { - if(opt == null) - { - return; - } - - foreach(FieldInfo f in m_OptionFields.Values) - { - if(m_FieldsDefined.Contains(f.Name)) - { - f.SetValue(opt, f.GetValue(this)); - opt.m_FieldsDefined.Add(f.Name); - } - } - } - - #endregion - } + [OptionNode("GenerateXmlDocFile")] + private bool m_GenerateXmlDocFile; + + /// + /// + /// + public bool GenerateXmlDocFile + { + get + { + return m_GenerateXmlDocFile; + } + set + { + m_GenerateXmlDocFile = value; + } + } + + [OptionNode("XmlDocFile")] + private string m_XmlDocFile = ""; + + /// + /// + /// + public string XmlDocFile + { + get + { + return m_XmlDocFile; + } + set + { + m_XmlDocFile = value; + } + } + + [OptionNode("KeyFile")] + private string m_KeyFile = ""; + + /// + /// + /// + public string KeyFile + { + get + { + return m_KeyFile; + } + set + { + m_KeyFile = value; + } + } + + [OptionNode("DebugInformation")] + private bool m_DebugInformation; + + /// + /// + /// + public bool DebugInformation + { + get + { + return m_DebugInformation; + } + set + { + m_DebugInformation = value; + } + } + + [OptionNode("RegisterComInterop")] + private bool m_RegisterComInterop; + + /// + /// + /// + public bool RegisterComInterop + { + get + { + return m_RegisterComInterop; + } + set + { + m_RegisterComInterop = value; + } + } + + [OptionNode("RemoveIntegerChecks")] + private bool m_RemoveIntegerChecks; + + /// + /// + /// + public bool RemoveIntegerChecks + { + get + { + return m_RemoveIntegerChecks; + } + set + { + m_RemoveIntegerChecks = value; + } + } + + [OptionNode("IncrementalBuild")] + private bool m_IncrementalBuild; + + /// + /// + /// + public bool IncrementalBuild + { + get + { + return m_IncrementalBuild; + } + set + { + m_IncrementalBuild = value; + } + } + + [OptionNode("BaseAddress")] + private string m_BaseAddress = "285212672"; + + /// + /// + /// + public string BaseAddress + { + get + { + return m_BaseAddress; + } + set + { + m_BaseAddress = value; + } + } + + [OptionNode("FileAlignment")] + private int m_FileAlignment = 4096; + + /// + /// + /// + public int FileAlignment + { + get + { + return m_FileAlignment; + } + set + { + m_FileAlignment = value; + } + } + + [OptionNode("NoStdLib")] + private bool m_NoStdLib; + + /// + /// + /// + public bool NoStdLib + { + get + { + return m_NoStdLib; + } + set + { + m_NoStdLib = value; + } + } + + private readonly List m_FieldsDefined = new List(); + + #endregion + + #region Constructors + + /// + /// Initializes the class. + /// + static OptionsNode() + { + Type t = typeof(OptionsNode); + + foreach(FieldInfo f in t.GetFields(BindingFlags.NonPublic | BindingFlags.Instance)) + { + object[] attrs = f.GetCustomAttributes(typeof(OptionNodeAttribute), false); + if(attrs == null || attrs.Length < 1) + { + continue; + } + + OptionNodeAttribute ona = (OptionNodeAttribute)attrs[0]; + m_OptionFields[ona.NodeName] = f; + } + } + + #endregion + + #region Properties + + /// + /// Gets the at the specified index. + /// + /// + public object this[string index] + { + get + { + if(!m_OptionFields.ContainsKey(index)) + { + return null; + } + + FieldInfo f = m_OptionFields[index]; + return f.GetValue(this); + } + } + + /// + /// Gets the at the specified index. + /// + /// + public object this[string index, object defaultValue] + { + get + { + object valueObject = this[index]; + if(valueObject != null && valueObject is string && ((string)valueObject).Length == 0) + { + return defaultValue; + } + return valueObject; + } + } + + + #endregion + + #region Private Methods + + private void FlagDefined(string name) + { + if(!m_FieldsDefined.Contains(name)) + { + m_FieldsDefined.Add(name); + } + } + + private void SetOption(string nodeName, string val) + { + lock(m_OptionFields) + { + if(!m_OptionFields.ContainsKey(nodeName)) + { + return; + } + + FieldInfo f = m_OptionFields[nodeName]; + f.SetValue(this, Helper.TranslateValue(f.FieldType, val)); + FlagDefined(f.Name); + } + } + + #endregion + + #region Public Methods + + /// + /// Parses the specified node. + /// + /// The node. + public override void Parse(XmlNode node) + { + if( node == null ) + { + throw new ArgumentNullException("node"); + } + + foreach(XmlNode child in node.ChildNodes) + { + SetOption(child.Name, Helper.InterpolateForEnvironmentVariables(child.InnerText)); + } + } + + /// + /// Copies to. + /// + /// The opt. + public void CopyTo(OptionsNode opt) + { + if(opt == null) + { + return; + } + + foreach(FieldInfo f in m_OptionFields.Values) + { + if(m_FieldsDefined.Contains(f.Name)) + { + f.SetValue(opt, f.GetValue(this)); + opt.m_FieldsDefined.Add(f.Name); + } + } + } + + #endregion + } } diff --git a/Prebuild/src/Core/Nodes/ProcessNode.cs b/Prebuild/src/Core/Nodes/ProcessNode.cs index 8ca8e49..b05ffc6 100644 --- a/Prebuild/src/Core/Nodes/ProcessNode.cs +++ b/Prebuild/src/Core/Nodes/ProcessNode.cs @@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -* Redistributions of source code must retain the above copyright notice, this list of conditions - and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright notice, this list of conditions - and the following disclaimer in the documentation and/or other materials provided with the - distribution. -* The name of the author may not be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +* Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions + and the following disclaimer in the documentation and/or other materials provided with the + distribution. +* The name of the author may not be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY @@ -32,77 +32,77 @@ using Prebuild.Core.Utilities; namespace Prebuild.Core.Nodes { - /// - /// - /// - [DataNode("Process")] - public class ProcessNode : DataNode - { - #region Fields - - private string m_Path; - private bool m_IsValid = true; - - #endregion - - #region Properties - - /// - /// Gets the path. - /// - /// The path. - public string Path - { - get - { - return m_Path; - } - } - - /// - /// Gets a value indicating whether this instance is valid. - /// - /// true if this instance is valid; otherwise, false. - public bool IsValid - { - get - { - return m_IsValid; - } - } - - #endregion - - #region Public Methods - - /// - /// Parses the specified node. - /// - /// The node. - public override void Parse(XmlNode node) - { - if( node == null ) - { - throw new ArgumentNullException("node"); - } - - m_Path = Helper.InterpolateForEnvironmentVariables(node.InnerText); - if(m_Path == null) - { - m_Path = ""; - } - - try - { - m_Path = Helper.ResolvePath(m_Path); - } - catch(ArgumentException) - { - Kernel.Instance.Log.Write(LogType.Warning, "Could not find prebuild file for processing: {0}", m_Path); - m_IsValid = false; - } - } - - #endregion - } + /// + /// + /// + [DataNode("Process")] + public class ProcessNode : DataNode + { + #region Fields + + private string m_Path; + private bool m_IsValid = true; + + #endregion + + #region Properties + + /// + /// Gets the path. + /// + /// The path. + public string Path + { + get + { + return m_Path; + } + } + + /// + /// Gets a value indicating whether this instance is valid. + /// + /// true if this instance is valid; otherwise, false. + public bool IsValid + { + get + { + return m_IsValid; + } + } + + #endregion + + #region Public Methods + + /// + /// Parses the specified node. + /// + /// The node. + public override void Parse(XmlNode node) + { + if( node == null ) + { + throw new ArgumentNullException("node"); + } + + m_Path = Helper.InterpolateForEnvironmentVariables(node.InnerText); + if(m_Path == null) + { + m_Path = ""; + } + + try + { + m_Path = Helper.ResolvePath(m_Path); + } + catch(ArgumentException) + { + Kernel.Instance.Log.Write(LogType.Warning, "Could not find prebuild file for processing: {0}", m_Path); + m_IsValid = false; + } + } + + #endregion + } } diff --git a/Prebuild/src/Core/Nodes/ProjectNode.cs b/Prebuild/src/Core/Nodes/ProjectNode.cs index a822704..e02b11b 100644 --- a/Prebuild/src/Core/Nodes/ProjectNode.cs +++ b/Prebuild/src/Core/Nodes/ProjectNode.cs @@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -* Redistributions of source code must retain the above copyright notice, this list of conditions - and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright notice, this list of conditions - and the following disclaimer in the documentation and/or other materials provided with the - distribution. -* The name of the author may not be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +* Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions + and the following disclaimer in the documentation and/or other materials provided with the + distribution. +* The name of the author may not be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY @@ -34,65 +34,65 @@ using Prebuild.Core.Utilities; namespace Prebuild.Core.Nodes { - /// - /// A set of values that the Project's type can be - /// - public enum ProjectType - { - /// - /// The project is a console executable - /// - Exe, - /// - /// The project is a windows executable - /// - WinExe, - /// - /// The project is a library - /// - Library, - /// - /// The project is a website - /// - Web, - } - - /// - /// - /// - public enum ClrRuntime - { - /// - /// - /// - Microsoft, - /// - /// - /// - Mono - } - /// - /// The version of the .NET framework to use (Required for VS2008) - /// We don't need .NET 1.1 in here, it'll default when using vs2003. - /// - public enum FrameworkVersion - { - /// - /// .NET 2.0 - /// - v2_0, - /// - /// .NET 3.0 - /// - v3_0, - /// - /// .NET 3.5 - /// - v3_5, - /// - /// .NET 4.0 - /// - v4_0, + /// + /// A set of values that the Project's type can be + /// + public enum ProjectType + { + /// + /// The project is a console executable + /// + Exe, + /// + /// The project is a windows executable + /// + WinExe, + /// + /// The project is a library + /// + Library, + /// + /// The project is a website + /// + Web, + } + + /// + /// + /// + public enum ClrRuntime + { + /// + /// + /// + Microsoft, + /// + /// + /// + Mono + } + /// + /// The version of the .NET framework to use (Required for VS2008) + /// We don't need .NET 1.1 in here, it'll default when using vs2003. + /// + public enum FrameworkVersion + { + /// + /// .NET 2.0 + /// + v2_0, + /// + /// .NET 3.0 + /// + v3_0, + /// + /// .NET 3.5 + /// + v3_5, + /// + /// .NET 4.0 + /// + v4_0, /// /// .NET 4.5 /// @@ -102,477 +102,477 @@ namespace Prebuild.Core.Nodes /// v4_5_1 } - /// - /// The Node object representing /Prebuild/Solution/Project elements - /// - [DataNode("Project")] - public class ProjectNode : DataNode, IComparable - { - #region Fields - - private string m_Name = "unknown"; - private string m_Path = ""; - private string m_FullPath = ""; - private string m_AssemblyName; - private string m_AppIcon = ""; + /// + /// The Node object representing /Prebuild/Solution/Project elements + /// + [DataNode("Project")] + public class ProjectNode : DataNode, IComparable + { + #region Fields + + private string m_Name = "unknown"; + private string m_Path = ""; + private string m_FullPath = ""; + private string m_AssemblyName; + private string m_AppIcon = ""; private string m_ConfigFile = ""; - private string m_DesignerFolder = ""; - private string m_Language = "C#"; - private ProjectType m_Type = ProjectType.Exe; - private ClrRuntime m_Runtime = ClrRuntime.Microsoft; + private string m_DesignerFolder = ""; + private string m_Language = "C#"; + private ProjectType m_Type = ProjectType.Exe; + private ClrRuntime m_Runtime = ClrRuntime.Microsoft; private FrameworkVersion m_Framework = FrameworkVersion.v2_0; - private string m_StartupObject = ""; - private string m_RootNamespace; - private string m_FilterGroups = ""; - private string m_Version = ""; - private Guid m_Guid; + private string m_StartupObject = ""; + private string m_RootNamespace; + private string m_FilterGroups = ""; + private string m_Version = ""; + private Guid m_Guid; private string m_DebugStartParameters; private readonly Dictionary m_Configurations = new Dictionary(); private readonly List m_ReferencePaths = new List(); - private readonly List m_References = new List(); + private readonly List m_References = new List(); private readonly List m_Authors = new List(); - private FilesNode m_Files; - - #endregion - - #region Properties - - /// - /// Gets the name. - /// - /// The name. - public string Name - { - get - { - return m_Name; - } - } - /// - /// The version of the .NET Framework to compile under - /// - public FrameworkVersion FrameworkVersion - { - get - { - return m_Framework; - } - } - /// - /// Gets the path. - /// - /// The path. - public string Path - { - get - { - return m_Path; - } - } - - /// - /// Gets the filter groups. - /// - /// The filter groups. - public string FilterGroups - { - get - { - return m_FilterGroups; - } - } - - /// - /// Gets the project's version - /// - /// The project's version. - public string Version - { - get - { - return m_Version; - } - } - - /// - /// Gets the full path. - /// - /// The full path. - public string FullPath - { - get - { - return m_FullPath; - } - } - - /// - /// Gets the name of the assembly. - /// - /// The name of the assembly. - public string AssemblyName - { - get - { - return m_AssemblyName; - } - } - - /// - /// Gets the app icon. - /// - /// The app icon. - public string AppIcon - { - get - { - return m_AppIcon; - } - } - - /// - /// Gets the app icon. - /// - /// The app icon. - public string ConfigFile - { - get - { - return m_ConfigFile; - } - } - - /// - /// - /// - public string DesignerFolder - { - get - { - return m_DesignerFolder; - } - } - - /// - /// Gets the language. - /// - /// The language. - public string Language - { - get - { - return m_Language; - } - } - - /// - /// Gets the type. - /// - /// The type. - public ProjectType Type - { - get - { - return m_Type; - } - } - - /// - /// Gets the runtime. - /// - /// The runtime. - public ClrRuntime Runtime - { - get - { - return m_Runtime; - } - } - - private bool m_GenerateAssemblyInfoFile; - - /// - /// - /// - public bool GenerateAssemblyInfoFile - { - get - { - return m_GenerateAssemblyInfoFile; - } - set - { - m_GenerateAssemblyInfoFile = value; - } - } - - /// - /// Gets the startup object. - /// - /// The startup object. - public string StartupObject - { - get - { - return m_StartupObject; - } - } - - /// - /// Gets the root namespace. - /// - /// The root namespace. - public string RootNamespace - { - get - { - return m_RootNamespace; - } - } - - /// - /// Gets the configurations. - /// - /// The configurations. + private FilesNode m_Files; + + #endregion + + #region Properties + + /// + /// Gets the name. + /// + /// The name. + public string Name + { + get + { + return m_Name; + } + } + /// + /// The version of the .NET Framework to compile under + /// + public FrameworkVersion FrameworkVersion + { + get + { + return m_Framework; + } + } + /// + /// Gets the path. + /// + /// The path. + public string Path + { + get + { + return m_Path; + } + } + + /// + /// Gets the filter groups. + /// + /// The filter groups. + public string FilterGroups + { + get + { + return m_FilterGroups; + } + } + + /// + /// Gets the project's version + /// + /// The project's version. + public string Version + { + get + { + return m_Version; + } + } + + /// + /// Gets the full path. + /// + /// The full path. + public string FullPath + { + get + { + return m_FullPath; + } + } + + /// + /// Gets the name of the assembly. + /// + /// The name of the assembly. + public string AssemblyName + { + get + { + return m_AssemblyName; + } + } + + /// + /// Gets the app icon. + /// + /// The app icon. + public string AppIcon + { + get + { + return m_AppIcon; + } + } + + /// + /// Gets the app icon. + /// + /// The app icon. + public string ConfigFile + { + get + { + return m_ConfigFile; + } + } + + /// + /// + /// + public string DesignerFolder + { + get + { + return m_DesignerFolder; + } + } + + /// + /// Gets the language. + /// + /// The language. + public string Language + { + get + { + return m_Language; + } + } + + /// + /// Gets the type. + /// + /// The type. + public ProjectType Type + { + get + { + return m_Type; + } + } + + /// + /// Gets the runtime. + /// + /// The runtime. + public ClrRuntime Runtime + { + get + { + return m_Runtime; + } + } + + private bool m_GenerateAssemblyInfoFile; + + /// + /// + /// + public bool GenerateAssemblyInfoFile + { + get + { + return m_GenerateAssemblyInfoFile; + } + set + { + m_GenerateAssemblyInfoFile = value; + } + } + + /// + /// Gets the startup object. + /// + /// The startup object. + public string StartupObject + { + get + { + return m_StartupObject; + } + } + + /// + /// Gets the root namespace. + /// + /// The root namespace. + public string RootNamespace + { + get + { + return m_RootNamespace; + } + } + + /// + /// Gets the configurations. + /// + /// The configurations. public List Configurations - { - get - { - List tmp = new List(ConfigurationsTable.Values); + { + get + { + List tmp = new List(ConfigurationsTable.Values); tmp.Sort(); return tmp; - } - } - - /// - /// Gets the configurations table. - /// - /// The configurations table. - public Dictionary ConfigurationsTable - { - get - { - return m_Configurations; - } - } - - /// - /// Gets the reference paths. - /// - /// The reference paths. - public List ReferencePaths - { - get - { + } + } + + /// + /// Gets the configurations table. + /// + /// The configurations table. + public Dictionary ConfigurationsTable + { + get + { + return m_Configurations; + } + } + + /// + /// Gets the reference paths. + /// + /// The reference paths. + public List ReferencePaths + { + get + { List tmp = new List(m_ReferencePaths); tmp.Sort(); return tmp; - } - } + } + } - /// - /// Gets the references. - /// - /// The references. + /// + /// Gets the references. + /// + /// The references. public List References - { - get - { + { + get + { List tmp = new List(m_References); tmp.Sort(); return tmp; - } - } - - /// - /// Gets the Authors list. - /// - /// The list of the project's authors. - public List Authors - { - get - { - return m_Authors; - } - } - - /// - /// Gets the files. - /// - /// The files. - public FilesNode Files - { - get - { - return m_Files; - } - } - - /// - /// Gets or sets the parent. - /// - /// The parent. - public override IDataNode Parent - { - get - { - return base.Parent; - } - set - { - base.Parent = value; - if(base.Parent is SolutionNode && m_Configurations.Count < 1) - { - SolutionNode parent = (SolutionNode)base.Parent; - foreach(ConfigurationNode conf in parent.Configurations) - { - m_Configurations[conf.NameAndPlatform] = (ConfigurationNode) conf.Clone(); - } - } - } - } - - /// - /// Gets the GUID. - /// - /// The GUID. - public Guid Guid - { - get - { - return m_Guid; - } - } - - public string DebugStartParameters - { + } + } + + /// + /// Gets the Authors list. + /// + /// The list of the project's authors. + public List Authors + { + get + { + return m_Authors; + } + } + + /// + /// Gets the files. + /// + /// The files. + public FilesNode Files + { + get + { + return m_Files; + } + } + + /// + /// Gets or sets the parent. + /// + /// The parent. + public override IDataNode Parent + { + get + { + return base.Parent; + } + set + { + base.Parent = value; + if(base.Parent is SolutionNode && m_Configurations.Count < 1) + { + SolutionNode parent = (SolutionNode)base.Parent; + foreach(ConfigurationNode conf in parent.Configurations) + { + m_Configurations[conf.NameAndPlatform] = (ConfigurationNode) conf.Clone(); + } + } + } + } + + /// + /// Gets the GUID. + /// + /// The GUID. + public Guid Guid + { + get + { + return m_Guid; + } + } + + public string DebugStartParameters + { get { return m_DebugStartParameters; } - } - - #endregion - - #region Private Methods - - private void HandleConfiguration(ConfigurationNode conf) - { - if(String.Compare(conf.Name, "all", true) == 0) //apply changes to all, this may not always be applied first, - //so it *may* override changes to the same properties for configurations defines at the project level - { - foreach(ConfigurationNode confNode in m_Configurations.Values) - { - conf.CopyTo(confNode);//update the config templates defines at the project level with the overrides - } - } - if(m_Configurations.ContainsKey(conf.NameAndPlatform)) - { - ConfigurationNode parentConf = m_Configurations[conf.NameAndPlatform]; - conf.CopyTo(parentConf);//update the config templates defines at the project level with the overrides - } - else - { - m_Configurations[conf.NameAndPlatform] = conf; - } - } - - #endregion - - #region Public Methods - - /// - /// Parses the specified node. - /// - /// The node. - public override void Parse(XmlNode node) - { - m_Name = Helper.AttributeValue(node, "name", m_Name); - m_Path = Helper.AttributeValue(node, "path", m_Path); - m_FilterGroups = Helper.AttributeValue(node, "filterGroups", m_FilterGroups); - m_Version = Helper.AttributeValue(node, "version", m_Version); - m_AppIcon = Helper.AttributeValue(node, "icon", m_AppIcon); + } + + #endregion + + #region Private Methods + + private void HandleConfiguration(ConfigurationNode conf) + { + if(String.Compare(conf.Name, "all", true) == 0) //apply changes to all, this may not always be applied first, + //so it *may* override changes to the same properties for configurations defines at the project level + { + foreach(ConfigurationNode confNode in m_Configurations.Values) + { + conf.CopyTo(confNode);//update the config templates defines at the project level with the overrides + } + } + if(m_Configurations.ContainsKey(conf.NameAndPlatform)) + { + ConfigurationNode parentConf = m_Configurations[conf.NameAndPlatform]; + conf.CopyTo(parentConf);//update the config templates defines at the project level with the overrides + } + else + { + m_Configurations[conf.NameAndPlatform] = conf; + } + } + + #endregion + + #region Public Methods + + /// + /// Parses the specified node. + /// + /// The node. + public override void Parse(XmlNode node) + { + m_Name = Helper.AttributeValue(node, "name", m_Name); + m_Path = Helper.AttributeValue(node, "path", m_Path); + m_FilterGroups = Helper.AttributeValue(node, "filterGroups", m_FilterGroups); + m_Version = Helper.AttributeValue(node, "version", m_Version); + m_AppIcon = Helper.AttributeValue(node, "icon", m_AppIcon); m_ConfigFile = Helper.AttributeValue(node, "configFile", m_ConfigFile); - m_DesignerFolder = Helper.AttributeValue(node, "designerFolder", m_DesignerFolder); - m_AssemblyName = Helper.AttributeValue(node, "assemblyName", m_AssemblyName); - m_Language = Helper.AttributeValue(node, "language", m_Language); - m_Type = (ProjectType)Helper.EnumAttributeValue(node, "type", typeof(ProjectType), m_Type); - m_Runtime = (ClrRuntime)Helper.EnumAttributeValue(node, "runtime", typeof(ClrRuntime), m_Runtime); + m_DesignerFolder = Helper.AttributeValue(node, "designerFolder", m_DesignerFolder); + m_AssemblyName = Helper.AttributeValue(node, "assemblyName", m_AssemblyName); + m_Language = Helper.AttributeValue(node, "language", m_Language); + m_Type = (ProjectType)Helper.EnumAttributeValue(node, "type", typeof(ProjectType), m_Type); + m_Runtime = (ClrRuntime)Helper.EnumAttributeValue(node, "runtime", typeof(ClrRuntime), m_Runtime); m_Framework = (FrameworkVersion)Helper.EnumAttributeValue(node, "frameworkVersion", typeof(FrameworkVersion), m_Framework); - m_StartupObject = Helper.AttributeValue(node, "startupObject", m_StartupObject); - m_RootNamespace = Helper.AttributeValue(node, "rootNamespace", m_RootNamespace); - + m_StartupObject = Helper.AttributeValue(node, "startupObject", m_StartupObject); + m_RootNamespace = Helper.AttributeValue(node, "rootNamespace", m_RootNamespace); + int hash = m_Name.GetHashCode(); - Guid guidByHash = new Guid(hash, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - string guid = Helper.AttributeValue(node, "guid", guidByHash.ToString()); - m_Guid = new Guid(guid); + Guid guidByHash = new Guid(hash, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + string guid = Helper.AttributeValue(node, "guid", guidByHash.ToString()); + m_Guid = new Guid(guid); m_GenerateAssemblyInfoFile = Helper.ParseBoolean(node, "generateAssemblyInfoFile", false); - m_DebugStartParameters = Helper.AttributeValue(node, "debugStartParameters", string.Empty); - - if(string.IsNullOrEmpty(m_AssemblyName)) - { - m_AssemblyName = m_Name; - } - - if(string.IsNullOrEmpty(m_RootNamespace)) - { - m_RootNamespace = m_Name; - } - - m_FullPath = m_Path; - try - { - m_FullPath = Helper.ResolvePath(m_FullPath); - } - catch - { - throw new WarningException("Could not resolve Solution path: {0}", m_Path); - } - - Kernel.Instance.CurrentWorkingDirectory.Push(); - try - { - Helper.SetCurrentDir(m_FullPath); - - if( node == null ) - { - throw new ArgumentNullException("node"); - } - - foreach(XmlNode child in node.ChildNodes) - { - IDataNode dataNode = Kernel.Instance.ParseNode(child, this); - if(dataNode is ConfigurationNode) - { - HandleConfiguration((ConfigurationNode)dataNode); - } - else if(dataNode is ReferencePathNode) - { + m_DebugStartParameters = Helper.AttributeValue(node, "debugStartParameters", string.Empty); + + if(string.IsNullOrEmpty(m_AssemblyName)) + { + m_AssemblyName = m_Name; + } + + if(string.IsNullOrEmpty(m_RootNamespace)) + { + m_RootNamespace = m_Name; + } + + m_FullPath = m_Path; + try + { + m_FullPath = Helper.ResolvePath(m_FullPath); + } + catch + { + throw new WarningException("Could not resolve Solution path: {0}", m_Path); + } + + Kernel.Instance.CurrentWorkingDirectory.Push(); + try + { + Helper.SetCurrentDir(m_FullPath); + + if( node == null ) + { + throw new ArgumentNullException("node"); + } + + foreach(XmlNode child in node.ChildNodes) + { + IDataNode dataNode = Kernel.Instance.ParseNode(child, this); + if(dataNode is ConfigurationNode) + { + HandleConfiguration((ConfigurationNode)dataNode); + } + else if(dataNode is ReferencePathNode) + { m_ReferencePaths.Add((ReferencePathNode)dataNode); - } - else if(dataNode is ReferenceNode) - { + } + else if(dataNode is ReferenceNode) + { m_References.Add((ReferenceNode)dataNode); - } - else if(dataNode is AuthorNode) - { + } + else if(dataNode is AuthorNode) + { m_Authors.Add((AuthorNode)dataNode); - } - else if(dataNode is FilesNode) - { - m_Files = (FilesNode)dataNode; - } - } - } - finally - { - Kernel.Instance.CurrentWorkingDirectory.Pop(); - } - } - - #endregion + } + else if(dataNode is FilesNode) + { + m_Files = (FilesNode)dataNode; + } + } + } + finally + { + Kernel.Instance.CurrentWorkingDirectory.Pop(); + } + } + + #endregion #region IComparable Members @@ -582,6 +582,6 @@ namespace Prebuild.Core.Nodes return m_Name.CompareTo(that.m_Name); } - #endregion - } + #endregion + } } diff --git a/Prebuild/src/Core/Nodes/ReferenceNode.cs b/Prebuild/src/Core/Nodes/ReferenceNode.cs index 9c5d1a3..9afb512 100644 --- a/Prebuild/src/Core/Nodes/ReferenceNode.cs +++ b/Prebuild/src/Core/Nodes/ReferenceNode.cs @@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -* Redistributions of source code must retain the above copyright notice, this list of conditions - and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright notice, this list of conditions - and the following disclaimer in the documentation and/or other materials provided with the - distribution. -* The name of the author may not be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +* Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions + and the following disclaimer in the documentation and/or other materials provided with the + distribution. +* The name of the author may not be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY @@ -32,104 +32,104 @@ using Prebuild.Core.Utilities; namespace Prebuild.Core.Nodes { - /// - /// - /// - [DataNode("Reference")] - public class ReferenceNode : DataNode, IComparable - { - #region Fields - - private string m_Name = "unknown"; - private string m_Path; - private string m_LocalCopy; - private string m_Version; - - #endregion - - #region Properties - - /// - /// Gets the name. - /// - /// The name. - public string Name - { - get - { - return m_Name; - } - } - - /// - /// Gets the path. - /// - /// The path. - public string Path - { - get - { - return m_Path; - } - } - - /// - /// Gets a value indicating whether [local copy specified]. - /// - /// true if [local copy specified]; otherwise, false. - public bool LocalCopySpecified - { - get - { - return ( m_LocalCopy != null && m_LocalCopy.Length == 0); - } - } - - /// - /// Gets a value indicating whether [local copy]. - /// - /// true if [local copy]; otherwise, false. - public bool LocalCopy - { - get - { - if( m_LocalCopy == null) - { - return false; - } - return bool.Parse(m_LocalCopy); - } - } - - /// - /// Gets the version. - /// - /// The version. - public string Version - { - get - { - return m_Version; - } - } - - #endregion - - #region Public Methods - - /// - /// Parses the specified node. - /// - /// The node. - public override void Parse(XmlNode node) - { - m_Name = Helper.AttributeValue(node, "name", m_Name); - m_Path = Helper.AttributeValue(node, "path", m_Path); - m_LocalCopy = Helper.AttributeValue(node, "localCopy", m_LocalCopy); - m_Version = Helper.AttributeValue(node, "version", m_Version); - } - - #endregion + /// + /// + /// + [DataNode("Reference")] + public class ReferenceNode : DataNode, IComparable + { + #region Fields + + private string m_Name = "unknown"; + private string m_Path; + private string m_LocalCopy; + private string m_Version; + + #endregion + + #region Properties + + /// + /// Gets the name. + /// + /// The name. + public string Name + { + get + { + return m_Name; + } + } + + /// + /// Gets the path. + /// + /// The path. + public string Path + { + get + { + return m_Path; + } + } + + /// + /// Gets a value indicating whether [local copy specified]. + /// + /// true if [local copy specified]; otherwise, false. + public bool LocalCopySpecified + { + get + { + return ( m_LocalCopy != null && m_LocalCopy.Length == 0); + } + } + + /// + /// Gets a value indicating whether [local copy]. + /// + /// true if [local copy]; otherwise, false. + public bool LocalCopy + { + get + { + if( m_LocalCopy == null) + { + return false; + } + return bool.Parse(m_LocalCopy); + } + } + + /// + /// Gets the version. + /// + /// The version. + public string Version + { + get + { + return m_Version; + } + } + + #endregion + + #region Public Methods + + /// + /// Parses the specified node. + /// + /// The node. + public override void Parse(XmlNode node) + { + m_Name = Helper.AttributeValue(node, "name", m_Name); + m_Path = Helper.AttributeValue(node, "path", m_Path); + m_LocalCopy = Helper.AttributeValue(node, "localCopy", m_LocalCopy); + m_Version = Helper.AttributeValue(node, "version", m_Version); + } + + #endregion #region IComparable Members @@ -140,5 +140,5 @@ namespace Prebuild.Core.Nodes } #endregion - } + } } diff --git a/Prebuild/src/Core/Nodes/ReferencePathNode.cs b/Prebuild/src/Core/Nodes/ReferencePathNode.cs index 7331cd7..29c63c5 100644 --- a/Prebuild/src/Core/Nodes/ReferencePathNode.cs +++ b/Prebuild/src/Core/Nodes/ReferencePathNode.cs @@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -* Redistributions of source code must retain the above copyright notice, this list of conditions - and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright notice, this list of conditions - and the following disclaimer in the documentation and/or other materials provided with the - distribution. -* The name of the author may not be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +* Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions + and the following disclaimer in the documentation and/or other materials provided with the + distribution. +* The name of the author may not be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY @@ -32,57 +32,57 @@ using Prebuild.Core.Utilities; namespace Prebuild.Core.Nodes { - /// - /// - /// - [DataNode("ReferencePath")] - public class ReferencePathNode : DataNode, IComparable - { - #region Fields - - private string m_Path; - - #endregion - - #region Properties - - /// - /// Gets the path. - /// - /// The path. - public string Path - { - get - { - return m_Path; - } - } - - #endregion - - #region Public Methods - - /// - /// Parses the specified node. - /// - /// The node. - public override void Parse(XmlNode node) - { - if( node == null ) - { - throw new ArgumentNullException("node"); - } - - m_Path = Helper.InterpolateForEnvironmentVariables(node.InnerText); - if(m_Path == null) - { - m_Path = ""; - } - - m_Path = m_Path.Trim(); - } - - #endregion + /// + /// + /// + [DataNode("ReferencePath")] + public class ReferencePathNode : DataNode, IComparable + { + #region Fields + + private string m_Path; + + #endregion + + #region Properties + + /// + /// Gets the path. + /// + /// The path. + public string Path + { + get + { + return m_Path; + } + } + + #endregion + + #region Public Methods + + /// + /// Parses the specified node. + /// + /// The node. + public override void Parse(XmlNode node) + { + if( node == null ) + { + throw new ArgumentNullException("node"); + } + + m_Path = Helper.InterpolateForEnvironmentVariables(node.InnerText); + if(m_Path == null) + { + m_Path = ""; + } + + m_Path = m_Path.Trim(); + } + + #endregion #region IComparable Members @@ -93,5 +93,5 @@ namespace Prebuild.Core.Nodes } #endregion - } + } } diff --git a/Prebuild/src/Core/Nodes/SolutionNode.cs b/Prebuild/src/Core/Nodes/SolutionNode.cs index 10c0223..e1d5b3b 100644 --- a/Prebuild/src/Core/Nodes/SolutionNode.cs +++ b/Prebuild/src/Core/Nodes/SolutionNode.cs @@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -* Redistributions of source code must retain the above copyright notice, this list of conditions - and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright notice, this list of conditions - and the following disclaimer in the documentation and/or other materials provided with the - distribution. -* The name of the author may not be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +* Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions + and the following disclaimer in the documentation and/or other materials provided with the + distribution. +* The name of the author may not be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY @@ -34,35 +34,35 @@ using Prebuild.Core.Utilities; namespace Prebuild.Core.Nodes { - /// - /// - /// - [DataNode("Solution")] + /// + /// + /// + [DataNode("Solution")] [DataNode("EmbeddedSolution")] [DebuggerDisplay("{Name}")] - public class SolutionNode : DataNode - { - #region Fields + public class SolutionNode : DataNode + { + #region Fields private Guid m_Guid = Guid.NewGuid(); - private string m_Name = "unknown"; - private string m_Path = ""; - private string m_FullPath = ""; - private string m_ActiveConfig; + private string m_Name = "unknown"; + private string m_Path = ""; + private string m_FullPath = ""; + private string m_ActiveConfig; private string m_Version = "1.0.0"; - - private OptionsNode m_Options; - private FilesNode m_Files; + + private OptionsNode m_Options; + private FilesNode m_Files; private readonly ConfigurationNodeCollection m_Configurations = new ConfigurationNodeCollection(); private readonly Dictionary m_Projects = new Dictionary(); private readonly Dictionary m_DatabaseProjects = new Dictionary(); private readonly List m_ProjectsOrder = new List(); private readonly Dictionary m_Solutions = new Dictionary(); - private CleanupNode m_Cleanup; + private CleanupNode m_Cleanup; - #endregion + #endregion - #region Properties + #region Properties public override IDataNode Parent { get @@ -84,142 +84,142 @@ namespace Prebuild.Core.Nodes } } - public CleanupNode Cleanup - { - get - { - return m_Cleanup; - } + public CleanupNode Cleanup + { + get + { + return m_Cleanup; + } set { m_Cleanup = value; } - } + } public Guid Guid { - get - { - return m_Guid; + get + { + return m_Guid; } set { - m_Guid = value; + m_Guid = value; + } + } + /// + /// Gets or sets the active config. + /// + /// The active config. + public string ActiveConfig + { + get + { + return m_ActiveConfig; + } + set + { + m_ActiveConfig = value; + } + } + + /// + /// Gets the name. + /// + /// The name. + public string Name + { + get + { + return m_Name; + } + } + + /// + /// Gets the path. + /// + /// The path. + public string Path + { + get + { + return m_Path; + } + } + + /// + /// Gets the full path. + /// + /// The full path. + public string FullPath + { + get + { + return m_FullPath; + } + } + + /// + /// Gets the version. + /// + /// The version. + public string Version + { + get + { + return m_Version; + } + } + + /// + /// Gets the options. + /// + /// The options. + public OptionsNode Options + { + get + { + return m_Options; + } + } + + /// + /// Gets the files. + /// + /// The files. + public FilesNode Files + { + get + { + return m_Files; + } + } + + /// + /// Gets the configurations. + /// + /// The configurations. + public ConfigurationNodeCollection Configurations + { + get + { + ConfigurationNodeCollection tmp = new ConfigurationNodeCollection(); + tmp.AddRange(ConfigurationsTable); + return tmp; + } + } + + /// + /// Gets the configurations table. + /// + /// The configurations table. + public ConfigurationNodeCollection ConfigurationsTable + { + get + { + return m_Configurations; } } - /// - /// Gets or sets the active config. - /// - /// The active config. - public string ActiveConfig - { - get - { - return m_ActiveConfig; - } - set - { - m_ActiveConfig = value; - } - } - - /// - /// Gets the name. - /// - /// The name. - public string Name - { - get - { - return m_Name; - } - } - - /// - /// Gets the path. - /// - /// The path. - public string Path - { - get - { - return m_Path; - } - } - - /// - /// Gets the full path. - /// - /// The full path. - public string FullPath - { - get - { - return m_FullPath; - } - } - - /// - /// Gets the version. - /// - /// The version. - public string Version - { - get - { - return m_Version; - } - } - - /// - /// Gets the options. - /// - /// The options. - public OptionsNode Options - { - get - { - return m_Options; - } - } - - /// - /// Gets the files. - /// - /// The files. - public FilesNode Files - { - get - { - return m_Files; - } - } - - /// - /// Gets the configurations. - /// - /// The configurations. - public ConfigurationNodeCollection Configurations - { - get - { - ConfigurationNodeCollection tmp = new ConfigurationNodeCollection(); - tmp.AddRange(ConfigurationsTable); - return tmp; - } - } - - /// - /// Gets the configurations table. - /// - /// The configurations table. - public ConfigurationNodeCollection ConfigurationsTable - { - get - { - return m_Configurations; - } - } /// /// Gets the database projects. /// @@ -250,106 +250,106 @@ namespace Prebuild.Core.Nodes return m_Solutions; } } - /// - /// Gets the projects. - /// - /// The projects. - public ICollection Projects - { - get - { + /// + /// Gets the projects. + /// + /// The projects. + public ICollection Projects + { + get + { List tmp = new List(m_Projects.Values); tmp.Sort(); return tmp; - } - } - - /// - /// Gets the projects table. - /// - /// The projects table. - public Dictionary ProjectsTable - { - get - { - return m_Projects; - } - } - - /// - /// Gets the projects table. - /// - /// The projects table. - public List ProjectsTableOrder - { - get - { - return m_ProjectsOrder; - } - } - - #endregion - - #region Public Methods - - /// - /// Parses the specified node. - /// - /// The node. - public override void Parse(XmlNode node) - { - m_Name = Helper.AttributeValue(node, "name", m_Name); - m_ActiveConfig = Helper.AttributeValue(node, "activeConfig", m_ActiveConfig); - m_Path = Helper.AttributeValue(node, "path", m_Path); - m_Version = Helper.AttributeValue(node, "version", m_Version); - - m_FullPath = m_Path; - try - { - m_FullPath = Helper.ResolvePath(m_FullPath); - } - catch - { - throw new WarningException("Could not resolve solution path: {0}", m_Path); - } - - Kernel.Instance.CurrentWorkingDirectory.Push(); - try - { - Helper.SetCurrentDir(m_FullPath); - - if( node == null ) - { - throw new ArgumentNullException("node"); - } - - foreach(XmlNode child in node.ChildNodes) - { - IDataNode dataNode = Kernel.Instance.ParseNode(child, this); - if(dataNode is OptionsNode) - { - m_Options = (OptionsNode)dataNode; - } - else if(dataNode is FilesNode) - { - m_Files = (FilesNode)dataNode; - } - else if(dataNode is ConfigurationNode) - { - ConfigurationNode configurationNode = (ConfigurationNode) dataNode; - m_Configurations[configurationNode.NameAndPlatform] = configurationNode; - - // If the active configuration is null, then we populate it. - if (ActiveConfig == null) - { - ActiveConfig = configurationNode.Name; - } - } - else if(dataNode is ProjectNode) - { - m_Projects[((ProjectNode)dataNode).Name] = (ProjectNode) dataNode; - m_ProjectsOrder.Add((ProjectNode)dataNode); - } + } + } + + /// + /// Gets the projects table. + /// + /// The projects table. + public Dictionary ProjectsTable + { + get + { + return m_Projects; + } + } + + /// + /// Gets the projects table. + /// + /// The projects table. + public List ProjectsTableOrder + { + get + { + return m_ProjectsOrder; + } + } + + #endregion + + #region Public Methods + + /// + /// Parses the specified node. + /// + /// The node. + public override void Parse(XmlNode node) + { + m_Name = Helper.AttributeValue(node, "name", m_Name); + m_ActiveConfig = Helper.AttributeValue(node, "activeConfig", m_ActiveConfig); + m_Path = Helper.AttributeValue(node, "path", m_Path); + m_Version = Helper.AttributeValue(node, "version", m_Version); + + m_FullPath = m_Path; + try + { + m_FullPath = Helper.ResolvePath(m_FullPath); + } + catch + { + throw new WarningException("Could not resolve solution path: {0}", m_Path); + } + + Kernel.Instance.CurrentWorkingDirectory.Push(); + try + { + Helper.SetCurrentDir(m_FullPath); + + if( node == null ) + { + throw new ArgumentNullException("node"); + } + + foreach(XmlNode child in node.ChildNodes) + { + IDataNode dataNode = Kernel.Instance.ParseNode(child, this); + if(dataNode is OptionsNode) + { + m_Options = (OptionsNode)dataNode; + } + else if(dataNode is FilesNode) + { + m_Files = (FilesNode)dataNode; + } + else if(dataNode is ConfigurationNode) + { + ConfigurationNode configurationNode = (ConfigurationNode) dataNode; + m_Configurations[configurationNode.NameAndPlatform] = configurationNode; + + // If the active configuration is null, then we populate it. + if (ActiveConfig == null) + { + ActiveConfig = configurationNode.Name; + } + } + else if(dataNode is ProjectNode) + { + m_Projects[((ProjectNode)dataNode).Name] = (ProjectNode) dataNode; + m_ProjectsOrder.Add((ProjectNode)dataNode); + } else if(dataNode is SolutionNode) { m_Solutions[((SolutionNode)dataNode).Name] = (SolutionNode) dataNode; @@ -369,14 +369,14 @@ namespace Prebuild.Core.Nodes throw new WarningException("There can only be one Cleanup node."); m_Cleanup = (CleanupNode)dataNode; } - } - } - finally - { - Kernel.Instance.CurrentWorkingDirectory.Pop(); - } - } - - #endregion - } + } + } + finally + { + Kernel.Instance.CurrentWorkingDirectory.Pop(); + } + } + + #endregion + } } -- cgit v1.1