From 1e44ec84bd90ec9078027d1d9d78e83c7d305f2a Mon Sep 17 00:00:00 2001 From: BlueWall Date: Tue, 31 Aug 2010 17:02:36 -0400 Subject: Build system upgrade: Upgrading Prebuild.exe to correctly construct build solutions for crossplatform tools such as xbuild, monodevelop and nant. NOTE: Module prebuild files will need modification to work, as the prebuild must correctly define the reference path for all assemblies shipped in the OpenSimulator ./bin directory. These include assemblies such as XMLRPC.dll, OpenMetaverse.dll, Nini.dll, etc. . The entries should follow the form: See the distributed prebuild.xml for further examples. Crossplatform tools: xbuild and monodevelop use the vs2008 OpenSim.sln and the .csproj files in each namespace. Changes to the Prebuild.exe are against svn 322 and are included in a patch attached to the mantis. And the dnpb source are available@ svn co https://dnpb.svn.sourceforge.net/svnroot/dnpb dnpb The patches are pending application by the dnpb team. After which, the un-modified upstream Prebuild.exe will work as expected. --- Prebuild/src/Core/Nodes/AuthorNode.cs | 89 ---- Prebuild/src/Core/Nodes/ConfigurationNode.cs | 178 ------- Prebuild/src/Core/Nodes/DataNode.cs | 117 ---- Prebuild/src/Core/Nodes/DatabaseProjectNode.cs | 94 ---- Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs | 63 --- Prebuild/src/Core/Nodes/DescriptionNode.cs | 89 ---- Prebuild/src/Core/Nodes/ExcludeNode.cs | 89 ---- Prebuild/src/Core/Nodes/FileNode.cs | 271 ---------- Prebuild/src/Core/Nodes/FilesNode.cs | 247 --------- Prebuild/src/Core/Nodes/MatchNode.cs | 330 ------------ Prebuild/src/Core/Nodes/OptionsNode.cs | 644 ----------------------- Prebuild/src/Core/Nodes/ProcessNode.cs | 110 ---- Prebuild/src/Core/Nodes/ProjectNode.cs | 580 -------------------- Prebuild/src/Core/Nodes/ReferenceNode.cs | 144 ----- Prebuild/src/Core/Nodes/ReferencePathNode.cs | 99 ---- Prebuild/src/Core/Nodes/SolutionNode.cs | 358 ------------- 16 files changed, 3502 deletions(-) delete mode 100644 Prebuild/src/Core/Nodes/AuthorNode.cs delete mode 100644 Prebuild/src/Core/Nodes/ConfigurationNode.cs delete mode 100644 Prebuild/src/Core/Nodes/DataNode.cs delete mode 100644 Prebuild/src/Core/Nodes/DatabaseProjectNode.cs delete mode 100644 Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs delete mode 100644 Prebuild/src/Core/Nodes/DescriptionNode.cs delete mode 100644 Prebuild/src/Core/Nodes/ExcludeNode.cs delete mode 100644 Prebuild/src/Core/Nodes/FileNode.cs delete mode 100644 Prebuild/src/Core/Nodes/FilesNode.cs delete mode 100644 Prebuild/src/Core/Nodes/MatchNode.cs delete mode 100644 Prebuild/src/Core/Nodes/OptionsNode.cs delete mode 100644 Prebuild/src/Core/Nodes/ProcessNode.cs delete mode 100644 Prebuild/src/Core/Nodes/ProjectNode.cs delete mode 100644 Prebuild/src/Core/Nodes/ReferenceNode.cs delete mode 100644 Prebuild/src/Core/Nodes/ReferencePathNode.cs delete mode 100644 Prebuild/src/Core/Nodes/SolutionNode.cs (limited to 'Prebuild/src/Core/Nodes') diff --git a/Prebuild/src/Core/Nodes/AuthorNode.cs b/Prebuild/src/Core/Nodes/AuthorNode.cs deleted file mode 100644 index 20e72c0..0000000 --- a/Prebuild/src/Core/Nodes/AuthorNode.cs +++ /dev/null @@ -1,89 +0,0 @@ -#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; -using System.Collections.Specialized; -using System.Xml; - -using Prebuild.Core.Attributes; -using Prebuild.Core.Interfaces; -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 - } -} diff --git a/Prebuild/src/Core/Nodes/ConfigurationNode.cs b/Prebuild/src/Core/Nodes/ConfigurationNode.cs deleted file mode 100644 index 67d78d5..0000000 --- a/Prebuild/src/Core/Nodes/ConfigurationNode.cs +++ /dev/null @@ -1,178 +0,0 @@ -#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; -using System.Xml; - -using Prebuild.Core.Attributes; -using Prebuild.Core.Interfaces; -using Prebuild.Core.Utilities; - -namespace Prebuild.Core.Nodes -{ - /// - /// - /// - [DataNode("Configuration")] - public class ConfigurationNode : DataNode, ICloneable, IComparable - { - #region Fields - - private string m_Name = "unknown"; - 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); - } - } - } - } - - /// - /// Gets the name. - /// - /// The name. - public string Name - { - get - { - return m_Name; - } - } - - /// - /// 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); - 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; - m_Options.CopyTo(ret.m_Options); - return ret; - } - - #endregion - - #region IComparable Members - - public int CompareTo(object obj) - { - ConfigurationNode that = (ConfigurationNode) obj; - return this.m_Name.CompareTo(that.m_Name); - } - - #endregion - } -} diff --git a/Prebuild/src/Core/Nodes/DataNode.cs b/Prebuild/src/Core/Nodes/DataNode.cs deleted file mode 100644 index 763e6c3..0000000 --- a/Prebuild/src/Core/Nodes/DataNode.cs +++ /dev/null @@ -1,117 +0,0 @@ -#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; -using System.Xml; - -using Prebuild.Core.Attributes; -using Prebuild.Core.Interfaces; -using System.IO; - -namespace Prebuild.Core.Nodes -{ - /// - /// - /// - public abstract class DataNode : IDataNode - { - #region Fields - - private IDataNode parent; - string[] m_WebTypes = new string[] { "aspx", "ascx", "master", "ashx", "asmx" }; - - #endregion - - #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) - { - if (path.EndsWith(string.Format("{0}{1}", type, extension))) - { - return SubType.CodeBehind; - } - } - } - return SubType.Code; - } - #endregion - } -} diff --git a/Prebuild/src/Core/Nodes/DatabaseProjectNode.cs b/Prebuild/src/Core/Nodes/DatabaseProjectNode.cs deleted file mode 100644 index 27c2051..0000000 --- a/Prebuild/src/Core/Nodes/DatabaseProjectNode.cs +++ /dev/null @@ -1,94 +0,0 @@ -using System; -using System.Collections; -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 deleted file mode 100644 index 845db24..0000000 --- a/Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs +++ /dev/null @@ -1,63 +0,0 @@ -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 deleted file mode 100644 index 353a5ae..0000000 --- a/Prebuild/src/Core/Nodes/DescriptionNode.cs +++ /dev/null @@ -1,89 +0,0 @@ -#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; -using System.Collections.Specialized; -using System.Xml; - -using Prebuild.Core.Attributes; -using Prebuild.Core.Interfaces; -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 - } -} diff --git a/Prebuild/src/Core/Nodes/ExcludeNode.cs b/Prebuild/src/Core/Nodes/ExcludeNode.cs deleted file mode 100644 index 7f04cba..0000000 --- a/Prebuild/src/Core/Nodes/ExcludeNode.cs +++ /dev/null @@ -1,89 +0,0 @@ -#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; -using System.Xml; - -using Prebuild.Core.Attributes; -using Prebuild.Core.Interfaces; -using Prebuild.Core.Utilities; - -namespace Prebuild.Core.Nodes -{ - /// - /// - /// - [DataNode("Exclude")] - public class ExcludeNode : DataNode - { - #region Fields - - private string m_Pattern = ""; - - #endregion - - #region Properties - - /// - /// Gets the name. - /// - /// The name. - public string Name - { - get - { - return m_Pattern; - } - } - - /// - /// Gets the pattern. - /// - /// The pattern. - public string Pattern - { - get - { - return m_Pattern; - } - } - - #endregion - - #region Public Methods - - /// - /// 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 - } -} diff --git a/Prebuild/src/Core/Nodes/FileNode.cs b/Prebuild/src/Core/Nodes/FileNode.cs deleted file mode 100644 index 1520fcb..0000000 --- a/Prebuild/src/Core/Nodes/FileNode.cs +++ /dev/null @@ -1,271 +0,0 @@ -#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; -using System.IO; -using System.Xml; - -using Prebuild.Core.Attributes; -using Prebuild.Core.Interfaces; -using Prebuild.Core.Utilities; -using Prebuild.Core.Targets; - -namespace Prebuild.Core.Nodes -{ - /// - /// - /// - public enum BuildAction - { - /// - /// - /// - None, - /// - /// - /// - Compile, - /// - /// - /// - Content, - /// - /// - /// - EmbeddedResource - } - - /// - /// - /// - 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; - 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; - } - } - - /// - /// - /// - /// - /// - public bool PreservePath - { - get - { - return m_PreservePath; - } - } - - #endregion - - #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); - - 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); - } - } - - #endregion - } -} diff --git a/Prebuild/src/Core/Nodes/FilesNode.cs b/Prebuild/src/Core/Nodes/FilesNode.cs deleted file mode 100644 index dc306c2..0000000 --- a/Prebuild/src/Core/Nodes/FilesNode.cs +++ /dev/null @@ -1,247 +0,0 @@ -#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; -using System.Collections; -using System.Collections.Specialized; -using System.Xml; - -using Prebuild.Core.Attributes; -using Prebuild.Core.Interfaces; -using System.IO; - -namespace Prebuild.Core.Nodes -{ - /// - /// - /// - [DataNode("Files")] - public class FilesNode : DataNode - { - #region Fields - - private StringCollection m_Files; - private Hashtable m_BuildActions; - private Hashtable m_SubTypes; - private Hashtable m_ResourceNames; - private Hashtable m_CopyToOutputs; - private Hashtable m_Links; - private Hashtable m_LinkPaths; - private Hashtable m_PreservePaths; - - #endregion - - #region Constructors - - /// - /// - /// - public FilesNode() - { - m_Files = new StringCollection(); - m_BuildActions = new Hashtable(); - m_SubTypes = new Hashtable(); - m_ResourceNames = new Hashtable(); - m_CopyToOutputs = new Hashtable(); - m_Links = new Hashtable(); - m_LinkPaths = new Hashtable(); - m_PreservePaths = new Hashtable(); - } - - #endregion - - #region Properties - - /// - /// - /// - public int Count - { - get - { - return m_Files.Count; - } - } - - #endregion - - #region Public Methods - - /// - /// - /// - /// - /// - public BuildAction GetBuildAction(string file) - { - if(!m_BuildActions.ContainsKey(file)) - { - return BuildAction.Compile; - } - - return (BuildAction)m_BuildActions[file]; - } - - public CopyToOutput GetCopyToOutput(string file) - { - if (!this.m_CopyToOutputs.ContainsKey(file)) - { - return CopyToOutput.Never; - } - return (CopyToOutput) this.m_CopyToOutputs[file]; - } - - public bool GetIsLink(string file) - { - if (!this.m_Links.ContainsKey(file)) - { - return false; - } - return (bool) this.m_Links[file]; - } - - public string GetLinkPath( string file ) - { - if ( !this.m_LinkPaths.ContainsKey( file ) ) - { - return string.Empty; - } - return (string)this.m_LinkPaths[ file ]; - } - - /// - /// - /// - /// - /// - public SubType GetSubType(string file) - { - if(!m_SubTypes.ContainsKey(file)) - { - return SubType.Code; - } - - return (SubType)m_SubTypes[file]; - } - - /// - /// - /// - /// - /// - public string GetResourceName(string file) - { - if(!m_ResourceNames.ContainsKey(file)) - { - return ""; - } - - return (string)m_ResourceNames[file]; - } - - /// - /// - /// - /// - /// - public bool GetPreservePath( string file ) - { - if ( !m_PreservePaths.ContainsKey( file ) ) - { - return false; - } - - return (bool)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; - this.m_PreservePaths[ fileNode.Path ] = fileNode.PreservePath; - this.m_Links[ fileNode.Path ] = fileNode.IsLink; - this.m_LinkPaths[ fileNode.Path ] = fileNode.LinkPath; - this.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); - m_BuildActions[ file ] = matchNode.BuildAction == null ? GetBuildActionByFileName(file) : matchNode.BuildAction; - m_SubTypes[file] = matchNode.SubType == null ? GetSubTypeByFileName(file) : matchNode.SubType.Value; - m_ResourceNames[ file ] = matchNode.ResourceName; - this.m_PreservePaths[ file ] = matchNode.PreservePath; - this.m_Links[ file ] = matchNode.IsLink; - this.m_LinkPaths[ file ] = matchNode.LinkPath; - this.m_CopyToOutputs[ file ] = matchNode.CopyToOutput; - - } - } - } - } - } - - // TODO: Check in to why StringCollection's enumerator doesn't implement - // IEnumerator? - /// - /// - /// - /// - public StringEnumerator GetEnumerator() - { - return m_Files.GetEnumerator(); - } - - #endregion - - } -} diff --git a/Prebuild/src/Core/Nodes/MatchNode.cs b/Prebuild/src/Core/Nodes/MatchNode.cs deleted file mode 100644 index 656d7d0..0000000 --- a/Prebuild/src/Core/Nodes/MatchNode.cs +++ /dev/null @@ -1,330 +0,0 @@ -#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; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.IO; -using System.Text.RegularExpressions; -using System.Xml; - -using Prebuild.Core.Attributes; -using Prebuild.Core.Interfaces; -using Prebuild.Core.Utilities; -using System.Collections; - -namespace Prebuild.Core.Nodes -{ - /// - /// - /// - [DataNode("Match")] - public class MatchNode : DataNode - { - #region Fields - - private readonly StringCollection m_Files = new StringCollection(); - 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 readonly List m_Exclusions = new List(); - - #endregion - - #region Properties - - /// - /// - /// - public StringCollection Files - { - get - { - return m_Files; - } - } - - /// - /// - /// - public BuildAction? BuildAction - { - get - { - return m_BuildAction; - } - } - - /// - /// - /// - public SubType? SubType - { - get - { - return m_SubType; - } - } - - 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 string ResourceName - { - get - { - return m_ResourceName; - } - } - - public bool PreservePath - { - get - { - return m_PreservePath; - } - } - - #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; - Boolean excludeFile; - try - { - string[] files; - - if(!useRegex) - { - files = Directory.GetFiles(path, pattern); - if(files != null) - { - string fileTemp; - foreach (string file in files) - { - excludeFile = false; - 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 ) - { - Regex exRegEx = new Regex( exclude.Pattern ); - match = exRegEx.Match( file ); - excludeFile |= match.Success; - } - - if ( !excludeFile ) - { - m_Files.Add( fileTemp ); - } - - } - } - else - { - return; - } - } - else - { - files = Directory.GetFiles(path); - foreach(string file in files) - { - excludeFile = false; - - match = m_Regex.Match(file); - if(match.Success) - { - // Check all excludions and set flag if there are any hits. - foreach ( ExcludeNode exclude in exclusions ) - { - Regex exRegEx = new Regex( exclude.Pattern ); - match = exRegEx.Match( file ); - excludeFile |= !match.Success; - } - - if ( !excludeFile ) - { - m_Files.Add( file ); - } - } - } - } - - if(recurse) - { - string[] dirs = Directory.GetDirectories(path); - if(dirs != null && dirs.Length > 0) - { - foreach(string str in dirs) - { - 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", "*"); - 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.ToString()); - this.m_CopyToOutput = (CopyToOutput) Enum.Parse(typeof(CopyToOutput), Helper.AttributeValue(node, "copyToOutput", this.m_CopyToOutput.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_PreservePath = bool.Parse( Helper.AttributeValue( node, "preservePath", bool.FalseString ) ); - - - 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 ); - - if(m_Files.Count < 1) - { - throw new WarningException("Match returned no files: {0}{1}", Helper.EndPath(path), pattern); - } - m_Regex = null; - } - - #endregion - } -} diff --git a/Prebuild/src/Core/Nodes/OptionsNode.cs b/Prebuild/src/Core/Nodes/OptionsNode.cs deleted file mode 100644 index b63034b..0000000 --- a/Prebuild/src/Core/Nodes/OptionsNode.cs +++ /dev/null @@ -1,644 +0,0 @@ -#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; -using System.Collections; -using System.Collections.Specialized; -using System.Reflection; -using System.Xml; - -using Prebuild.Core.Attributes; -using Prebuild.Core.Interfaces; -using Prebuild.Core.Utilities; - -namespace Prebuild.Core.Nodes -{ - /// - /// - /// - [DataNode("Options")] - public class OptionsNode : DataNode - { - #region Fields - - private static Hashtable m_OptionFields; - - [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 - { - get - { - return m_GenerateDocumentation; - } - set - { - m_GenerateDocumentation = value; - } - } - - [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 StringCollection m_FieldsDefined; - - #endregion - - #region Constructors - - /// - /// Initializes the class. - /// - static OptionsNode() - { - Type t = typeof(OptionsNode); - - m_OptionFields = new Hashtable(); - 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; - } - } - - /// - /// Initializes a new instance of the class. - /// - public OptionsNode() - { - m_FieldsDefined = new StringCollection(); - } - - #endregion - - #region Properties - - /// - /// Gets the at the specified index. - /// - /// - public object this[string index] - { - get - { - if(!m_OptionFields.ContainsKey(index)) - { - return null; - } - - FieldInfo f = (FieldInfo)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 = (FieldInfo)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 deleted file mode 100644 index 6bfbe16..0000000 --- a/Prebuild/src/Core/Nodes/ProcessNode.cs +++ /dev/null @@ -1,110 +0,0 @@ -#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; -using System.Collections; -using System.Collections.Specialized; -using System.Xml; - -using Prebuild.Core.Attributes; -using Prebuild.Core.Interfaces; -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 - } -} diff --git a/Prebuild/src/Core/Nodes/ProjectNode.cs b/Prebuild/src/Core/Nodes/ProjectNode.cs deleted file mode 100644 index 04af7a3..0000000 --- a/Prebuild/src/Core/Nodes/ProjectNode.cs +++ /dev/null @@ -1,580 +0,0 @@ -#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; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.Xml; - -using Prebuild.Core.Attributes; -using Prebuild.Core.Interfaces; -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, - } - /// - /// 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 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_DebugStartParameters; - - private Hashtable m_Configurations = new Hashtable(); - private readonly List m_ReferencePaths = 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 this.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 = false; - - /// - /// - /// - 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 IList Configurations - { - get - { - ArrayList tmp = new ArrayList(ConfigurationsTable.Values); - tmp.Sort(); - return tmp; - } - } - - /// - /// Gets the configurations table. - /// - /// The configurations table. - public Hashtable 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. - public List References - { - 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.Name] = 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 this.m_Configurations.Values) - { - conf.CopyTo(confNode);//update the config templates defines at the project level with the overrides - } - } - if(m_Configurations.ContainsKey(conf.Name)) - { - ConfigurationNode parentConf = (ConfigurationNode)m_Configurations[conf.Name]; - conf.CopyTo(parentConf);//update the config templates defines at the project level with the overrides - } - else - { - m_Configurations[conf.Name] = 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_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); - - 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); - - m_GenerateAssemblyInfoFile = Helper.ParseBoolean(node, "generateAssemblyInfoFile", false); - m_DebugStartParameters = Helper.AttributeValue(node, "debugStartParameters", string.Empty); - - if(m_AssemblyName == null || m_AssemblyName.Length < 1) - { - m_AssemblyName = m_Name; - } - - if(m_RootNamespace == null || m_RootNamespace.Length < 1) - { - 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) - { - m_References.Add((ReferenceNode)dataNode); - } - 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 - - #region IComparable Members - - public int CompareTo(object obj) - { - ProjectNode that = (ProjectNode)obj; - return this.m_Name.CompareTo(that.m_Name); - } - - #endregion - } -} diff --git a/Prebuild/src/Core/Nodes/ReferenceNode.cs b/Prebuild/src/Core/Nodes/ReferenceNode.cs deleted file mode 100644 index 9c5d1a3..0000000 --- a/Prebuild/src/Core/Nodes/ReferenceNode.cs +++ /dev/null @@ -1,144 +0,0 @@ -#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; -using System.Xml; - -using Prebuild.Core.Attributes; -using Prebuild.Core.Interfaces; -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 - - #region IComparable Members - - public int CompareTo(object obj) - { - ReferenceNode that = (ReferenceNode)obj; - return this.m_Name.CompareTo(that.m_Name); - } - - #endregion - } -} diff --git a/Prebuild/src/Core/Nodes/ReferencePathNode.cs b/Prebuild/src/Core/Nodes/ReferencePathNode.cs deleted file mode 100644 index f0543c2..0000000 --- a/Prebuild/src/Core/Nodes/ReferencePathNode.cs +++ /dev/null @@ -1,99 +0,0 @@ -#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; -using System.Collections; -using System.Collections.Specialized; -using System.Xml; - -using Prebuild.Core.Attributes; -using Prebuild.Core.Interfaces; -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 - - #region IComparable Members - - public int CompareTo(object obj) - { - ReferencePathNode that = (ReferencePathNode)obj; - return this.m_Path.CompareTo(that.m_Path); - } - - #endregion - } -} diff --git a/Prebuild/src/Core/Nodes/SolutionNode.cs b/Prebuild/src/Core/Nodes/SolutionNode.cs deleted file mode 100644 index 2a1b8e2..0000000 --- a/Prebuild/src/Core/Nodes/SolutionNode.cs +++ /dev/null @@ -1,358 +0,0 @@ -#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; -using System.Collections; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Xml; - -using Prebuild.Core.Attributes; -using Prebuild.Core.Interfaces; -using Prebuild.Core.Utilities; - -namespace Prebuild.Core.Nodes -{ - /// - /// - /// - [DataNode("Solution")] - [DataNode("EmbeddedSolution")] - [DebuggerDisplay("{Name}")] - 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 = "Debug"; - private string m_Version = "1.0.0"; - - private OptionsNode m_Options; - private FilesNode m_Files; - private readonly Hashtable m_Configurations = new Hashtable(); - private readonly Hashtable m_Projects = new Hashtable(); - private readonly Hashtable m_DatabaseProjects = new Hashtable(); - private readonly List m_ProjectsOrder = new List(); - private readonly Hashtable m_Solutions = new Hashtable(); - - #endregion - - #region Properties - public override IDataNode Parent - { - get - { - return base.Parent; - } - set - { - if (value is SolutionNode) - { - SolutionNode solution = (SolutionNode)value; - foreach (ConfigurationNode conf in solution.Configurations) - { - m_Configurations[conf.Name] = conf.Clone(); - } - } - - base.Parent = value; - } - } - - public Guid Guid - { - get - { - return m_Guid; - } - set - { - 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 ICollection Configurations - { - get - { - ArrayList tmp = new ArrayList(ConfigurationsTable.Values); - tmp.Sort(); - return tmp; - } - } - - /// - /// Gets the configurations table. - /// - /// The configurations table. - public Hashtable ConfigurationsTable - { - get - { - return m_Configurations; - } - } - /// - /// Gets the database projects. - /// - public ICollection DatabaseProjects - { - get - { - return m_DatabaseProjects.Values; - } - } - /// - /// Gets the nested solutions. - /// - public ICollection Solutions - { - get - { - return m_Solutions.Values; - } - } - /// - /// Gets the nested solutions hash table. - /// - public Hashtable SolutionsTable - { - get - { - return this.m_Solutions; - } - } - /// - /// Gets the projects. - /// - /// The projects. - public ICollection Projects - { - get - { - ArrayList tmp = new ArrayList(m_Projects.Values); - tmp.Sort(); - return tmp; - } - } - - /// - /// Gets the projects table. - /// - /// The projects table. - public Hashtable 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) - { - m_Configurations[((ConfigurationNode)dataNode).Name] = dataNode; - } - else if(dataNode is ProjectNode) - { - m_Projects[((ProjectNode)dataNode).Name] = dataNode; - m_ProjectsOrder.Add((ProjectNode)dataNode); - } - else if(dataNode is SolutionNode) - { - m_Solutions[((SolutionNode)dataNode).Name] = dataNode; - } - else if (dataNode is ProcessNode) - { - ProcessNode p = (ProcessNode)dataNode; - Kernel.Instance.ProcessFile(p, this); - } - else if (dataNode is DatabaseProjectNode) - { - m_DatabaseProjects[((DatabaseProjectNode)dataNode).Name] = dataNode; - } - } - } - finally - { - Kernel.Instance.CurrentWorkingDirectory.Pop(); - } - } - - #endregion - } -} -- cgit v1.1 From 7e65590a55ba575d0086bdfc25addaf1051d799b Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 11 Sep 2010 01:13:08 +0100 Subject: Update Prebuild.exe with Prebuild r323 + an existing OpenSim specific nant hack to correctly clean up chosen OpenSim exes and dlls in bin/ on a "nant clean" Source code is included for reference. This can go away again once Prebuild is updated with a more general mechanism for cleaning up files. The Prebuild source code here can be built with nant, or regnerated for other tools using the prebuild at {root}/bin/Prebuild.exe --- Prebuild/src/Core/Nodes/.svn/all-wcprops | 119 ++++ Prebuild/src/Core/Nodes/.svn/dir-prop-base | 5 + Prebuild/src/Core/Nodes/.svn/entries | 674 +++++++++++++++++++++ .../.svn/prop-base/ConfigurationNode.cs.svn-base | 9 + .../Core/Nodes/.svn/prop-base/DataNode.cs.svn-base | 9 + .../Nodes/.svn/prop-base/ExcludeNode.cs.svn-base | 9 + .../Core/Nodes/.svn/prop-base/FileNode.cs.svn-base | 9 + .../Nodes/.svn/prop-base/FilesNode.cs.svn-base | 9 + .../Nodes/.svn/prop-base/MatchNode.cs.svn-base | 9 + .../Nodes/.svn/prop-base/OptionsNode.cs.svn-base | 9 + .../Nodes/.svn/prop-base/ProcessNode.cs.svn-base | 9 + .../Nodes/.svn/prop-base/ProjectNode.cs.svn-base | 9 + .../Nodes/.svn/prop-base/ReferenceNode.cs.svn-base | 9 + .../.svn/prop-base/ReferencePathNode.cs.svn-base | 9 + .../Nodes/.svn/prop-base/SolutionNode.cs.svn-base | 9 + .../Nodes/.svn/text-base/AuthorNode.cs.svn-base | 87 +++ .../.svn/text-base/CleanFilesNode.cs.svn-base | 80 +++ .../Nodes/.svn/text-base/CleanupNode.cs.svn-base | 85 +++ .../.svn/text-base/ConfigurationNode.cs.svn-base | 225 +++++++ .../ConfigurationNodeCollection.cs.svn-base | 71 +++ .../Core/Nodes/.svn/text-base/DataNode.cs.svn-base | 117 ++++ .../.svn/text-base/DatabaseProjectNode.cs.svn-base | 93 +++ .../text-base/DatabaseReferenceNode.cs.svn-base | 63 ++ .../.svn/text-base/DescriptionNode.cs.svn-base | 87 +++ .../Nodes/.svn/text-base/ExcludeNode.cs.svn-base | 89 +++ .../Core/Nodes/.svn/text-base/FileNode.cs.svn-base | 285 +++++++++ .../Nodes/.svn/text-base/FilesNode.cs.svn-base | 204 +++++++ .../Nodes/.svn/text-base/MatchNode.cs.svn-base | 367 +++++++++++ .../Nodes/.svn/text-base/OptionsNode.cs.svn-base | 634 +++++++++++++++++++ .../Nodes/.svn/text-base/ProcessNode.cs.svn-base | 108 ++++ .../Nodes/.svn/text-base/ProjectNode.cs.svn-base | 579 ++++++++++++++++++ .../Nodes/.svn/text-base/ReferenceNode.cs.svn-base | 144 +++++ .../.svn/text-base/ReferencePathNode.cs.svn-base | 97 +++ .../Nodes/.svn/text-base/SolutionNode.cs.svn-base | 382 ++++++++++++ Prebuild/src/Core/Nodes/AuthorNode.cs | 87 +++ Prebuild/src/Core/Nodes/CleanFilesNode.cs | 80 +++ Prebuild/src/Core/Nodes/CleanupNode.cs | 85 +++ Prebuild/src/Core/Nodes/ConfigurationNode.cs | 225 +++++++ .../src/Core/Nodes/ConfigurationNodeCollection.cs | 71 +++ Prebuild/src/Core/Nodes/DataNode.cs | 117 ++++ Prebuild/src/Core/Nodes/DatabaseProjectNode.cs | 93 +++ Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs | 63 ++ Prebuild/src/Core/Nodes/DescriptionNode.cs | 87 +++ Prebuild/src/Core/Nodes/ExcludeNode.cs | 89 +++ Prebuild/src/Core/Nodes/FileNode.cs | 285 +++++++++ Prebuild/src/Core/Nodes/FilesNode.cs | 204 +++++++ Prebuild/src/Core/Nodes/MatchNode.cs | 367 +++++++++++ Prebuild/src/Core/Nodes/OptionsNode.cs | 634 +++++++++++++++++++ Prebuild/src/Core/Nodes/ProcessNode.cs | 108 ++++ Prebuild/src/Core/Nodes/ProjectNode.cs | 579 ++++++++++++++++++ Prebuild/src/Core/Nodes/ReferenceNode.cs | 144 +++++ Prebuild/src/Core/Nodes/ReferencePathNode.cs | 97 +++ Prebuild/src/Core/Nodes/SolutionNode.cs | 382 ++++++++++++ 53 files changed, 8500 insertions(+) create mode 100644 Prebuild/src/Core/Nodes/.svn/all-wcprops create mode 100644 Prebuild/src/Core/Nodes/.svn/dir-prop-base create mode 100644 Prebuild/src/Core/Nodes/.svn/entries create mode 100644 Prebuild/src/Core/Nodes/.svn/prop-base/ConfigurationNode.cs.svn-base create mode 100644 Prebuild/src/Core/Nodes/.svn/prop-base/DataNode.cs.svn-base create mode 100644 Prebuild/src/Core/Nodes/.svn/prop-base/ExcludeNode.cs.svn-base create mode 100644 Prebuild/src/Core/Nodes/.svn/prop-base/FileNode.cs.svn-base create mode 100644 Prebuild/src/Core/Nodes/.svn/prop-base/FilesNode.cs.svn-base create mode 100644 Prebuild/src/Core/Nodes/.svn/prop-base/MatchNode.cs.svn-base create mode 100644 Prebuild/src/Core/Nodes/.svn/prop-base/OptionsNode.cs.svn-base create mode 100644 Prebuild/src/Core/Nodes/.svn/prop-base/ProcessNode.cs.svn-base create mode 100644 Prebuild/src/Core/Nodes/.svn/prop-base/ProjectNode.cs.svn-base create mode 100644 Prebuild/src/Core/Nodes/.svn/prop-base/ReferenceNode.cs.svn-base create mode 100644 Prebuild/src/Core/Nodes/.svn/prop-base/ReferencePathNode.cs.svn-base create mode 100644 Prebuild/src/Core/Nodes/.svn/prop-base/SolutionNode.cs.svn-base create mode 100644 Prebuild/src/Core/Nodes/.svn/text-base/AuthorNode.cs.svn-base create mode 100644 Prebuild/src/Core/Nodes/.svn/text-base/CleanFilesNode.cs.svn-base create mode 100644 Prebuild/src/Core/Nodes/.svn/text-base/CleanupNode.cs.svn-base create mode 100644 Prebuild/src/Core/Nodes/.svn/text-base/ConfigurationNode.cs.svn-base create mode 100644 Prebuild/src/Core/Nodes/.svn/text-base/ConfigurationNodeCollection.cs.svn-base create mode 100644 Prebuild/src/Core/Nodes/.svn/text-base/DataNode.cs.svn-base create mode 100644 Prebuild/src/Core/Nodes/.svn/text-base/DatabaseProjectNode.cs.svn-base create mode 100644 Prebuild/src/Core/Nodes/.svn/text-base/DatabaseReferenceNode.cs.svn-base create mode 100644 Prebuild/src/Core/Nodes/.svn/text-base/DescriptionNode.cs.svn-base create mode 100644 Prebuild/src/Core/Nodes/.svn/text-base/ExcludeNode.cs.svn-base create mode 100644 Prebuild/src/Core/Nodes/.svn/text-base/FileNode.cs.svn-base create mode 100644 Prebuild/src/Core/Nodes/.svn/text-base/FilesNode.cs.svn-base create mode 100644 Prebuild/src/Core/Nodes/.svn/text-base/MatchNode.cs.svn-base create mode 100644 Prebuild/src/Core/Nodes/.svn/text-base/OptionsNode.cs.svn-base create mode 100644 Prebuild/src/Core/Nodes/.svn/text-base/ProcessNode.cs.svn-base create mode 100644 Prebuild/src/Core/Nodes/.svn/text-base/ProjectNode.cs.svn-base create mode 100644 Prebuild/src/Core/Nodes/.svn/text-base/ReferenceNode.cs.svn-base create mode 100644 Prebuild/src/Core/Nodes/.svn/text-base/ReferencePathNode.cs.svn-base create mode 100644 Prebuild/src/Core/Nodes/.svn/text-base/SolutionNode.cs.svn-base create mode 100644 Prebuild/src/Core/Nodes/AuthorNode.cs create mode 100644 Prebuild/src/Core/Nodes/CleanFilesNode.cs create mode 100644 Prebuild/src/Core/Nodes/CleanupNode.cs create mode 100644 Prebuild/src/Core/Nodes/ConfigurationNode.cs create mode 100644 Prebuild/src/Core/Nodes/ConfigurationNodeCollection.cs create mode 100644 Prebuild/src/Core/Nodes/DataNode.cs create mode 100644 Prebuild/src/Core/Nodes/DatabaseProjectNode.cs create mode 100644 Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs create mode 100644 Prebuild/src/Core/Nodes/DescriptionNode.cs create mode 100644 Prebuild/src/Core/Nodes/ExcludeNode.cs create mode 100644 Prebuild/src/Core/Nodes/FileNode.cs create mode 100644 Prebuild/src/Core/Nodes/FilesNode.cs create mode 100644 Prebuild/src/Core/Nodes/MatchNode.cs create mode 100644 Prebuild/src/Core/Nodes/OptionsNode.cs create mode 100644 Prebuild/src/Core/Nodes/ProcessNode.cs create mode 100644 Prebuild/src/Core/Nodes/ProjectNode.cs create mode 100644 Prebuild/src/Core/Nodes/ReferenceNode.cs create mode 100644 Prebuild/src/Core/Nodes/ReferencePathNode.cs create mode 100644 Prebuild/src/Core/Nodes/SolutionNode.cs (limited to 'Prebuild/src/Core/Nodes') diff --git a/Prebuild/src/Core/Nodes/.svn/all-wcprops b/Prebuild/src/Core/Nodes/.svn/all-wcprops new file mode 100644 index 0000000..6565f05 --- /dev/null +++ b/Prebuild/src/Core/Nodes/.svn/all-wcprops @@ -0,0 +1,119 @@ +K 25 +svn:wc:ra_dav:version-url +V 56 +/svnroot/dnpb/!svn/ver/321/trunk/Prebuild/src/Core/Nodes +END +CleanFilesNode.cs +K 25 +svn:wc:ra_dav:version-url +V 74 +/svnroot/dnpb/!svn/ver/307/trunk/Prebuild/src/Core/Nodes/CleanFilesNode.cs +END +ProjectNode.cs +K 25 +svn:wc:ra_dav:version-url +V 71 +/svnroot/dnpb/!svn/ver/319/trunk/Prebuild/src/Core/Nodes/ProjectNode.cs +END +ConfigurationNode.cs +K 25 +svn:wc:ra_dav:version-url +V 77 +/svnroot/dnpb/!svn/ver/316/trunk/Prebuild/src/Core/Nodes/ConfigurationNode.cs +END +DataNode.cs +K 25 +svn:wc:ra_dav:version-url +V 68 +/svnroot/dnpb/!svn/ver/321/trunk/Prebuild/src/Core/Nodes/DataNode.cs +END +ReferencePathNode.cs +K 25 +svn:wc:ra_dav:version-url +V 77 +/svnroot/dnpb/!svn/ver/307/trunk/Prebuild/src/Core/Nodes/ReferencePathNode.cs +END +SolutionNode.cs +K 25 +svn:wc:ra_dav:version-url +V 72 +/svnroot/dnpb/!svn/ver/315/trunk/Prebuild/src/Core/Nodes/SolutionNode.cs +END +ProcessNode.cs +K 25 +svn:wc:ra_dav:version-url +V 71 +/svnroot/dnpb/!svn/ver/307/trunk/Prebuild/src/Core/Nodes/ProcessNode.cs +END +FileNode.cs +K 25 +svn:wc:ra_dav:version-url +V 68 +/svnroot/dnpb/!svn/ver/316/trunk/Prebuild/src/Core/Nodes/FileNode.cs +END +DescriptionNode.cs +K 25 +svn:wc:ra_dav:version-url +V 75 +/svnroot/dnpb/!svn/ver/307/trunk/Prebuild/src/Core/Nodes/DescriptionNode.cs +END +DatabaseReferenceNode.cs +K 25 +svn:wc:ra_dav:version-url +V 81 +/svnroot/dnpb/!svn/ver/295/trunk/Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs +END +ConfigurationNodeCollection.cs +K 25 +svn:wc:ra_dav:version-url +V 87 +/svnroot/dnpb/!svn/ver/315/trunk/Prebuild/src/Core/Nodes/ConfigurationNodeCollection.cs +END +CleanupNode.cs +K 25 +svn:wc:ra_dav:version-url +V 71 +/svnroot/dnpb/!svn/ver/307/trunk/Prebuild/src/Core/Nodes/CleanupNode.cs +END +ExcludeNode.cs +K 25 +svn:wc:ra_dav:version-url +V 71 +/svnroot/dnpb/!svn/ver/295/trunk/Prebuild/src/Core/Nodes/ExcludeNode.cs +END +OptionsNode.cs +K 25 +svn:wc:ra_dav:version-url +V 71 +/svnroot/dnpb/!svn/ver/315/trunk/Prebuild/src/Core/Nodes/OptionsNode.cs +END +DatabaseProjectNode.cs +K 25 +svn:wc:ra_dav:version-url +V 79 +/svnroot/dnpb/!svn/ver/307/trunk/Prebuild/src/Core/Nodes/DatabaseProjectNode.cs +END +MatchNode.cs +K 25 +svn:wc:ra_dav:version-url +V 69 +/svnroot/dnpb/!svn/ver/318/trunk/Prebuild/src/Core/Nodes/MatchNode.cs +END +ReferenceNode.cs +K 25 +svn:wc:ra_dav:version-url +V 73 +/svnroot/dnpb/!svn/ver/295/trunk/Prebuild/src/Core/Nodes/ReferenceNode.cs +END +FilesNode.cs +K 25 +svn:wc:ra_dav:version-url +V 69 +/svnroot/dnpb/!svn/ver/307/trunk/Prebuild/src/Core/Nodes/FilesNode.cs +END +AuthorNode.cs +K 25 +svn:wc:ra_dav:version-url +V 70 +/svnroot/dnpb/!svn/ver/307/trunk/Prebuild/src/Core/Nodes/AuthorNode.cs +END diff --git a/Prebuild/src/Core/Nodes/.svn/dir-prop-base b/Prebuild/src/Core/Nodes/.svn/dir-prop-base new file mode 100644 index 0000000..a1989a0 --- /dev/null +++ b/Prebuild/src/Core/Nodes/.svn/dir-prop-base @@ -0,0 +1,5 @@ +K 10 +svn:ignore +V 5 +*.swp +END diff --git a/Prebuild/src/Core/Nodes/.svn/entries b/Prebuild/src/Core/Nodes/.svn/entries new file mode 100644 index 0000000..b60f190 --- /dev/null +++ b/Prebuild/src/Core/Nodes/.svn/entries @@ -0,0 +1,674 @@ +10 + +dir +323 +https://dnpb.svn.sourceforge.net/svnroot/dnpb/trunk/Prebuild/src/Core/Nodes +https://dnpb.svn.sourceforge.net/svnroot/dnpb + + + +2010-08-12T16:58:08.825470Z +321 +jhurliman +has-props + + + + + + + + + + + + + +3355ff64-970d-0410-bbe8-d0fbd18be4fb + +CleanFilesNode.cs +file + + + + +2010-09-10T22:51:44.000000Z +c798b3c4167ec1a3815ddae93a552427 +2009-04-15T01:28:16.827957Z +307 +kunnis + + + + + + + + + + + + + + + + + + + + + +2666 + +ProjectNode.cs +file + + + + +2010-09-10T22:51:44.000000Z +be9ade7048917117783a06508fa4d378 +2010-05-09T23:19:49.063286Z +319 +jhurliman +has-props + + + + + + + + + + + + + + + + + + + + +13444 + +ConfigurationNode.cs +file + + + + +2010-09-10T22:51:44.000000Z +e42a548bfaba22cf94dbb203b2b28352 +2010-05-08T05:43:01.449559Z +316 +jhurliman +has-props + + + + + + + + + + + + + + + + + + + + +5222 + +DataNode.cs +file + + + + +2010-09-10T22:51:44.000000Z +39b1d83bff018fce9f616ae2e6f1be82 +2010-08-12T16:58:08.825470Z +321 +jhurliman +has-props + + + + + + + + + + + + + + + + + + + + +3294 + +ReferencePathNode.cs +file + + + + +2010-09-10T22:51:44.000000Z +409c91bafff2572218a6cdefcc6ec48c +2009-04-15T01:28:16.827957Z +307 +kunnis +has-props + + + + + + + + + + + + + + + + + + + + +2677 + +SolutionNode.cs +file + + + + +2010-09-10T22:51:44.000000Z +79bdf34c92682dc5ba8b5db15aaa95d6 +2009-06-06T19:47:31.451428Z +315 +dmoonfire +has-props + + + + + + + + + + + + + + + + + + + + +9720 + +ProcessNode.cs +file + + + + +2010-09-10T22:51:44.000000Z +1816314797ef66235c58938b33ea2b3b +2009-04-15T01:28:16.827957Z +307 +kunnis +has-props + + + + + + + + + + + + + + + + + + + + +2900 + +FileNode.cs +file + + + + +2010-09-10T22:51:44.000000Z +43f98599da19618be6c6ed74f36fceae +2010-05-08T05:43:01.449559Z +316 +jhurliman +has-props + + + + + + + + + + + + + + + + + + + + +6043 + +DescriptionNode.cs +file + + + + +2010-09-10T22:51:44.000000Z +3f8a8b8cc4b3a94b94109276ad2222d3 +2009-04-15T01:28:16.827957Z +307 +kunnis + + + + + + + + + + + + + + + + + + + + + +2493 + +DatabaseReferenceNode.cs +file + + + + +2010-09-10T22:51:44.000000Z +4104ed953ae9105ac6498ce7882ed8ee +2009-02-19T06:47:52.218324Z +295 +kunnis + + + + + + + + + + + + + + + + + + + + + +2390 + +ConfigurationNodeCollection.cs +file + + + + +2010-09-10T22:51:44.000000Z +8620885fc85bdc06288acf6b8f58b3ff +2009-06-06T19:47:31.451428Z +315 +dmoonfire + + + + + + + + + + + + + + + + + + + + + +2406 + +CleanupNode.cs +file + + + + +2010-09-10T22:51:44.000000Z +198fb1e15cd545655978686277e39d96 +2009-04-15T01:28:16.827957Z +307 +kunnis + + + + + + + + + + + + + + + + + + + + + +2689 + +ExcludeNode.cs +file + + + + +2010-09-10T22:51:44.000000Z +810fc73f537028052471239c72f41c11 +2009-02-19T06:47:52.218324Z +295 +kunnis +has-props + + + + + + + + + + + + + + + + + + + + +2608 + +OptionsNode.cs +file + + + + +2010-09-10T22:51:44.000000Z +691dd5f7e7ce2a06814cdcae611fc40e +2009-06-06T19:47:31.451428Z +315 +dmoonfire +has-props + + + + + + + + + + + + + + + + + + + + +10949 + +DatabaseProjectNode.cs +file + + + + +2010-09-10T22:51:44.000000Z +18995e6577e6bb3622fe41f5bfe01b48 +2009-04-15T01:28:16.827957Z +307 +kunnis + + + + + + + + + + + + + + + + + + + + + +2476 + +MatchNode.cs +file + + + + +2010-09-10T22:51:44.000000Z +3344ef3bdb7db2006eb987a80128cd06 +2010-05-09T08:21:52.307305Z +318 +jhurliman +has-props + + + + + + + + + + + + + + + + + + + + +10846 + +ReferenceNode.cs +file + + + + +2010-09-10T22:51:44.000000Z +18d76c27d53a4d54f16f57a855a21916 +2009-02-19T06:47:52.218324Z +295 +kunnis +has-props + + + + + + + + + + + + + + + + + + + + +3705 + +FilesNode.cs +file + + + + +2010-09-10T22:51:44.000000Z +e6ddefd5fff49958f77b5ef96f06c09e +2009-04-15T01:28:16.827957Z +307 +kunnis +has-props + + + + + + + + + + + + + + + + + + + + +6036 + +AuthorNode.cs +file + + + + +2010-09-10T22:51:44.000000Z +07607d8988fc1236ab8bef5fc12f8cd5 +2009-04-15T01:28:16.827957Z +307 +kunnis + + + + + + + + + + + + + + + + + + + + + +2425 + diff --git a/Prebuild/src/Core/Nodes/.svn/prop-base/ConfigurationNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/prop-base/ConfigurationNode.cs.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/Prebuild/src/Core/Nodes/.svn/prop-base/ConfigurationNode.cs.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/Prebuild/src/Core/Nodes/.svn/prop-base/DataNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/prop-base/DataNode.cs.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/Prebuild/src/Core/Nodes/.svn/prop-base/DataNode.cs.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/Prebuild/src/Core/Nodes/.svn/prop-base/ExcludeNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/prop-base/ExcludeNode.cs.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/Prebuild/src/Core/Nodes/.svn/prop-base/ExcludeNode.cs.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/Prebuild/src/Core/Nodes/.svn/prop-base/FileNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/prop-base/FileNode.cs.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/Prebuild/src/Core/Nodes/.svn/prop-base/FileNode.cs.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/Prebuild/src/Core/Nodes/.svn/prop-base/FilesNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/prop-base/FilesNode.cs.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/Prebuild/src/Core/Nodes/.svn/prop-base/FilesNode.cs.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/Prebuild/src/Core/Nodes/.svn/prop-base/MatchNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/prop-base/MatchNode.cs.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/Prebuild/src/Core/Nodes/.svn/prop-base/MatchNode.cs.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/Prebuild/src/Core/Nodes/.svn/prop-base/OptionsNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/prop-base/OptionsNode.cs.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/Prebuild/src/Core/Nodes/.svn/prop-base/OptionsNode.cs.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/Prebuild/src/Core/Nodes/.svn/prop-base/ProcessNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/prop-base/ProcessNode.cs.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/Prebuild/src/Core/Nodes/.svn/prop-base/ProcessNode.cs.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/Prebuild/src/Core/Nodes/.svn/prop-base/ProjectNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/prop-base/ProjectNode.cs.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/Prebuild/src/Core/Nodes/.svn/prop-base/ProjectNode.cs.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/Prebuild/src/Core/Nodes/.svn/prop-base/ReferenceNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/prop-base/ReferenceNode.cs.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/Prebuild/src/Core/Nodes/.svn/prop-base/ReferenceNode.cs.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/Prebuild/src/Core/Nodes/.svn/prop-base/ReferencePathNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/prop-base/ReferencePathNode.cs.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/Prebuild/src/Core/Nodes/.svn/prop-base/ReferencePathNode.cs.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/Prebuild/src/Core/Nodes/.svn/prop-base/SolutionNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/prop-base/SolutionNode.cs.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/Prebuild/src/Core/Nodes/.svn/prop-base/SolutionNode.cs.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/Prebuild/src/Core/Nodes/.svn/text-base/AuthorNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/AuthorNode.cs.svn-base new file mode 100644 index 0000000..4c415bb --- /dev/null +++ b/Prebuild/src/Core/Nodes/.svn/text-base/AuthorNode.cs.svn-base @@ -0,0 +1,87 @@ +#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.Xml; + +using Prebuild.Core.Attributes; +using Prebuild.Core.Interfaces; +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 + } +} diff --git a/Prebuild/src/Core/Nodes/.svn/text-base/CleanFilesNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/CleanFilesNode.cs.svn-base new file mode 100644 index 0000000..dc2da9a --- /dev/null +++ b/Prebuild/src/Core/Nodes/.svn/text-base/CleanFilesNode.cs.svn-base @@ -0,0 +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 + } +} \ No newline at end of file diff --git a/Prebuild/src/Core/Nodes/.svn/text-base/CleanupNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/CleanupNode.cs.svn-base new file mode 100644 index 0000000..a9b77eb --- /dev/null +++ b/Prebuild/src/Core/Nodes/.svn/text-base/CleanupNode.cs.svn-base @@ -0,0 +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 + } +} \ No newline at end of file diff --git a/Prebuild/src/Core/Nodes/.svn/text-base/ConfigurationNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/ConfigurationNode.cs.svn-base new file mode 100644 index 0000000..cd2f740 --- /dev/null +++ b/Prebuild/src/Core/Nodes/.svn/text-base/ConfigurationNode.cs.svn-base @@ -0,0 +1,225 @@ +#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; +using System.Xml; + +using Prebuild.Core.Attributes; +using Prebuild.Core.Interfaces; +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 + { + 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 + + #region IComparable Members + + public int CompareTo(object obj) + { + ConfigurationNode that = (ConfigurationNode) obj; + return this.m_Name.CompareTo(that.m_Name); + } + + #endregion + } +} diff --git a/Prebuild/src/Core/Nodes/.svn/text-base/ConfigurationNodeCollection.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/ConfigurationNodeCollection.cs.svn-base new file mode 100644 index 0000000..7c59ac5 --- /dev/null +++ b/Prebuild/src/Core/Nodes/.svn/text-base/ConfigurationNodeCollection.cs.svn-base @@ -0,0 +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 + } +} diff --git a/Prebuild/src/Core/Nodes/.svn/text-base/DataNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/DataNode.cs.svn-base new file mode 100644 index 0000000..318b13c --- /dev/null +++ b/Prebuild/src/Core/Nodes/.svn/text-base/DataNode.cs.svn-base @@ -0,0 +1,117 @@ +#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; +using System.Xml; + +using Prebuild.Core.Attributes; +using Prebuild.Core.Interfaces; +using System.IO; + +namespace Prebuild.Core.Nodes +{ + /// + /// + /// + public abstract class DataNode : IDataNode + { + #region Fields + + private IDataNode parent; + string[] m_WebTypes = new string[] { "aspx", "ascx", "master", "ashx", "asmx" }; + + #endregion + + #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) + { + if (path.EndsWith(type)) + { + return SubType.CodeBehind; + } + } + } + return SubType.Code; + } + #endregion + } +} diff --git a/Prebuild/src/Core/Nodes/.svn/text-base/DatabaseProjectNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/DatabaseProjectNode.cs.svn-base new file mode 100644 index 0000000..20095c3 --- /dev/null +++ b/Prebuild/src/Core/Nodes/.svn/text-base/DatabaseProjectNode.cs.svn-base @@ -0,0 +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); + } + } +} diff --git a/Prebuild/src/Core/Nodes/.svn/text-base/DatabaseReferenceNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/DatabaseReferenceNode.cs.svn-base new file mode 100644 index 0000000..97c3964 --- /dev/null +++ b/Prebuild/src/Core/Nodes/.svn/text-base/DatabaseReferenceNode.cs.svn-base @@ -0,0 +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); + } + } +} diff --git a/Prebuild/src/Core/Nodes/.svn/text-base/DescriptionNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/DescriptionNode.cs.svn-base new file mode 100644 index 0000000..d1293a0 --- /dev/null +++ b/Prebuild/src/Core/Nodes/.svn/text-base/DescriptionNode.cs.svn-base @@ -0,0 +1,87 @@ +#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.Xml; + +using Prebuild.Core.Attributes; +using Prebuild.Core.Interfaces; +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 + } +} diff --git a/Prebuild/src/Core/Nodes/.svn/text-base/ExcludeNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/ExcludeNode.cs.svn-base new file mode 100644 index 0000000..7f04cba --- /dev/null +++ b/Prebuild/src/Core/Nodes/.svn/text-base/ExcludeNode.cs.svn-base @@ -0,0 +1,89 @@ +#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; +using System.Xml; + +using Prebuild.Core.Attributes; +using Prebuild.Core.Interfaces; +using Prebuild.Core.Utilities; + +namespace Prebuild.Core.Nodes +{ + /// + /// + /// + [DataNode("Exclude")] + public class ExcludeNode : DataNode + { + #region Fields + + private string m_Pattern = ""; + + #endregion + + #region Properties + + /// + /// Gets the name. + /// + /// The name. + public string Name + { + get + { + return m_Pattern; + } + } + + /// + /// Gets the pattern. + /// + /// The pattern. + public string Pattern + { + get + { + return m_Pattern; + } + } + + #endregion + + #region Public Methods + + /// + /// 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 + } +} diff --git a/Prebuild/src/Core/Nodes/.svn/text-base/FileNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/FileNode.cs.svn-base new file mode 100644 index 0000000..01cea1e --- /dev/null +++ b/Prebuild/src/Core/Nodes/.svn/text-base/FileNode.cs.svn-base @@ -0,0 +1,285 @@ +#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; +using System.IO; +using System.Xml; + +using Prebuild.Core.Attributes; +using Prebuild.Core.Interfaces; +using Prebuild.Core.Utilities; +using Prebuild.Core.Targets; + +namespace Prebuild.Core.Nodes +{ + /// + /// + /// + public enum BuildAction + { + /// + /// + /// + None, + /// + /// + /// + Compile, + /// + /// + /// + Content, + /// + /// + /// + EmbeddedResource, + /// + /// + /// + ApplicationDefinition, + /// + /// + /// + Page + } + + /// + /// + /// + 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; + 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; + } + } + + /// + /// + /// + /// + /// + public bool PreservePath + { + get + { + return m_PreservePath; + } + } + + #endregion + + #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); + + 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 (System.IO.Path.GetExtension(m_Path) == ".settings") + { + m_SubType = SubType.Settings; + m_BuildAction = BuildAction.None; + } + } + + #endregion + } +} diff --git a/Prebuild/src/Core/Nodes/.svn/text-base/FilesNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/FilesNode.cs.svn-base new file mode 100644 index 0000000..23a716c --- /dev/null +++ b/Prebuild/src/Core/Nodes/.svn/text-base/FilesNode.cs.svn-base @@ -0,0 +1,204 @@ +#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; +using System.Collections.Generic; +using System.Xml; + +using Prebuild.Core.Attributes; +using Prebuild.Core.Interfaces; +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(); + private readonly Dictionary m_PreservePaths = new Dictionary(); + + #endregion + + #region Properties + + public int Count + { + get + { + return m_Files.Count; + } + } + + #endregion + + #region Public Methods + + public BuildAction GetBuildAction(string file) + { + if(!m_BuildActions.ContainsKey(file)) + { + return BuildAction.Compile; + } + + return m_BuildActions[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 bool GetPreservePath( string file ) + { + if ( !m_PreservePaths.ContainsKey( file ) ) + { + return false; + } + + 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; + 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) + { + MatchNode matchNode = (MatchNode)dataNode; + if (!m_Files.Contains(file)) + { + m_Files.Add(file); + if (matchNode.BuildAction == null) + m_BuildActions[file] = GetBuildActionByFileName(file); + else + m_BuildActions[file] = matchNode.BuildAction.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 + + } +} diff --git a/Prebuild/src/Core/Nodes/.svn/text-base/MatchNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/MatchNode.cs.svn-base new file mode 100644 index 0000000..9735265 --- /dev/null +++ b/Prebuild/src/Core/Nodes/.svn/text-base/MatchNode.cs.svn-base @@ -0,0 +1,367 @@ +#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; +using System.Collections.Generic; +using System.IO; +using System.Text.RegularExpressions; +using System.Xml; + +using Prebuild.Core.Attributes; +using Prebuild.Core.Interfaces; +using Prebuild.Core.Utilities; + +namespace Prebuild.Core.Nodes +{ + /// + /// + /// + [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 bool m_PreservePath; + private readonly List m_Exclusions = new List(); + + #endregion + + #region Properties + + /// + /// + /// + public IEnumerable Files + { + get + { + return m_Files; + } + } + + /// + /// + /// + public BuildAction? BuildAction + { + get + { + return m_BuildAction; + } + } + + /// + /// + /// + 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 + { + get + { + return m_PreservePath; + } + } + + #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); + } + 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. + // 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 + + files = null; + } + + 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; + } + + // Check all excludions and set flag if there are any hits. + foreach ( ExcludeNode exclude in exclusions ) + { + Regex exRegEx = new Regex( exclude.Pattern ); + match = exRegEx.Match( file ); + excludeFile |= match.Success; + } + + if ( !excludeFile ) + { + 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); + } + catch (IOException) + { + // swallow weird IOException error when running in a virtual box + // guest OS on a network share. + files = null; + } + + if (files != null) + { + foreach (string file in files) + { + excludeFile = false; + + match = m_Regex.Match(file); + if (match.Success) + { + // Check all excludions and set flag if there are any hits. + foreach (ExcludeNode exclude in exclusions) + { + Regex exRegEx = new Regex(exclude.Pattern); + match = exRegEx.Match(file); + excludeFile |= !match.Success; + } + + if (!excludeFile) + { + m_Files.Add(file); + } + } + } + } + } + + if(recurse) + { + string[] dirs = Directory.GetDirectories(path); + if(dirs != null && dirs.Length > 0) + { + foreach (string str in dirs) + { + // hack to skip subversion folders. Not having this can cause + // a significant performance hit when running on a network drive. + if (str.EndsWith(".svn")) + continue; + + 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", "*"); + 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(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 ); + + if (m_Files.Count < 1) + { + // Include the project name when the match node returns no matches to provide extra + // debug info. + ProjectNode project = Parent.Parent as ProjectNode; + string projectName = ""; + + if (project != null) + projectName = " in project " + project.AssemblyName; + + throw new WarningException("Match" + projectName + " returned no files: {0}{1}", Helper.EndPath(path), pattern); + } + m_Regex = null; + } + + #endregion + } +} diff --git a/Prebuild/src/Core/Nodes/.svn/text-base/OptionsNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/OptionsNode.cs.svn-base new file mode 100644 index 0000000..577de71 --- /dev/null +++ b/Prebuild/src/Core/Nodes/.svn/text-base/OptionsNode.cs.svn-base @@ -0,0 +1,634 @@ +#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; +using System.Collections.Generic; +using System.Reflection; +using System.Xml; + +using Prebuild.Core.Attributes; +using Prebuild.Core.Interfaces; +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; + } + } + + [OptionNode("GenerateDocumentation")] + private bool m_GenerateDocumentation; + + /// + /// + /// + public bool GenerateDocumentation + { + get + { + return m_GenerateDocumentation; + } + set + { + m_GenerateDocumentation = value; + } + } + + [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/.svn/text-base/ProcessNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/ProcessNode.cs.svn-base new file mode 100644 index 0000000..8ca8e49 --- /dev/null +++ b/Prebuild/src/Core/Nodes/.svn/text-base/ProcessNode.cs.svn-base @@ -0,0 +1,108 @@ +#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; +using System.Xml; + +using Prebuild.Core.Attributes; +using Prebuild.Core.Interfaces; +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 + } +} diff --git a/Prebuild/src/Core/Nodes/.svn/text-base/ProjectNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/ProjectNode.cs.svn-base new file mode 100644 index 0000000..fb92b32 --- /dev/null +++ b/Prebuild/src/Core/Nodes/.svn/text-base/ProjectNode.cs.svn-base @@ -0,0 +1,579 @@ +#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; +using System.Collections.Generic; +using System.IO; +using System.Xml; + +using Prebuild.Core.Attributes; +using Prebuild.Core.Interfaces; +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, + } + /// + /// 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 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_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_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. + public List Configurations + { + 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 + { + List tmp = new List(m_ReferencePaths); + tmp.Sort(); + return tmp; + } + } + + /// + /// Gets the references. + /// + /// The references. + public List References + { + 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 + { + 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); + 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_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); + + 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); + + 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_ReferencePaths.Add((ReferencePathNode)dataNode); + } + else if(dataNode is ReferenceNode) + { + m_References.Add((ReferenceNode)dataNode); + } + 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 + + #region IComparable Members + + public int CompareTo(object obj) + { + ProjectNode that = (ProjectNode)obj; + return m_Name.CompareTo(that.m_Name); + } + + #endregion + } +} diff --git a/Prebuild/src/Core/Nodes/.svn/text-base/ReferenceNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/ReferenceNode.cs.svn-base new file mode 100644 index 0000000..9c5d1a3 --- /dev/null +++ b/Prebuild/src/Core/Nodes/.svn/text-base/ReferenceNode.cs.svn-base @@ -0,0 +1,144 @@ +#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; +using System.Xml; + +using Prebuild.Core.Attributes; +using Prebuild.Core.Interfaces; +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 + + #region IComparable Members + + public int CompareTo(object obj) + { + ReferenceNode that = (ReferenceNode)obj; + return this.m_Name.CompareTo(that.m_Name); + } + + #endregion + } +} diff --git a/Prebuild/src/Core/Nodes/.svn/text-base/ReferencePathNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/ReferencePathNode.cs.svn-base new file mode 100644 index 0000000..7331cd7 --- /dev/null +++ b/Prebuild/src/Core/Nodes/.svn/text-base/ReferencePathNode.cs.svn-base @@ -0,0 +1,97 @@ +#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; +using System.Xml; + +using Prebuild.Core.Attributes; +using Prebuild.Core.Interfaces; +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 + + #region IComparable Members + + public int CompareTo(object obj) + { + ReferencePathNode that = (ReferencePathNode)obj; + return this.m_Path.CompareTo(that.m_Path); + } + + #endregion + } +} diff --git a/Prebuild/src/Core/Nodes/.svn/text-base/SolutionNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/SolutionNode.cs.svn-base new file mode 100644 index 0000000..10c0223 --- /dev/null +++ b/Prebuild/src/Core/Nodes/.svn/text-base/SolutionNode.cs.svn-base @@ -0,0 +1,382 @@ +#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; +using System.Collections.Generic; +using System.Diagnostics; +using System.Xml; + +using Prebuild.Core.Attributes; +using Prebuild.Core.Interfaces; +using Prebuild.Core.Utilities; + +namespace Prebuild.Core.Nodes +{ + /// + /// + /// + [DataNode("Solution")] + [DataNode("EmbeddedSolution")] + [DebuggerDisplay("{Name}")] + 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_Version = "1.0.0"; + + 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; + + #endregion + + #region Properties + public override IDataNode Parent + { + get + { + return base.Parent; + } + set + { + if (value is SolutionNode) + { + SolutionNode solution = (SolutionNode)value; + foreach (ConfigurationNode conf in solution.Configurations) + { + m_Configurations[conf.Name] = (ConfigurationNode) conf.Clone(); + } + } + + base.Parent = value; + } + } + + public CleanupNode Cleanup + { + get + { + return m_Cleanup; + } + set + { + m_Cleanup = value; + } + } + + public Guid Guid + { + get + { + return m_Guid; + } + set + { + 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 the database projects. + /// + public ICollection DatabaseProjects + { + get + { + return m_DatabaseProjects.Values; + } + } + /// + /// Gets the nested solutions. + /// + public ICollection Solutions + { + get + { + return m_Solutions.Values; + } + } + /// + /// Gets the nested solutions hash table. + /// + public Dictionary SolutionsTable + { + get + { + return m_Solutions; + } + } + /// + /// 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); + } + else if(dataNode is SolutionNode) + { + m_Solutions[((SolutionNode)dataNode).Name] = (SolutionNode) dataNode; + } + else if (dataNode is ProcessNode) + { + ProcessNode p = (ProcessNode)dataNode; + Kernel.Instance.ProcessFile(p, this); + } + else if (dataNode is DatabaseProjectNode) + { + m_DatabaseProjects[((DatabaseProjectNode)dataNode).Name] = (DatabaseProjectNode) dataNode; + } + else if(dataNode is CleanupNode) + { + if(m_Cleanup != null) + throw new WarningException("There can only be one Cleanup node."); + m_Cleanup = (CleanupNode)dataNode; + } + } + } + finally + { + Kernel.Instance.CurrentWorkingDirectory.Pop(); + } + } + + #endregion + } +} diff --git a/Prebuild/src/Core/Nodes/AuthorNode.cs b/Prebuild/src/Core/Nodes/AuthorNode.cs new file mode 100644 index 0000000..4c415bb --- /dev/null +++ b/Prebuild/src/Core/Nodes/AuthorNode.cs @@ -0,0 +1,87 @@ +#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.Xml; + +using Prebuild.Core.Attributes; +using Prebuild.Core.Interfaces; +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 + } +} diff --git a/Prebuild/src/Core/Nodes/CleanFilesNode.cs b/Prebuild/src/Core/Nodes/CleanFilesNode.cs new file mode 100644 index 0000000..dc2da9a --- /dev/null +++ b/Prebuild/src/Core/Nodes/CleanFilesNode.cs @@ -0,0 +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 + } +} \ No newline at end of file diff --git a/Prebuild/src/Core/Nodes/CleanupNode.cs b/Prebuild/src/Core/Nodes/CleanupNode.cs new file mode 100644 index 0000000..a9b77eb --- /dev/null +++ b/Prebuild/src/Core/Nodes/CleanupNode.cs @@ -0,0 +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 + } +} \ No newline at end of file diff --git a/Prebuild/src/Core/Nodes/ConfigurationNode.cs b/Prebuild/src/Core/Nodes/ConfigurationNode.cs new file mode 100644 index 0000000..cd2f740 --- /dev/null +++ b/Prebuild/src/Core/Nodes/ConfigurationNode.cs @@ -0,0 +1,225 @@ +#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; +using System.Xml; + +using Prebuild.Core.Attributes; +using Prebuild.Core.Interfaces; +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 + { + 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 + + #region IComparable Members + + public int CompareTo(object obj) + { + ConfigurationNode that = (ConfigurationNode) obj; + return this.m_Name.CompareTo(that.m_Name); + } + + #endregion + } +} diff --git a/Prebuild/src/Core/Nodes/ConfigurationNodeCollection.cs b/Prebuild/src/Core/Nodes/ConfigurationNodeCollection.cs new file mode 100644 index 0000000..7c59ac5 --- /dev/null +++ b/Prebuild/src/Core/Nodes/ConfigurationNodeCollection.cs @@ -0,0 +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 + } +} diff --git a/Prebuild/src/Core/Nodes/DataNode.cs b/Prebuild/src/Core/Nodes/DataNode.cs new file mode 100644 index 0000000..318b13c --- /dev/null +++ b/Prebuild/src/Core/Nodes/DataNode.cs @@ -0,0 +1,117 @@ +#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; +using System.Xml; + +using Prebuild.Core.Attributes; +using Prebuild.Core.Interfaces; +using System.IO; + +namespace Prebuild.Core.Nodes +{ + /// + /// + /// + public abstract class DataNode : IDataNode + { + #region Fields + + private IDataNode parent; + string[] m_WebTypes = new string[] { "aspx", "ascx", "master", "ashx", "asmx" }; + + #endregion + + #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) + { + if (path.EndsWith(type)) + { + return SubType.CodeBehind; + } + } + } + return SubType.Code; + } + #endregion + } +} diff --git a/Prebuild/src/Core/Nodes/DatabaseProjectNode.cs b/Prebuild/src/Core/Nodes/DatabaseProjectNode.cs new file mode 100644 index 0000000..20095c3 --- /dev/null +++ b/Prebuild/src/Core/Nodes/DatabaseProjectNode.cs @@ -0,0 +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); + } + } +} diff --git a/Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs b/Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs new file mode 100644 index 0000000..97c3964 --- /dev/null +++ b/Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs @@ -0,0 +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); + } + } +} diff --git a/Prebuild/src/Core/Nodes/DescriptionNode.cs b/Prebuild/src/Core/Nodes/DescriptionNode.cs new file mode 100644 index 0000000..d1293a0 --- /dev/null +++ b/Prebuild/src/Core/Nodes/DescriptionNode.cs @@ -0,0 +1,87 @@ +#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.Xml; + +using Prebuild.Core.Attributes; +using Prebuild.Core.Interfaces; +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 + } +} diff --git a/Prebuild/src/Core/Nodes/ExcludeNode.cs b/Prebuild/src/Core/Nodes/ExcludeNode.cs new file mode 100644 index 0000000..7f04cba --- /dev/null +++ b/Prebuild/src/Core/Nodes/ExcludeNode.cs @@ -0,0 +1,89 @@ +#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; +using System.Xml; + +using Prebuild.Core.Attributes; +using Prebuild.Core.Interfaces; +using Prebuild.Core.Utilities; + +namespace Prebuild.Core.Nodes +{ + /// + /// + /// + [DataNode("Exclude")] + public class ExcludeNode : DataNode + { + #region Fields + + private string m_Pattern = ""; + + #endregion + + #region Properties + + /// + /// Gets the name. + /// + /// The name. + public string Name + { + get + { + return m_Pattern; + } + } + + /// + /// Gets the pattern. + /// + /// The pattern. + public string Pattern + { + get + { + return m_Pattern; + } + } + + #endregion + + #region Public Methods + + /// + /// 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 + } +} diff --git a/Prebuild/src/Core/Nodes/FileNode.cs b/Prebuild/src/Core/Nodes/FileNode.cs new file mode 100644 index 0000000..01cea1e --- /dev/null +++ b/Prebuild/src/Core/Nodes/FileNode.cs @@ -0,0 +1,285 @@ +#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; +using System.IO; +using System.Xml; + +using Prebuild.Core.Attributes; +using Prebuild.Core.Interfaces; +using Prebuild.Core.Utilities; +using Prebuild.Core.Targets; + +namespace Prebuild.Core.Nodes +{ + /// + /// + /// + public enum BuildAction + { + /// + /// + /// + None, + /// + /// + /// + Compile, + /// + /// + /// + Content, + /// + /// + /// + EmbeddedResource, + /// + /// + /// + ApplicationDefinition, + /// + /// + /// + Page + } + + /// + /// + /// + 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; + 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; + } + } + + /// + /// + /// + /// + /// + public bool PreservePath + { + get + { + return m_PreservePath; + } + } + + #endregion + + #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); + + 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 (System.IO.Path.GetExtension(m_Path) == ".settings") + { + m_SubType = SubType.Settings; + m_BuildAction = BuildAction.None; + } + } + + #endregion + } +} diff --git a/Prebuild/src/Core/Nodes/FilesNode.cs b/Prebuild/src/Core/Nodes/FilesNode.cs new file mode 100644 index 0000000..23a716c --- /dev/null +++ b/Prebuild/src/Core/Nodes/FilesNode.cs @@ -0,0 +1,204 @@ +#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; +using System.Collections.Generic; +using System.Xml; + +using Prebuild.Core.Attributes; +using Prebuild.Core.Interfaces; +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(); + private readonly Dictionary m_PreservePaths = new Dictionary(); + + #endregion + + #region Properties + + public int Count + { + get + { + return m_Files.Count; + } + } + + #endregion + + #region Public Methods + + public BuildAction GetBuildAction(string file) + { + if(!m_BuildActions.ContainsKey(file)) + { + return BuildAction.Compile; + } + + return m_BuildActions[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 bool GetPreservePath( string file ) + { + if ( !m_PreservePaths.ContainsKey( file ) ) + { + return false; + } + + 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; + 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) + { + MatchNode matchNode = (MatchNode)dataNode; + if (!m_Files.Contains(file)) + { + m_Files.Add(file); + if (matchNode.BuildAction == null) + m_BuildActions[file] = GetBuildActionByFileName(file); + else + m_BuildActions[file] = matchNode.BuildAction.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 + + } +} diff --git a/Prebuild/src/Core/Nodes/MatchNode.cs b/Prebuild/src/Core/Nodes/MatchNode.cs new file mode 100644 index 0000000..9735265 --- /dev/null +++ b/Prebuild/src/Core/Nodes/MatchNode.cs @@ -0,0 +1,367 @@ +#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; +using System.Collections.Generic; +using System.IO; +using System.Text.RegularExpressions; +using System.Xml; + +using Prebuild.Core.Attributes; +using Prebuild.Core.Interfaces; +using Prebuild.Core.Utilities; + +namespace Prebuild.Core.Nodes +{ + /// + /// + /// + [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 bool m_PreservePath; + private readonly List m_Exclusions = new List(); + + #endregion + + #region Properties + + /// + /// + /// + public IEnumerable Files + { + get + { + return m_Files; + } + } + + /// + /// + /// + public BuildAction? BuildAction + { + get + { + return m_BuildAction; + } + } + + /// + /// + /// + 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 + { + get + { + return m_PreservePath; + } + } + + #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); + } + 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. + // 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 + + files = null; + } + + 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; + } + + // Check all excludions and set flag if there are any hits. + foreach ( ExcludeNode exclude in exclusions ) + { + Regex exRegEx = new Regex( exclude.Pattern ); + match = exRegEx.Match( file ); + excludeFile |= match.Success; + } + + if ( !excludeFile ) + { + 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); + } + catch (IOException) + { + // swallow weird IOException error when running in a virtual box + // guest OS on a network share. + files = null; + } + + if (files != null) + { + foreach (string file in files) + { + excludeFile = false; + + match = m_Regex.Match(file); + if (match.Success) + { + // Check all excludions and set flag if there are any hits. + foreach (ExcludeNode exclude in exclusions) + { + Regex exRegEx = new Regex(exclude.Pattern); + match = exRegEx.Match(file); + excludeFile |= !match.Success; + } + + if (!excludeFile) + { + m_Files.Add(file); + } + } + } + } + } + + if(recurse) + { + string[] dirs = Directory.GetDirectories(path); + if(dirs != null && dirs.Length > 0) + { + foreach (string str in dirs) + { + // hack to skip subversion folders. Not having this can cause + // a significant performance hit when running on a network drive. + if (str.EndsWith(".svn")) + continue; + + 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", "*"); + 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(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 ); + + if (m_Files.Count < 1) + { + // Include the project name when the match node returns no matches to provide extra + // debug info. + ProjectNode project = Parent.Parent as ProjectNode; + string projectName = ""; + + if (project != null) + projectName = " in project " + project.AssemblyName; + + throw new WarningException("Match" + projectName + " returned no files: {0}{1}", Helper.EndPath(path), pattern); + } + m_Regex = null; + } + + #endregion + } +} diff --git a/Prebuild/src/Core/Nodes/OptionsNode.cs b/Prebuild/src/Core/Nodes/OptionsNode.cs new file mode 100644 index 0000000..577de71 --- /dev/null +++ b/Prebuild/src/Core/Nodes/OptionsNode.cs @@ -0,0 +1,634 @@ +#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; +using System.Collections.Generic; +using System.Reflection; +using System.Xml; + +using Prebuild.Core.Attributes; +using Prebuild.Core.Interfaces; +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; + } + } + + [OptionNode("GenerateDocumentation")] + private bool m_GenerateDocumentation; + + /// + /// + /// + public bool GenerateDocumentation + { + get + { + return m_GenerateDocumentation; + } + set + { + m_GenerateDocumentation = value; + } + } + + [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 new file mode 100644 index 0000000..8ca8e49 --- /dev/null +++ b/Prebuild/src/Core/Nodes/ProcessNode.cs @@ -0,0 +1,108 @@ +#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; +using System.Xml; + +using Prebuild.Core.Attributes; +using Prebuild.Core.Interfaces; +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 + } +} diff --git a/Prebuild/src/Core/Nodes/ProjectNode.cs b/Prebuild/src/Core/Nodes/ProjectNode.cs new file mode 100644 index 0000000..fb92b32 --- /dev/null +++ b/Prebuild/src/Core/Nodes/ProjectNode.cs @@ -0,0 +1,579 @@ +#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; +using System.Collections.Generic; +using System.IO; +using System.Xml; + +using Prebuild.Core.Attributes; +using Prebuild.Core.Interfaces; +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, + } + /// + /// 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 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_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_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. + public List Configurations + { + 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 + { + List tmp = new List(m_ReferencePaths); + tmp.Sort(); + return tmp; + } + } + + /// + /// Gets the references. + /// + /// The references. + public List References + { + 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 + { + 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); + 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_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); + + 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); + + 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_ReferencePaths.Add((ReferencePathNode)dataNode); + } + else if(dataNode is ReferenceNode) + { + m_References.Add((ReferenceNode)dataNode); + } + 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 + + #region IComparable Members + + public int CompareTo(object obj) + { + ProjectNode that = (ProjectNode)obj; + return m_Name.CompareTo(that.m_Name); + } + + #endregion + } +} diff --git a/Prebuild/src/Core/Nodes/ReferenceNode.cs b/Prebuild/src/Core/Nodes/ReferenceNode.cs new file mode 100644 index 0000000..9c5d1a3 --- /dev/null +++ b/Prebuild/src/Core/Nodes/ReferenceNode.cs @@ -0,0 +1,144 @@ +#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; +using System.Xml; + +using Prebuild.Core.Attributes; +using Prebuild.Core.Interfaces; +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 + + #region IComparable Members + + public int CompareTo(object obj) + { + ReferenceNode that = (ReferenceNode)obj; + return this.m_Name.CompareTo(that.m_Name); + } + + #endregion + } +} diff --git a/Prebuild/src/Core/Nodes/ReferencePathNode.cs b/Prebuild/src/Core/Nodes/ReferencePathNode.cs new file mode 100644 index 0000000..7331cd7 --- /dev/null +++ b/Prebuild/src/Core/Nodes/ReferencePathNode.cs @@ -0,0 +1,97 @@ +#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; +using System.Xml; + +using Prebuild.Core.Attributes; +using Prebuild.Core.Interfaces; +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 + + #region IComparable Members + + public int CompareTo(object obj) + { + ReferencePathNode that = (ReferencePathNode)obj; + return this.m_Path.CompareTo(that.m_Path); + } + + #endregion + } +} diff --git a/Prebuild/src/Core/Nodes/SolutionNode.cs b/Prebuild/src/Core/Nodes/SolutionNode.cs new file mode 100644 index 0000000..10c0223 --- /dev/null +++ b/Prebuild/src/Core/Nodes/SolutionNode.cs @@ -0,0 +1,382 @@ +#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; +using System.Collections.Generic; +using System.Diagnostics; +using System.Xml; + +using Prebuild.Core.Attributes; +using Prebuild.Core.Interfaces; +using Prebuild.Core.Utilities; + +namespace Prebuild.Core.Nodes +{ + /// + /// + /// + [DataNode("Solution")] + [DataNode("EmbeddedSolution")] + [DebuggerDisplay("{Name}")] + 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_Version = "1.0.0"; + + 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; + + #endregion + + #region Properties + public override IDataNode Parent + { + get + { + return base.Parent; + } + set + { + if (value is SolutionNode) + { + SolutionNode solution = (SolutionNode)value; + foreach (ConfigurationNode conf in solution.Configurations) + { + m_Configurations[conf.Name] = (ConfigurationNode) conf.Clone(); + } + } + + base.Parent = value; + } + } + + public CleanupNode Cleanup + { + get + { + return m_Cleanup; + } + set + { + m_Cleanup = value; + } + } + + public Guid Guid + { + get + { + return m_Guid; + } + set + { + 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 the database projects. + /// + public ICollection DatabaseProjects + { + get + { + return m_DatabaseProjects.Values; + } + } + /// + /// Gets the nested solutions. + /// + public ICollection Solutions + { + get + { + return m_Solutions.Values; + } + } + /// + /// Gets the nested solutions hash table. + /// + public Dictionary SolutionsTable + { + get + { + return m_Solutions; + } + } + /// + /// 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); + } + else if(dataNode is SolutionNode) + { + m_Solutions[((SolutionNode)dataNode).Name] = (SolutionNode) dataNode; + } + else if (dataNode is ProcessNode) + { + ProcessNode p = (ProcessNode)dataNode; + Kernel.Instance.ProcessFile(p, this); + } + else if (dataNode is DatabaseProjectNode) + { + m_DatabaseProjects[((DatabaseProjectNode)dataNode).Name] = (DatabaseProjectNode) dataNode; + } + else if(dataNode is CleanupNode) + { + if(m_Cleanup != null) + throw new WarningException("There can only be one Cleanup node."); + m_Cleanup = (CleanupNode)dataNode; + } + } + } + finally + { + Kernel.Instance.CurrentWorkingDirectory.Pop(); + } + } + + #endregion + } +} -- cgit v1.1 From d5c7a8d28c9cdfba62f7832fddedbb4523df84ef Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 10 Sep 2010 21:18:23 -0700 Subject: All these files want to be committed. All white space junk. grr. --- .../.svn/text-base/CleanFilesNode.cs.svn-base | 158 ++++++++--------- .../Nodes/.svn/text-base/CleanupNode.cs.svn-base | 168 +++++++++---------- .../ConfigurationNodeCollection.cs.svn-base | 142 ++++++++-------- .../.svn/text-base/DatabaseProjectNode.cs.svn-base | 186 ++++++++++----------- .../text-base/DatabaseReferenceNode.cs.svn-base | 126 +++++++------- Prebuild/src/Core/Nodes/CleanFilesNode.cs | 158 ++++++++--------- Prebuild/src/Core/Nodes/CleanupNode.cs | 168 +++++++++---------- .../src/Core/Nodes/ConfigurationNodeCollection.cs | 142 ++++++++-------- Prebuild/src/Core/Nodes/DatabaseProjectNode.cs | 186 ++++++++++----------- Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs | 126 +++++++------- 10 files changed, 780 insertions(+), 780 deletions(-) (limited to 'Prebuild/src/Core/Nodes') diff --git a/Prebuild/src/Core/Nodes/.svn/text-base/CleanFilesNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/CleanFilesNode.cs.svn-base index dc2da9a..71405f9 100644 --- a/Prebuild/src/Core/Nodes/.svn/text-base/CleanFilesNode.cs.svn-base +++ b/Prebuild/src/Core/Nodes/.svn/text-base/CleanFilesNode.cs.svn-base @@ -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/.svn/text-base/CleanupNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/CleanupNode.cs.svn-base index a9b77eb..b8131b0 100644 --- a/Prebuild/src/Core/Nodes/.svn/text-base/CleanupNode.cs.svn-base +++ b/Prebuild/src/Core/Nodes/.svn/text-base/CleanupNode.cs.svn-base @@ -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/.svn/text-base/ConfigurationNodeCollection.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/ConfigurationNodeCollection.cs.svn-base index 7c59ac5..1c38d9e 100644 --- a/Prebuild/src/Core/Nodes/.svn/text-base/ConfigurationNodeCollection.cs.svn-base +++ b/Prebuild/src/Core/Nodes/.svn/text-base/ConfigurationNodeCollection.cs.svn-base @@ -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/.svn/text-base/DatabaseProjectNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/DatabaseProjectNode.cs.svn-base index 20095c3..278ecd8 100644 --- a/Prebuild/src/Core/Nodes/.svn/text-base/DatabaseProjectNode.cs.svn-base +++ b/Prebuild/src/Core/Nodes/.svn/text-base/DatabaseProjectNode.cs.svn-base @@ -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/.svn/text-base/DatabaseReferenceNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/DatabaseReferenceNode.cs.svn-base index 97c3964..845db24 100644 --- a/Prebuild/src/Core/Nodes/.svn/text-base/DatabaseReferenceNode.cs.svn-base +++ b/Prebuild/src/Core/Nodes/.svn/text-base/DatabaseReferenceNode.cs.svn-base @@ -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/CleanFilesNode.cs b/Prebuild/src/Core/Nodes/CleanFilesNode.cs index dc2da9a..71405f9 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..b8131b0 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/ConfigurationNodeCollection.cs b/Prebuild/src/Core/Nodes/ConfigurationNodeCollection.cs index 7c59ac5..1c38d9e 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/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..845db24 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); + } + } +} -- cgit v1.1 From a9acc6730d4dc33b81da567778cac32517b2068c Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Sat, 11 Sep 2010 18:26:59 -0700 Subject: Removing .svn directories under Prebuild/ from source control --- Prebuild/src/Core/Nodes/.svn/all-wcprops | 119 ---- Prebuild/src/Core/Nodes/.svn/dir-prop-base | 5 - Prebuild/src/Core/Nodes/.svn/entries | 674 --------------------- .../.svn/prop-base/ConfigurationNode.cs.svn-base | 9 - .../Core/Nodes/.svn/prop-base/DataNode.cs.svn-base | 9 - .../Nodes/.svn/prop-base/ExcludeNode.cs.svn-base | 9 - .../Core/Nodes/.svn/prop-base/FileNode.cs.svn-base | 9 - .../Nodes/.svn/prop-base/FilesNode.cs.svn-base | 9 - .../Nodes/.svn/prop-base/MatchNode.cs.svn-base | 9 - .../Nodes/.svn/prop-base/OptionsNode.cs.svn-base | 9 - .../Nodes/.svn/prop-base/ProcessNode.cs.svn-base | 9 - .../Nodes/.svn/prop-base/ProjectNode.cs.svn-base | 9 - .../Nodes/.svn/prop-base/ReferenceNode.cs.svn-base | 9 - .../.svn/prop-base/ReferencePathNode.cs.svn-base | 9 - .../Nodes/.svn/prop-base/SolutionNode.cs.svn-base | 9 - .../Nodes/.svn/text-base/AuthorNode.cs.svn-base | 87 --- .../.svn/text-base/CleanFilesNode.cs.svn-base | 80 --- .../Nodes/.svn/text-base/CleanupNode.cs.svn-base | 85 --- .../.svn/text-base/ConfigurationNode.cs.svn-base | 225 ------- .../ConfigurationNodeCollection.cs.svn-base | 71 --- .../Core/Nodes/.svn/text-base/DataNode.cs.svn-base | 117 ---- .../.svn/text-base/DatabaseProjectNode.cs.svn-base | 93 --- .../text-base/DatabaseReferenceNode.cs.svn-base | 63 -- .../.svn/text-base/DescriptionNode.cs.svn-base | 87 --- .../Nodes/.svn/text-base/ExcludeNode.cs.svn-base | 89 --- .../Core/Nodes/.svn/text-base/FileNode.cs.svn-base | 285 --------- .../Nodes/.svn/text-base/FilesNode.cs.svn-base | 204 ------- .../Nodes/.svn/text-base/MatchNode.cs.svn-base | 367 ----------- .../Nodes/.svn/text-base/OptionsNode.cs.svn-base | 634 ------------------- .../Nodes/.svn/text-base/ProcessNode.cs.svn-base | 108 ---- .../Nodes/.svn/text-base/ProjectNode.cs.svn-base | 579 ------------------ .../Nodes/.svn/text-base/ReferenceNode.cs.svn-base | 144 ----- .../.svn/text-base/ReferencePathNode.cs.svn-base | 97 --- .../Nodes/.svn/text-base/SolutionNode.cs.svn-base | 382 ------------ 34 files changed, 4703 deletions(-) delete mode 100644 Prebuild/src/Core/Nodes/.svn/all-wcprops delete mode 100644 Prebuild/src/Core/Nodes/.svn/dir-prop-base delete mode 100644 Prebuild/src/Core/Nodes/.svn/entries delete mode 100644 Prebuild/src/Core/Nodes/.svn/prop-base/ConfigurationNode.cs.svn-base delete mode 100644 Prebuild/src/Core/Nodes/.svn/prop-base/DataNode.cs.svn-base delete mode 100644 Prebuild/src/Core/Nodes/.svn/prop-base/ExcludeNode.cs.svn-base delete mode 100644 Prebuild/src/Core/Nodes/.svn/prop-base/FileNode.cs.svn-base delete mode 100644 Prebuild/src/Core/Nodes/.svn/prop-base/FilesNode.cs.svn-base delete mode 100644 Prebuild/src/Core/Nodes/.svn/prop-base/MatchNode.cs.svn-base delete mode 100644 Prebuild/src/Core/Nodes/.svn/prop-base/OptionsNode.cs.svn-base delete mode 100644 Prebuild/src/Core/Nodes/.svn/prop-base/ProcessNode.cs.svn-base delete mode 100644 Prebuild/src/Core/Nodes/.svn/prop-base/ProjectNode.cs.svn-base delete mode 100644 Prebuild/src/Core/Nodes/.svn/prop-base/ReferenceNode.cs.svn-base delete mode 100644 Prebuild/src/Core/Nodes/.svn/prop-base/ReferencePathNode.cs.svn-base delete mode 100644 Prebuild/src/Core/Nodes/.svn/prop-base/SolutionNode.cs.svn-base delete mode 100644 Prebuild/src/Core/Nodes/.svn/text-base/AuthorNode.cs.svn-base delete mode 100644 Prebuild/src/Core/Nodes/.svn/text-base/CleanFilesNode.cs.svn-base delete mode 100644 Prebuild/src/Core/Nodes/.svn/text-base/CleanupNode.cs.svn-base delete mode 100644 Prebuild/src/Core/Nodes/.svn/text-base/ConfigurationNode.cs.svn-base delete mode 100644 Prebuild/src/Core/Nodes/.svn/text-base/ConfigurationNodeCollection.cs.svn-base delete mode 100644 Prebuild/src/Core/Nodes/.svn/text-base/DataNode.cs.svn-base delete mode 100644 Prebuild/src/Core/Nodes/.svn/text-base/DatabaseProjectNode.cs.svn-base delete mode 100644 Prebuild/src/Core/Nodes/.svn/text-base/DatabaseReferenceNode.cs.svn-base delete mode 100644 Prebuild/src/Core/Nodes/.svn/text-base/DescriptionNode.cs.svn-base delete mode 100644 Prebuild/src/Core/Nodes/.svn/text-base/ExcludeNode.cs.svn-base delete mode 100644 Prebuild/src/Core/Nodes/.svn/text-base/FileNode.cs.svn-base delete mode 100644 Prebuild/src/Core/Nodes/.svn/text-base/FilesNode.cs.svn-base delete mode 100644 Prebuild/src/Core/Nodes/.svn/text-base/MatchNode.cs.svn-base delete mode 100644 Prebuild/src/Core/Nodes/.svn/text-base/OptionsNode.cs.svn-base delete mode 100644 Prebuild/src/Core/Nodes/.svn/text-base/ProcessNode.cs.svn-base delete mode 100644 Prebuild/src/Core/Nodes/.svn/text-base/ProjectNode.cs.svn-base delete mode 100644 Prebuild/src/Core/Nodes/.svn/text-base/ReferenceNode.cs.svn-base delete mode 100644 Prebuild/src/Core/Nodes/.svn/text-base/ReferencePathNode.cs.svn-base delete mode 100644 Prebuild/src/Core/Nodes/.svn/text-base/SolutionNode.cs.svn-base (limited to 'Prebuild/src/Core/Nodes') diff --git a/Prebuild/src/Core/Nodes/.svn/all-wcprops b/Prebuild/src/Core/Nodes/.svn/all-wcprops deleted file mode 100644 index 6565f05..0000000 --- a/Prebuild/src/Core/Nodes/.svn/all-wcprops +++ /dev/null @@ -1,119 +0,0 @@ -K 25 -svn:wc:ra_dav:version-url -V 56 -/svnroot/dnpb/!svn/ver/321/trunk/Prebuild/src/Core/Nodes -END -CleanFilesNode.cs -K 25 -svn:wc:ra_dav:version-url -V 74 -/svnroot/dnpb/!svn/ver/307/trunk/Prebuild/src/Core/Nodes/CleanFilesNode.cs -END -ProjectNode.cs -K 25 -svn:wc:ra_dav:version-url -V 71 -/svnroot/dnpb/!svn/ver/319/trunk/Prebuild/src/Core/Nodes/ProjectNode.cs -END -ConfigurationNode.cs -K 25 -svn:wc:ra_dav:version-url -V 77 -/svnroot/dnpb/!svn/ver/316/trunk/Prebuild/src/Core/Nodes/ConfigurationNode.cs -END -DataNode.cs -K 25 -svn:wc:ra_dav:version-url -V 68 -/svnroot/dnpb/!svn/ver/321/trunk/Prebuild/src/Core/Nodes/DataNode.cs -END -ReferencePathNode.cs -K 25 -svn:wc:ra_dav:version-url -V 77 -/svnroot/dnpb/!svn/ver/307/trunk/Prebuild/src/Core/Nodes/ReferencePathNode.cs -END -SolutionNode.cs -K 25 -svn:wc:ra_dav:version-url -V 72 -/svnroot/dnpb/!svn/ver/315/trunk/Prebuild/src/Core/Nodes/SolutionNode.cs -END -ProcessNode.cs -K 25 -svn:wc:ra_dav:version-url -V 71 -/svnroot/dnpb/!svn/ver/307/trunk/Prebuild/src/Core/Nodes/ProcessNode.cs -END -FileNode.cs -K 25 -svn:wc:ra_dav:version-url -V 68 -/svnroot/dnpb/!svn/ver/316/trunk/Prebuild/src/Core/Nodes/FileNode.cs -END -DescriptionNode.cs -K 25 -svn:wc:ra_dav:version-url -V 75 -/svnroot/dnpb/!svn/ver/307/trunk/Prebuild/src/Core/Nodes/DescriptionNode.cs -END -DatabaseReferenceNode.cs -K 25 -svn:wc:ra_dav:version-url -V 81 -/svnroot/dnpb/!svn/ver/295/trunk/Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs -END -ConfigurationNodeCollection.cs -K 25 -svn:wc:ra_dav:version-url -V 87 -/svnroot/dnpb/!svn/ver/315/trunk/Prebuild/src/Core/Nodes/ConfigurationNodeCollection.cs -END -CleanupNode.cs -K 25 -svn:wc:ra_dav:version-url -V 71 -/svnroot/dnpb/!svn/ver/307/trunk/Prebuild/src/Core/Nodes/CleanupNode.cs -END -ExcludeNode.cs -K 25 -svn:wc:ra_dav:version-url -V 71 -/svnroot/dnpb/!svn/ver/295/trunk/Prebuild/src/Core/Nodes/ExcludeNode.cs -END -OptionsNode.cs -K 25 -svn:wc:ra_dav:version-url -V 71 -/svnroot/dnpb/!svn/ver/315/trunk/Prebuild/src/Core/Nodes/OptionsNode.cs -END -DatabaseProjectNode.cs -K 25 -svn:wc:ra_dav:version-url -V 79 -/svnroot/dnpb/!svn/ver/307/trunk/Prebuild/src/Core/Nodes/DatabaseProjectNode.cs -END -MatchNode.cs -K 25 -svn:wc:ra_dav:version-url -V 69 -/svnroot/dnpb/!svn/ver/318/trunk/Prebuild/src/Core/Nodes/MatchNode.cs -END -ReferenceNode.cs -K 25 -svn:wc:ra_dav:version-url -V 73 -/svnroot/dnpb/!svn/ver/295/trunk/Prebuild/src/Core/Nodes/ReferenceNode.cs -END -FilesNode.cs -K 25 -svn:wc:ra_dav:version-url -V 69 -/svnroot/dnpb/!svn/ver/307/trunk/Prebuild/src/Core/Nodes/FilesNode.cs -END -AuthorNode.cs -K 25 -svn:wc:ra_dav:version-url -V 70 -/svnroot/dnpb/!svn/ver/307/trunk/Prebuild/src/Core/Nodes/AuthorNode.cs -END diff --git a/Prebuild/src/Core/Nodes/.svn/dir-prop-base b/Prebuild/src/Core/Nodes/.svn/dir-prop-base deleted file mode 100644 index a1989a0..0000000 --- a/Prebuild/src/Core/Nodes/.svn/dir-prop-base +++ /dev/null @@ -1,5 +0,0 @@ -K 10 -svn:ignore -V 5 -*.swp -END diff --git a/Prebuild/src/Core/Nodes/.svn/entries b/Prebuild/src/Core/Nodes/.svn/entries deleted file mode 100644 index b60f190..0000000 --- a/Prebuild/src/Core/Nodes/.svn/entries +++ /dev/null @@ -1,674 +0,0 @@ -10 - -dir -323 -https://dnpb.svn.sourceforge.net/svnroot/dnpb/trunk/Prebuild/src/Core/Nodes -https://dnpb.svn.sourceforge.net/svnroot/dnpb - - - -2010-08-12T16:58:08.825470Z -321 -jhurliman -has-props - - - - - - - - - - - - - -3355ff64-970d-0410-bbe8-d0fbd18be4fb - -CleanFilesNode.cs -file - - - - -2010-09-10T22:51:44.000000Z -c798b3c4167ec1a3815ddae93a552427 -2009-04-15T01:28:16.827957Z -307 -kunnis - - - - - - - - - - - - - - - - - - - - - -2666 - -ProjectNode.cs -file - - - - -2010-09-10T22:51:44.000000Z -be9ade7048917117783a06508fa4d378 -2010-05-09T23:19:49.063286Z -319 -jhurliman -has-props - - - - - - - - - - - - - - - - - - - - -13444 - -ConfigurationNode.cs -file - - - - -2010-09-10T22:51:44.000000Z -e42a548bfaba22cf94dbb203b2b28352 -2010-05-08T05:43:01.449559Z -316 -jhurliman -has-props - - - - - - - - - - - - - - - - - - - - -5222 - -DataNode.cs -file - - - - -2010-09-10T22:51:44.000000Z -39b1d83bff018fce9f616ae2e6f1be82 -2010-08-12T16:58:08.825470Z -321 -jhurliman -has-props - - - - - - - - - - - - - - - - - - - - -3294 - -ReferencePathNode.cs -file - - - - -2010-09-10T22:51:44.000000Z -409c91bafff2572218a6cdefcc6ec48c -2009-04-15T01:28:16.827957Z -307 -kunnis -has-props - - - - - - - - - - - - - - - - - - - - -2677 - -SolutionNode.cs -file - - - - -2010-09-10T22:51:44.000000Z -79bdf34c92682dc5ba8b5db15aaa95d6 -2009-06-06T19:47:31.451428Z -315 -dmoonfire -has-props - - - - - - - - - - - - - - - - - - - - -9720 - -ProcessNode.cs -file - - - - -2010-09-10T22:51:44.000000Z -1816314797ef66235c58938b33ea2b3b -2009-04-15T01:28:16.827957Z -307 -kunnis -has-props - - - - - - - - - - - - - - - - - - - - -2900 - -FileNode.cs -file - - - - -2010-09-10T22:51:44.000000Z -43f98599da19618be6c6ed74f36fceae -2010-05-08T05:43:01.449559Z -316 -jhurliman -has-props - - - - - - - - - - - - - - - - - - - - -6043 - -DescriptionNode.cs -file - - - - -2010-09-10T22:51:44.000000Z -3f8a8b8cc4b3a94b94109276ad2222d3 -2009-04-15T01:28:16.827957Z -307 -kunnis - - - - - - - - - - - - - - - - - - - - - -2493 - -DatabaseReferenceNode.cs -file - - - - -2010-09-10T22:51:44.000000Z -4104ed953ae9105ac6498ce7882ed8ee -2009-02-19T06:47:52.218324Z -295 -kunnis - - - - - - - - - - - - - - - - - - - - - -2390 - -ConfigurationNodeCollection.cs -file - - - - -2010-09-10T22:51:44.000000Z -8620885fc85bdc06288acf6b8f58b3ff -2009-06-06T19:47:31.451428Z -315 -dmoonfire - - - - - - - - - - - - - - - - - - - - - -2406 - -CleanupNode.cs -file - - - - -2010-09-10T22:51:44.000000Z -198fb1e15cd545655978686277e39d96 -2009-04-15T01:28:16.827957Z -307 -kunnis - - - - - - - - - - - - - - - - - - - - - -2689 - -ExcludeNode.cs -file - - - - -2010-09-10T22:51:44.000000Z -810fc73f537028052471239c72f41c11 -2009-02-19T06:47:52.218324Z -295 -kunnis -has-props - - - - - - - - - - - - - - - - - - - - -2608 - -OptionsNode.cs -file - - - - -2010-09-10T22:51:44.000000Z -691dd5f7e7ce2a06814cdcae611fc40e -2009-06-06T19:47:31.451428Z -315 -dmoonfire -has-props - - - - - - - - - - - - - - - - - - - - -10949 - -DatabaseProjectNode.cs -file - - - - -2010-09-10T22:51:44.000000Z -18995e6577e6bb3622fe41f5bfe01b48 -2009-04-15T01:28:16.827957Z -307 -kunnis - - - - - - - - - - - - - - - - - - - - - -2476 - -MatchNode.cs -file - - - - -2010-09-10T22:51:44.000000Z -3344ef3bdb7db2006eb987a80128cd06 -2010-05-09T08:21:52.307305Z -318 -jhurliman -has-props - - - - - - - - - - - - - - - - - - - - -10846 - -ReferenceNode.cs -file - - - - -2010-09-10T22:51:44.000000Z -18d76c27d53a4d54f16f57a855a21916 -2009-02-19T06:47:52.218324Z -295 -kunnis -has-props - - - - - - - - - - - - - - - - - - - - -3705 - -FilesNode.cs -file - - - - -2010-09-10T22:51:44.000000Z -e6ddefd5fff49958f77b5ef96f06c09e -2009-04-15T01:28:16.827957Z -307 -kunnis -has-props - - - - - - - - - - - - - - - - - - - - -6036 - -AuthorNode.cs -file - - - - -2010-09-10T22:51:44.000000Z -07607d8988fc1236ab8bef5fc12f8cd5 -2009-04-15T01:28:16.827957Z -307 -kunnis - - - - - - - - - - - - - - - - - - - - - -2425 - diff --git a/Prebuild/src/Core/Nodes/.svn/prop-base/ConfigurationNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/prop-base/ConfigurationNode.cs.svn-base deleted file mode 100644 index 7b57b30..0000000 --- a/Prebuild/src/Core/Nodes/.svn/prop-base/ConfigurationNode.cs.svn-base +++ /dev/null @@ -1,9 +0,0 @@ -K 13 -svn:eol-style -V 6 -native -K 12 -svn:keywords -V 23 -Author Date Id Revision -END diff --git a/Prebuild/src/Core/Nodes/.svn/prop-base/DataNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/prop-base/DataNode.cs.svn-base deleted file mode 100644 index 7b57b30..0000000 --- a/Prebuild/src/Core/Nodes/.svn/prop-base/DataNode.cs.svn-base +++ /dev/null @@ -1,9 +0,0 @@ -K 13 -svn:eol-style -V 6 -native -K 12 -svn:keywords -V 23 -Author Date Id Revision -END diff --git a/Prebuild/src/Core/Nodes/.svn/prop-base/ExcludeNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/prop-base/ExcludeNode.cs.svn-base deleted file mode 100644 index 7b57b30..0000000 --- a/Prebuild/src/Core/Nodes/.svn/prop-base/ExcludeNode.cs.svn-base +++ /dev/null @@ -1,9 +0,0 @@ -K 13 -svn:eol-style -V 6 -native -K 12 -svn:keywords -V 23 -Author Date Id Revision -END diff --git a/Prebuild/src/Core/Nodes/.svn/prop-base/FileNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/prop-base/FileNode.cs.svn-base deleted file mode 100644 index 7b57b30..0000000 --- a/Prebuild/src/Core/Nodes/.svn/prop-base/FileNode.cs.svn-base +++ /dev/null @@ -1,9 +0,0 @@ -K 13 -svn:eol-style -V 6 -native -K 12 -svn:keywords -V 23 -Author Date Id Revision -END diff --git a/Prebuild/src/Core/Nodes/.svn/prop-base/FilesNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/prop-base/FilesNode.cs.svn-base deleted file mode 100644 index 7b57b30..0000000 --- a/Prebuild/src/Core/Nodes/.svn/prop-base/FilesNode.cs.svn-base +++ /dev/null @@ -1,9 +0,0 @@ -K 13 -svn:eol-style -V 6 -native -K 12 -svn:keywords -V 23 -Author Date Id Revision -END diff --git a/Prebuild/src/Core/Nodes/.svn/prop-base/MatchNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/prop-base/MatchNode.cs.svn-base deleted file mode 100644 index 7b57b30..0000000 --- a/Prebuild/src/Core/Nodes/.svn/prop-base/MatchNode.cs.svn-base +++ /dev/null @@ -1,9 +0,0 @@ -K 13 -svn:eol-style -V 6 -native -K 12 -svn:keywords -V 23 -Author Date Id Revision -END diff --git a/Prebuild/src/Core/Nodes/.svn/prop-base/OptionsNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/prop-base/OptionsNode.cs.svn-base deleted file mode 100644 index 7b57b30..0000000 --- a/Prebuild/src/Core/Nodes/.svn/prop-base/OptionsNode.cs.svn-base +++ /dev/null @@ -1,9 +0,0 @@ -K 13 -svn:eol-style -V 6 -native -K 12 -svn:keywords -V 23 -Author Date Id Revision -END diff --git a/Prebuild/src/Core/Nodes/.svn/prop-base/ProcessNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/prop-base/ProcessNode.cs.svn-base deleted file mode 100644 index 7b57b30..0000000 --- a/Prebuild/src/Core/Nodes/.svn/prop-base/ProcessNode.cs.svn-base +++ /dev/null @@ -1,9 +0,0 @@ -K 13 -svn:eol-style -V 6 -native -K 12 -svn:keywords -V 23 -Author Date Id Revision -END diff --git a/Prebuild/src/Core/Nodes/.svn/prop-base/ProjectNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/prop-base/ProjectNode.cs.svn-base deleted file mode 100644 index 7b57b30..0000000 --- a/Prebuild/src/Core/Nodes/.svn/prop-base/ProjectNode.cs.svn-base +++ /dev/null @@ -1,9 +0,0 @@ -K 13 -svn:eol-style -V 6 -native -K 12 -svn:keywords -V 23 -Author Date Id Revision -END diff --git a/Prebuild/src/Core/Nodes/.svn/prop-base/ReferenceNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/prop-base/ReferenceNode.cs.svn-base deleted file mode 100644 index 7b57b30..0000000 --- a/Prebuild/src/Core/Nodes/.svn/prop-base/ReferenceNode.cs.svn-base +++ /dev/null @@ -1,9 +0,0 @@ -K 13 -svn:eol-style -V 6 -native -K 12 -svn:keywords -V 23 -Author Date Id Revision -END diff --git a/Prebuild/src/Core/Nodes/.svn/prop-base/ReferencePathNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/prop-base/ReferencePathNode.cs.svn-base deleted file mode 100644 index 7b57b30..0000000 --- a/Prebuild/src/Core/Nodes/.svn/prop-base/ReferencePathNode.cs.svn-base +++ /dev/null @@ -1,9 +0,0 @@ -K 13 -svn:eol-style -V 6 -native -K 12 -svn:keywords -V 23 -Author Date Id Revision -END diff --git a/Prebuild/src/Core/Nodes/.svn/prop-base/SolutionNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/prop-base/SolutionNode.cs.svn-base deleted file mode 100644 index 7b57b30..0000000 --- a/Prebuild/src/Core/Nodes/.svn/prop-base/SolutionNode.cs.svn-base +++ /dev/null @@ -1,9 +0,0 @@ -K 13 -svn:eol-style -V 6 -native -K 12 -svn:keywords -V 23 -Author Date Id Revision -END diff --git a/Prebuild/src/Core/Nodes/.svn/text-base/AuthorNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/AuthorNode.cs.svn-base deleted file mode 100644 index 4c415bb..0000000 --- a/Prebuild/src/Core/Nodes/.svn/text-base/AuthorNode.cs.svn-base +++ /dev/null @@ -1,87 +0,0 @@ -#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.Xml; - -using Prebuild.Core.Attributes; -using Prebuild.Core.Interfaces; -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 - } -} diff --git a/Prebuild/src/Core/Nodes/.svn/text-base/CleanFilesNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/CleanFilesNode.cs.svn-base deleted file mode 100644 index 71405f9..0000000 --- a/Prebuild/src/Core/Nodes/.svn/text-base/CleanFilesNode.cs.svn-base +++ /dev/null @@ -1,80 +0,0 @@ -#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/.svn/text-base/CleanupNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/CleanupNode.cs.svn-base deleted file mode 100644 index b8131b0..0000000 --- a/Prebuild/src/Core/Nodes/.svn/text-base/CleanupNode.cs.svn-base +++ /dev/null @@ -1,85 +0,0 @@ -#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/.svn/text-base/ConfigurationNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/ConfigurationNode.cs.svn-base deleted file mode 100644 index cd2f740..0000000 --- a/Prebuild/src/Core/Nodes/.svn/text-base/ConfigurationNode.cs.svn-base +++ /dev/null @@ -1,225 +0,0 @@ -#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; -using System.Xml; - -using Prebuild.Core.Attributes; -using Prebuild.Core.Interfaces; -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 - { - 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 - - #region IComparable Members - - public int CompareTo(object obj) - { - ConfigurationNode that = (ConfigurationNode) obj; - return this.m_Name.CompareTo(that.m_Name); - } - - #endregion - } -} diff --git a/Prebuild/src/Core/Nodes/.svn/text-base/ConfigurationNodeCollection.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/ConfigurationNodeCollection.cs.svn-base deleted file mode 100644 index 1c38d9e..0000000 --- a/Prebuild/src/Core/Nodes/.svn/text-base/ConfigurationNodeCollection.cs.svn-base +++ /dev/null @@ -1,71 +0,0 @@ -#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/.svn/text-base/DataNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/DataNode.cs.svn-base deleted file mode 100644 index 318b13c..0000000 --- a/Prebuild/src/Core/Nodes/.svn/text-base/DataNode.cs.svn-base +++ /dev/null @@ -1,117 +0,0 @@ -#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; -using System.Xml; - -using Prebuild.Core.Attributes; -using Prebuild.Core.Interfaces; -using System.IO; - -namespace Prebuild.Core.Nodes -{ - /// - /// - /// - public abstract class DataNode : IDataNode - { - #region Fields - - private IDataNode parent; - string[] m_WebTypes = new string[] { "aspx", "ascx", "master", "ashx", "asmx" }; - - #endregion - - #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) - { - if (path.EndsWith(type)) - { - return SubType.CodeBehind; - } - } - } - return SubType.Code; - } - #endregion - } -} diff --git a/Prebuild/src/Core/Nodes/.svn/text-base/DatabaseProjectNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/DatabaseProjectNode.cs.svn-base deleted file mode 100644 index 278ecd8..0000000 --- a/Prebuild/src/Core/Nodes/.svn/text-base/DatabaseProjectNode.cs.svn-base +++ /dev/null @@ -1,93 +0,0 @@ -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/.svn/text-base/DatabaseReferenceNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/DatabaseReferenceNode.cs.svn-base deleted file mode 100644 index 845db24..0000000 --- a/Prebuild/src/Core/Nodes/.svn/text-base/DatabaseReferenceNode.cs.svn-base +++ /dev/null @@ -1,63 +0,0 @@ -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/.svn/text-base/DescriptionNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/DescriptionNode.cs.svn-base deleted file mode 100644 index d1293a0..0000000 --- a/Prebuild/src/Core/Nodes/.svn/text-base/DescriptionNode.cs.svn-base +++ /dev/null @@ -1,87 +0,0 @@ -#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.Xml; - -using Prebuild.Core.Attributes; -using Prebuild.Core.Interfaces; -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 - } -} diff --git a/Prebuild/src/Core/Nodes/.svn/text-base/ExcludeNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/ExcludeNode.cs.svn-base deleted file mode 100644 index 7f04cba..0000000 --- a/Prebuild/src/Core/Nodes/.svn/text-base/ExcludeNode.cs.svn-base +++ /dev/null @@ -1,89 +0,0 @@ -#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; -using System.Xml; - -using Prebuild.Core.Attributes; -using Prebuild.Core.Interfaces; -using Prebuild.Core.Utilities; - -namespace Prebuild.Core.Nodes -{ - /// - /// - /// - [DataNode("Exclude")] - public class ExcludeNode : DataNode - { - #region Fields - - private string m_Pattern = ""; - - #endregion - - #region Properties - - /// - /// Gets the name. - /// - /// The name. - public string Name - { - get - { - return m_Pattern; - } - } - - /// - /// Gets the pattern. - /// - /// The pattern. - public string Pattern - { - get - { - return m_Pattern; - } - } - - #endregion - - #region Public Methods - - /// - /// 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 - } -} diff --git a/Prebuild/src/Core/Nodes/.svn/text-base/FileNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/FileNode.cs.svn-base deleted file mode 100644 index 01cea1e..0000000 --- a/Prebuild/src/Core/Nodes/.svn/text-base/FileNode.cs.svn-base +++ /dev/null @@ -1,285 +0,0 @@ -#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; -using System.IO; -using System.Xml; - -using Prebuild.Core.Attributes; -using Prebuild.Core.Interfaces; -using Prebuild.Core.Utilities; -using Prebuild.Core.Targets; - -namespace Prebuild.Core.Nodes -{ - /// - /// - /// - public enum BuildAction - { - /// - /// - /// - None, - /// - /// - /// - Compile, - /// - /// - /// - Content, - /// - /// - /// - EmbeddedResource, - /// - /// - /// - ApplicationDefinition, - /// - /// - /// - Page - } - - /// - /// - /// - 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; - 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; - } - } - - /// - /// - /// - /// - /// - public bool PreservePath - { - get - { - return m_PreservePath; - } - } - - #endregion - - #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); - - 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 (System.IO.Path.GetExtension(m_Path) == ".settings") - { - m_SubType = SubType.Settings; - m_BuildAction = BuildAction.None; - } - } - - #endregion - } -} diff --git a/Prebuild/src/Core/Nodes/.svn/text-base/FilesNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/FilesNode.cs.svn-base deleted file mode 100644 index 23a716c..0000000 --- a/Prebuild/src/Core/Nodes/.svn/text-base/FilesNode.cs.svn-base +++ /dev/null @@ -1,204 +0,0 @@ -#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; -using System.Collections.Generic; -using System.Xml; - -using Prebuild.Core.Attributes; -using Prebuild.Core.Interfaces; -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(); - private readonly Dictionary m_PreservePaths = new Dictionary(); - - #endregion - - #region Properties - - public int Count - { - get - { - return m_Files.Count; - } - } - - #endregion - - #region Public Methods - - public BuildAction GetBuildAction(string file) - { - if(!m_BuildActions.ContainsKey(file)) - { - return BuildAction.Compile; - } - - return m_BuildActions[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 bool GetPreservePath( string file ) - { - if ( !m_PreservePaths.ContainsKey( file ) ) - { - return false; - } - - 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; - 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) - { - MatchNode matchNode = (MatchNode)dataNode; - if (!m_Files.Contains(file)) - { - m_Files.Add(file); - if (matchNode.BuildAction == null) - m_BuildActions[file] = GetBuildActionByFileName(file); - else - m_BuildActions[file] = matchNode.BuildAction.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 - - } -} diff --git a/Prebuild/src/Core/Nodes/.svn/text-base/MatchNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/MatchNode.cs.svn-base deleted file mode 100644 index 9735265..0000000 --- a/Prebuild/src/Core/Nodes/.svn/text-base/MatchNode.cs.svn-base +++ /dev/null @@ -1,367 +0,0 @@ -#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; -using System.Collections.Generic; -using System.IO; -using System.Text.RegularExpressions; -using System.Xml; - -using Prebuild.Core.Attributes; -using Prebuild.Core.Interfaces; -using Prebuild.Core.Utilities; - -namespace Prebuild.Core.Nodes -{ - /// - /// - /// - [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 bool m_PreservePath; - private readonly List m_Exclusions = new List(); - - #endregion - - #region Properties - - /// - /// - /// - public IEnumerable Files - { - get - { - return m_Files; - } - } - - /// - /// - /// - public BuildAction? BuildAction - { - get - { - return m_BuildAction; - } - } - - /// - /// - /// - 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 - { - get - { - return m_PreservePath; - } - } - - #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); - } - 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. - // 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 - - files = null; - } - - 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; - } - - // Check all excludions and set flag if there are any hits. - foreach ( ExcludeNode exclude in exclusions ) - { - Regex exRegEx = new Regex( exclude.Pattern ); - match = exRegEx.Match( file ); - excludeFile |= match.Success; - } - - if ( !excludeFile ) - { - 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); - } - catch (IOException) - { - // swallow weird IOException error when running in a virtual box - // guest OS on a network share. - files = null; - } - - if (files != null) - { - foreach (string file in files) - { - excludeFile = false; - - match = m_Regex.Match(file); - if (match.Success) - { - // Check all excludions and set flag if there are any hits. - foreach (ExcludeNode exclude in exclusions) - { - Regex exRegEx = new Regex(exclude.Pattern); - match = exRegEx.Match(file); - excludeFile |= !match.Success; - } - - if (!excludeFile) - { - m_Files.Add(file); - } - } - } - } - } - - if(recurse) - { - string[] dirs = Directory.GetDirectories(path); - if(dirs != null && dirs.Length > 0) - { - foreach (string str in dirs) - { - // hack to skip subversion folders. Not having this can cause - // a significant performance hit when running on a network drive. - if (str.EndsWith(".svn")) - continue; - - 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", "*"); - 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(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 ); - - if (m_Files.Count < 1) - { - // Include the project name when the match node returns no matches to provide extra - // debug info. - ProjectNode project = Parent.Parent as ProjectNode; - string projectName = ""; - - if (project != null) - projectName = " in project " + project.AssemblyName; - - throw new WarningException("Match" + projectName + " returned no files: {0}{1}", Helper.EndPath(path), pattern); - } - m_Regex = null; - } - - #endregion - } -} diff --git a/Prebuild/src/Core/Nodes/.svn/text-base/OptionsNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/OptionsNode.cs.svn-base deleted file mode 100644 index 577de71..0000000 --- a/Prebuild/src/Core/Nodes/.svn/text-base/OptionsNode.cs.svn-base +++ /dev/null @@ -1,634 +0,0 @@ -#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; -using System.Collections.Generic; -using System.Reflection; -using System.Xml; - -using Prebuild.Core.Attributes; -using Prebuild.Core.Interfaces; -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; - } - } - - [OptionNode("GenerateDocumentation")] - private bool m_GenerateDocumentation; - - /// - /// - /// - public bool GenerateDocumentation - { - get - { - return m_GenerateDocumentation; - } - set - { - m_GenerateDocumentation = value; - } - } - - [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/.svn/text-base/ProcessNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/ProcessNode.cs.svn-base deleted file mode 100644 index 8ca8e49..0000000 --- a/Prebuild/src/Core/Nodes/.svn/text-base/ProcessNode.cs.svn-base +++ /dev/null @@ -1,108 +0,0 @@ -#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; -using System.Xml; - -using Prebuild.Core.Attributes; -using Prebuild.Core.Interfaces; -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 - } -} diff --git a/Prebuild/src/Core/Nodes/.svn/text-base/ProjectNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/ProjectNode.cs.svn-base deleted file mode 100644 index fb92b32..0000000 --- a/Prebuild/src/Core/Nodes/.svn/text-base/ProjectNode.cs.svn-base +++ /dev/null @@ -1,579 +0,0 @@ -#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; -using System.Collections.Generic; -using System.IO; -using System.Xml; - -using Prebuild.Core.Attributes; -using Prebuild.Core.Interfaces; -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, - } - /// - /// 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 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_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_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. - public List Configurations - { - 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 - { - List tmp = new List(m_ReferencePaths); - tmp.Sort(); - return tmp; - } - } - - /// - /// Gets the references. - /// - /// The references. - public List References - { - 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 - { - 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); - 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_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); - - 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); - - 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_ReferencePaths.Add((ReferencePathNode)dataNode); - } - else if(dataNode is ReferenceNode) - { - m_References.Add((ReferenceNode)dataNode); - } - 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 - - #region IComparable Members - - public int CompareTo(object obj) - { - ProjectNode that = (ProjectNode)obj; - return m_Name.CompareTo(that.m_Name); - } - - #endregion - } -} diff --git a/Prebuild/src/Core/Nodes/.svn/text-base/ReferenceNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/ReferenceNode.cs.svn-base deleted file mode 100644 index 9c5d1a3..0000000 --- a/Prebuild/src/Core/Nodes/.svn/text-base/ReferenceNode.cs.svn-base +++ /dev/null @@ -1,144 +0,0 @@ -#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; -using System.Xml; - -using Prebuild.Core.Attributes; -using Prebuild.Core.Interfaces; -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 - - #region IComparable Members - - public int CompareTo(object obj) - { - ReferenceNode that = (ReferenceNode)obj; - return this.m_Name.CompareTo(that.m_Name); - } - - #endregion - } -} diff --git a/Prebuild/src/Core/Nodes/.svn/text-base/ReferencePathNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/ReferencePathNode.cs.svn-base deleted file mode 100644 index 7331cd7..0000000 --- a/Prebuild/src/Core/Nodes/.svn/text-base/ReferencePathNode.cs.svn-base +++ /dev/null @@ -1,97 +0,0 @@ -#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; -using System.Xml; - -using Prebuild.Core.Attributes; -using Prebuild.Core.Interfaces; -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 - - #region IComparable Members - - public int CompareTo(object obj) - { - ReferencePathNode that = (ReferencePathNode)obj; - return this.m_Path.CompareTo(that.m_Path); - } - - #endregion - } -} diff --git a/Prebuild/src/Core/Nodes/.svn/text-base/SolutionNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/SolutionNode.cs.svn-base deleted file mode 100644 index 10c0223..0000000 --- a/Prebuild/src/Core/Nodes/.svn/text-base/SolutionNode.cs.svn-base +++ /dev/null @@ -1,382 +0,0 @@ -#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; -using System.Collections.Generic; -using System.Diagnostics; -using System.Xml; - -using Prebuild.Core.Attributes; -using Prebuild.Core.Interfaces; -using Prebuild.Core.Utilities; - -namespace Prebuild.Core.Nodes -{ - /// - /// - /// - [DataNode("Solution")] - [DataNode("EmbeddedSolution")] - [DebuggerDisplay("{Name}")] - 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_Version = "1.0.0"; - - 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; - - #endregion - - #region Properties - public override IDataNode Parent - { - get - { - return base.Parent; - } - set - { - if (value is SolutionNode) - { - SolutionNode solution = (SolutionNode)value; - foreach (ConfigurationNode conf in solution.Configurations) - { - m_Configurations[conf.Name] = (ConfigurationNode) conf.Clone(); - } - } - - base.Parent = value; - } - } - - public CleanupNode Cleanup - { - get - { - return m_Cleanup; - } - set - { - m_Cleanup = value; - } - } - - public Guid Guid - { - get - { - return m_Guid; - } - set - { - 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 the database projects. - /// - public ICollection DatabaseProjects - { - get - { - return m_DatabaseProjects.Values; - } - } - /// - /// Gets the nested solutions. - /// - public ICollection Solutions - { - get - { - return m_Solutions.Values; - } - } - /// - /// Gets the nested solutions hash table. - /// - public Dictionary SolutionsTable - { - get - { - return m_Solutions; - } - } - /// - /// 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); - } - else if(dataNode is SolutionNode) - { - m_Solutions[((SolutionNode)dataNode).Name] = (SolutionNode) dataNode; - } - else if (dataNode is ProcessNode) - { - ProcessNode p = (ProcessNode)dataNode; - Kernel.Instance.ProcessFile(p, this); - } - else if (dataNode is DatabaseProjectNode) - { - m_DatabaseProjects[((DatabaseProjectNode)dataNode).Name] = (DatabaseProjectNode) dataNode; - } - else if(dataNode is CleanupNode) - { - if(m_Cleanup != null) - throw new WarningException("There can only be one Cleanup node."); - m_Cleanup = (CleanupNode)dataNode; - } - } - } - finally - { - Kernel.Instance.CurrentWorkingDirectory.Pop(); - } - } - - #endregion - } -} -- cgit v1.1