aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Prebuild/src/Core/Nodes
diff options
context:
space:
mode:
authorSean Dague2007-07-16 15:40:11 +0000
committerSean Dague2007-07-16 15:40:11 +0000
commit2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6 (patch)
treee3f80ad51736cf17e856547b1bcf956010927434 /Prebuild/src/Core/Nodes
parent*Trunk compiles now (diff)
downloadopensim-SC_OLD-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.zip
opensim-SC_OLD-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.tar.gz
opensim-SC_OLD-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.tar.bz2
opensim-SC_OLD-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.tar.xz
changed to native line ending encoding
Diffstat (limited to 'Prebuild/src/Core/Nodes')
-rw-r--r--Prebuild/src/Core/Nodes/ConfigurationNode.cs374
-rw-r--r--Prebuild/src/Core/Nodes/DataNode.cs164
-rw-r--r--Prebuild/src/Core/Nodes/ExcludeNode.cs170
-rw-r--r--Prebuild/src/Core/Nodes/FileNode.cs476
-rw-r--r--Prebuild/src/Core/Nodes/FilesNode.cs446
-rw-r--r--Prebuild/src/Core/Nodes/MatchNode.cs598
-rw-r--r--Prebuild/src/Core/Nodes/OptionsNode.cs1310
-rw-r--r--Prebuild/src/Core/Nodes/ProcessNode.cs238
-rw-r--r--Prebuild/src/Core/Nodes/ProjectNode.cs1020
-rw-r--r--Prebuild/src/Core/Nodes/ReferenceNode.cs306
-rw-r--r--Prebuild/src/Core/Nodes/ReferencePathNode.cs216
-rw-r--r--Prebuild/src/Core/Nodes/SolutionNode.cs576
12 files changed, 2947 insertions, 2947 deletions
diff --git a/Prebuild/src/Core/Nodes/ConfigurationNode.cs b/Prebuild/src/Core/Nodes/ConfigurationNode.cs
index 390794f..d2a5d20 100644
--- a/Prebuild/src/Core/Nodes/ConfigurationNode.cs
+++ b/Prebuild/src/Core/Nodes/ConfigurationNode.cs
@@ -1,187 +1,187 @@
1#region BSD License 1#region BSD License
2/* 2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com) 3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4 4
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/ 23*/
24#endregion 24#endregion
25 25
26#region CVS Information 26#region CVS Information
27/* 27/*
28 * $Source$ 28 * $Source$
29 * $Author: jendave $ 29 * $Author: jendave $
30 * $Date: 2006-01-28 01:49:58 +0100 (lö, 28 jan 2006) $ 30 * $Date: 2006-01-28 01:49:58 +0100 (lö, 28 jan 2006) $
31 * $Revision: 71 $ 31 * $Revision: 71 $
32 */ 32 */
33#endregion 33#endregion
34 34
35using System; 35using System;
36using System.Xml; 36using System.Xml;
37 37
38using Prebuild.Core.Attributes; 38using Prebuild.Core.Attributes;
39using Prebuild.Core.Interfaces; 39using Prebuild.Core.Interfaces;
40using Prebuild.Core.Utilities; 40using Prebuild.Core.Utilities;
41 41
42namespace Prebuild.Core.Nodes 42namespace Prebuild.Core.Nodes
43{ 43{
44 /// <summary> 44 /// <summary>
45 /// 45 ///
46 /// </summary> 46 /// </summary>
47 [DataNode("Configuration")] 47 [DataNode("Configuration")]
48 public class ConfigurationNode : DataNode, ICloneable, IComparable 48 public class ConfigurationNode : DataNode, ICloneable, IComparable
49 { 49 {
50 #region Fields 50 #region Fields
51 51
52 private string m_Name = "unknown"; 52 private string m_Name = "unknown";
53 private OptionsNode m_Options; 53 private OptionsNode m_Options;
54 54
55 #endregion 55 #endregion
56 56
57 #region Constructors 57 #region Constructors
58 58
59 /// <summary> 59 /// <summary>
60 /// Initializes a new instance of the <see cref="ConfigurationNode"/> class. 60 /// Initializes a new instance of the <see cref="ConfigurationNode"/> class.
61 /// </summary> 61 /// </summary>
62 public ConfigurationNode() 62 public ConfigurationNode()
63 { 63 {
64 m_Options = new OptionsNode(); 64 m_Options = new OptionsNode();
65 } 65 }
66 66
67 #endregion 67 #endregion
68 68
69 #region Properties 69 #region Properties
70 70
71 /// <summary> 71 /// <summary>
72 /// Gets or sets the parent. 72 /// Gets or sets the parent.
73 /// </summary> 73 /// </summary>
74 /// <value>The parent.</value> 74 /// <value>The parent.</value>
75 public override IDataNode Parent 75 public override IDataNode Parent
76 { 76 {
77 get 77 get
78 { 78 {
79 return base.Parent; 79 return base.Parent;
80 } 80 }
81 set 81 set
82 { 82 {
83 base.Parent = value; 83 base.Parent = value;
84 if(base.Parent is SolutionNode) 84 if(base.Parent is SolutionNode)
85 { 85 {
86 SolutionNode node = (SolutionNode)base.Parent; 86 SolutionNode node = (SolutionNode)base.Parent;
87 if(node != null && node.Options != null) 87 if(node != null && node.Options != null)
88 { 88 {
89 node.Options.CopyTo(m_Options); 89 node.Options.CopyTo(m_Options);
90 } 90 }
91 } 91 }
92 } 92 }
93 } 93 }
94 94
95 /// <summary> 95 /// <summary>
96 /// Gets the name. 96 /// Gets the name.
97 /// </summary> 97 /// </summary>
98 /// <value>The name.</value> 98 /// <value>The name.</value>
99 public string Name 99 public string Name
100 { 100 {
101 get 101 get
102 { 102 {
103 return m_Name; 103 return m_Name;
104 } 104 }
105 } 105 }
106 106
107 /// <summary> 107 /// <summary>
108 /// Gets or sets the options. 108 /// Gets or sets the options.
109 /// </summary> 109 /// </summary>
110 /// <value>The options.</value> 110 /// <value>The options.</value>
111 public OptionsNode Options 111 public OptionsNode Options
112 { 112 {
113 get 113 get
114 { 114 {
115 return m_Options; 115 return m_Options;
116 } 116 }
117 set 117 set
118 { 118 {
119 m_Options = value; 119 m_Options = value;
120 } 120 }
121 } 121 }
122 122
123 #endregion 123 #endregion
124 124
125 #region Public Methods 125 #region Public Methods
126 126
127 /// <summary> 127 /// <summary>
128 /// Parses the specified node. 128 /// Parses the specified node.
129 /// </summary> 129 /// </summary>
130 /// <param name="node">The node.</param> 130 /// <param name="node">The node.</param>
131 public override void Parse(XmlNode node) 131 public override void Parse(XmlNode node)
132 { 132 {
133 m_Name = Helper.AttributeValue(node, "name", m_Name); 133 m_Name = Helper.AttributeValue(node, "name", m_Name);
134 if( node == null ) 134 if( node == null )
135 { 135 {
136 throw new ArgumentNullException("node"); 136 throw new ArgumentNullException("node");
137 } 137 }
138 foreach(XmlNode child in node.ChildNodes) 138 foreach(XmlNode child in node.ChildNodes)
139 { 139 {
140 IDataNode dataNode = Kernel.Instance.ParseNode(child, this); 140 IDataNode dataNode = Kernel.Instance.ParseNode(child, this);
141 if(dataNode is OptionsNode) 141 if(dataNode is OptionsNode)
142 { 142 {
143 ((OptionsNode)dataNode).CopyTo(m_Options); 143 ((OptionsNode)dataNode).CopyTo(m_Options);
144 } 144 }
145 } 145 }
146 } 146 }
147 147
148 /// <summary> 148 /// <summary>
149 /// Copies to. 149 /// Copies to.
150 /// </summary> 150 /// </summary>
151 /// <param name="conf">The conf.</param> 151 /// <param name="conf">The conf.</param>
152 public void CopyTo(ConfigurationNode conf) 152 public void CopyTo(ConfigurationNode conf)
153 { 153 {
154 m_Options.CopyTo(conf.m_Options); 154 m_Options.CopyTo(conf.m_Options);
155 } 155 }
156 156
157 #endregion 157 #endregion
158 158
159 #region ICloneable Members 159 #region ICloneable Members
160 160
161 /// <summary> 161 /// <summary>
162 /// Creates a new object that is a copy of the current instance. 162 /// Creates a new object that is a copy of the current instance.
163 /// </summary> 163 /// </summary>
164 /// <returns> 164 /// <returns>
165 /// A new object that is a copy of this instance. 165 /// A new object that is a copy of this instance.
166 /// </returns> 166 /// </returns>
167 public object Clone() 167 public object Clone()
168 { 168 {
169 ConfigurationNode ret = new ConfigurationNode(); 169 ConfigurationNode ret = new ConfigurationNode();
170 ret.m_Name = m_Name; 170 ret.m_Name = m_Name;
171 m_Options.CopyTo(ret.m_Options); 171 m_Options.CopyTo(ret.m_Options);
172 return ret; 172 return ret;
173 } 173 }
174 174
175 #endregion 175 #endregion
176 176
177 #region IComparable Members 177 #region IComparable Members
178 178
179 public int CompareTo(object obj) 179 public int CompareTo(object obj)
180 { 180 {
181 ConfigurationNode that = (ConfigurationNode) obj; 181 ConfigurationNode that = (ConfigurationNode) obj;
182 return this.m_Name.CompareTo(that.m_Name); 182 return this.m_Name.CompareTo(that.m_Name);
183 } 183 }
184 184
185 #endregion 185 #endregion
186 } 186 }
187} 187}
diff --git a/Prebuild/src/Core/Nodes/DataNode.cs b/Prebuild/src/Core/Nodes/DataNode.cs
index ef5f7ee..aa05faa 100644
--- a/Prebuild/src/Core/Nodes/DataNode.cs
+++ b/Prebuild/src/Core/Nodes/DataNode.cs
@@ -1,82 +1,82 @@
1#region BSD License 1#region BSD License
2/* 2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com) 3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4 4
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/ 23*/
24#endregion 24#endregion
25 25
26#region CVS Information 26#region CVS Information
27/* 27/*
28 * $Source$ 28 * $Source$
29 * $Author: jendave $ 29 * $Author: jendave $
30 * $Date: 2006-01-28 01:49:58 +0100 (lö, 28 jan 2006) $ 30 * $Date: 2006-01-28 01:49:58 +0100 (lö, 28 jan 2006) $
31 * $Revision: 71 $ 31 * $Revision: 71 $
32 */ 32 */
33#endregion 33#endregion
34 34
35using System; 35using System;
36using System.Xml; 36using System.Xml;
37 37
38using Prebuild.Core.Attributes; 38using Prebuild.Core.Attributes;
39using Prebuild.Core.Interfaces; 39using Prebuild.Core.Interfaces;
40 40
41namespace Prebuild.Core.Nodes 41namespace Prebuild.Core.Nodes
42{ 42{
43 /// <summary> 43 /// <summary>
44 /// 44 ///
45 /// </summary> 45 /// </summary>
46 public class DataNode : IDataNode 46 public class DataNode : IDataNode
47 { 47 {
48 #region Fields 48 #region Fields
49 49
50 private IDataNode parent; 50 private IDataNode parent;
51 51
52 #endregion 52 #endregion
53 53
54 #region IDataNode Members 54 #region IDataNode Members
55 55
56 /// <summary> 56 /// <summary>
57 /// Gets or sets the parent. 57 /// Gets or sets the parent.
58 /// </summary> 58 /// </summary>
59 /// <value>The parent.</value> 59 /// <value>The parent.</value>
60 public virtual IDataNode Parent 60 public virtual IDataNode Parent
61 { 61 {
62 get 62 get
63 { 63 {
64 return parent; 64 return parent;
65 } 65 }
66 set 66 set
67 { 67 {
68 parent = value; 68 parent = value;
69 } 69 }
70 } 70 }
71 71
72 /// <summary> 72 /// <summary>
73 /// Parses the specified node. 73 /// Parses the specified node.
74 /// </summary> 74 /// </summary>
75 /// <param name="node">The node.</param> 75 /// <param name="node">The node.</param>
76 public virtual void Parse(XmlNode node) 76 public virtual void Parse(XmlNode node)
77 { 77 {
78 } 78 }
79 79
80 #endregion 80 #endregion
81 } 81 }
82} 82}
diff --git a/Prebuild/src/Core/Nodes/ExcludeNode.cs b/Prebuild/src/Core/Nodes/ExcludeNode.cs
index bfcebca..905626d 100644
--- a/Prebuild/src/Core/Nodes/ExcludeNode.cs
+++ b/Prebuild/src/Core/Nodes/ExcludeNode.cs
@@ -1,85 +1,85 @@
1#region BSD License 1#region BSD License
2/* 2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com) 3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4 4
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/ 23*/
24#endregion 24#endregion
25 25
26#region CVS Information 26#region CVS Information
27/* 27/*
28 * $Source$ 28 * $Source$
29 * $Author: jendave $ 29 * $Author: jendave $
30 * $Date: 2006-01-31 16:35:39 +0100 (ti, 31 jan 2006) $ 30 * $Date: 2006-01-31 16:35:39 +0100 (ti, 31 jan 2006) $
31 * $Revision: 74 $ 31 * $Revision: 74 $
32 */ 32 */
33#endregion 33#endregion
34 34
35using System; 35using System;
36using System.Xml; 36using System.Xml;
37 37
38using Prebuild.Core.Attributes; 38using Prebuild.Core.Attributes;
39using Prebuild.Core.Interfaces; 39using Prebuild.Core.Interfaces;
40using Prebuild.Core.Utilities; 40using Prebuild.Core.Utilities;
41 41
42namespace Prebuild.Core.Nodes 42namespace Prebuild.Core.Nodes
43{ 43{
44 /// <summary> 44 /// <summary>
45 /// 45 ///
46 /// </summary> 46 /// </summary>
47 [DataNode("Exclude")] 47 [DataNode("Exclude")]
48 public class ExcludeNode : DataNode 48 public class ExcludeNode : DataNode
49 { 49 {
50 #region Fields 50 #region Fields
51 51
52 private string m_Name = "unknown"; 52 private string m_Name = "unknown";
53 53
54 #endregion 54 #endregion
55 55
56 #region Properties 56 #region Properties
57 57
58 /// <summary> 58 /// <summary>
59 /// Gets the name. 59 /// Gets the name.
60 /// </summary> 60 /// </summary>
61 /// <value>The name.</value> 61 /// <value>The name.</value>
62 public string Name 62 public string Name
63 { 63 {
64 get 64 get
65 { 65 {
66 return m_Name; 66 return m_Name;
67 } 67 }
68 } 68 }
69 69
70 #endregion 70 #endregion
71 71
72 #region Public Methods 72 #region Public Methods
73 73
74 /// <summary> 74 /// <summary>
75 /// Parses the specified node. 75 /// Parses the specified node.
76 /// </summary> 76 /// </summary>
77 /// <param name="node">The node.</param> 77 /// <param name="node">The node.</param>
78 public override void Parse(XmlNode node) 78 public override void Parse(XmlNode node)
79 { 79 {
80 m_Name = Helper.AttributeValue(node, "name", m_Name); 80 m_Name = Helper.AttributeValue(node, "name", m_Name);
81 } 81 }
82 82
83 #endregion 83 #endregion
84 } 84 }
85} 85}
diff --git a/Prebuild/src/Core/Nodes/FileNode.cs b/Prebuild/src/Core/Nodes/FileNode.cs
index de3b69e..ab0a2a3 100644
--- a/Prebuild/src/Core/Nodes/FileNode.cs
+++ b/Prebuild/src/Core/Nodes/FileNode.cs
@@ -1,238 +1,238 @@
1#region BSD License 1#region BSD License
2/* 2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com) 3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4 4
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/ 23*/
24#endregion 24#endregion
25 25
26#region CVS Information 26#region CVS Information
27/* 27/*
28 * $Source$ 28 * $Source$
29 * $Author: jendave $ 29 * $Author: jendave $
30 * $Date: 2007-01-08 17:55:40 +0100 (må, 08 jan 2007) $ 30 * $Date: 2007-01-08 17:55:40 +0100 (må, 08 jan 2007) $
31 * $Revision: 197 $ 31 * $Revision: 197 $
32 */ 32 */
33#endregion 33#endregion
34 34
35using System; 35using System;
36using System.IO; 36using System.IO;
37using System.Xml; 37using System.Xml;
38 38
39using Prebuild.Core.Attributes; 39using Prebuild.Core.Attributes;
40using Prebuild.Core.Interfaces; 40using Prebuild.Core.Interfaces;
41using Prebuild.Core.Utilities; 41using Prebuild.Core.Utilities;
42 42
43namespace Prebuild.Core.Nodes 43namespace Prebuild.Core.Nodes
44{ 44{
45 /// <summary> 45 /// <summary>
46 /// 46 ///
47 /// </summary> 47 /// </summary>
48 public enum BuildAction 48 public enum BuildAction
49 { 49 {
50 /// <summary> 50 /// <summary>
51 /// 51 ///
52 /// </summary> 52 /// </summary>
53 None, 53 None,
54 /// <summary> 54 /// <summary>
55 /// 55 ///
56 /// </summary> 56 /// </summary>
57 Compile, 57 Compile,
58 /// <summary> 58 /// <summary>
59 /// 59 ///
60 /// </summary> 60 /// </summary>
61 Content, 61 Content,
62 /// <summary> 62 /// <summary>
63 /// 63 ///
64 /// </summary> 64 /// </summary>
65 EmbeddedResource 65 EmbeddedResource
66 } 66 }
67 67
68 /// <summary> 68 /// <summary>
69 /// 69 ///
70 /// </summary> 70 /// </summary>
71 public enum SubType 71 public enum SubType
72 { 72 {
73 /// <summary> 73 /// <summary>
74 /// 74 ///
75 /// </summary> 75 /// </summary>
76 Code, 76 Code,
77 /// <summary> 77 /// <summary>
78 /// 78 ///
79 /// </summary> 79 /// </summary>
80 Component, 80 Component,
81 /// <summary> 81 /// <summary>
82 /// 82 ///
83 /// </summary> 83 /// </summary>
84 Designer, 84 Designer,
85 /// <summary> 85 /// <summary>
86 /// 86 ///
87 /// </summary> 87 /// </summary>
88 Form, 88 Form,
89 /// <summary> 89 /// <summary>
90 /// 90 ///
91 /// </summary> 91 /// </summary>
92 Settings, 92 Settings,
93 /// <summary> 93 /// <summary>
94 /// 94 ///
95 /// </summary> 95 /// </summary>
96 UserControl 96 UserControl
97 } 97 }
98 98
99 public enum CopyToOutput 99 public enum CopyToOutput
100 { 100 {
101 Never, 101 Never,
102 Always, 102 Always,
103 PreserveNewest 103 PreserveNewest
104 } 104 }
105 105
106 /// <summary> 106 /// <summary>
107 /// 107 ///
108 /// </summary> 108 /// </summary>
109 [DataNode("File")] 109 [DataNode("File")]
110 public class FileNode : DataNode 110 public class FileNode : DataNode
111 { 111 {
112 #region Fields 112 #region Fields
113 113
114 private string m_Path; 114 private string m_Path;
115 private string m_ResourceName = ""; 115 private string m_ResourceName = "";
116 private BuildAction m_BuildAction = BuildAction.Compile; 116 private BuildAction m_BuildAction = BuildAction.Compile;
117 private bool m_Valid; 117 private bool m_Valid;
118 private SubType m_SubType = SubType.Code; 118 private SubType m_SubType = SubType.Code;
119 private CopyToOutput m_CopyToOutput = CopyToOutput.Never; 119 private CopyToOutput m_CopyToOutput = CopyToOutput.Never;
120 private bool m_Link = false; 120 private bool m_Link = false;
121 121
122 122
123 #endregion 123 #endregion
124 124
125 #region Properties 125 #region Properties
126 126
127 /// <summary> 127 /// <summary>
128 /// 128 ///
129 /// </summary> 129 /// </summary>
130 public string Path 130 public string Path
131 { 131 {
132 get 132 get
133 { 133 {
134 return m_Path; 134 return m_Path;
135 } 135 }
136 } 136 }
137 137
138 /// <summary> 138 /// <summary>
139 /// 139 ///
140 /// </summary> 140 /// </summary>
141 public string ResourceName 141 public string ResourceName
142 { 142 {
143 get 143 get
144 { 144 {
145 return m_ResourceName; 145 return m_ResourceName;
146 } 146 }
147 } 147 }
148 148
149 /// <summary> 149 /// <summary>
150 /// 150 ///
151 /// </summary> 151 /// </summary>
152 public BuildAction BuildAction 152 public BuildAction BuildAction
153 { 153 {
154 get 154 get
155 { 155 {
156 return m_BuildAction; 156 return m_BuildAction;
157 } 157 }
158 } 158 }
159 159
160 public CopyToOutput CopyToOutput 160 public CopyToOutput CopyToOutput
161 { 161 {
162 get 162 get
163 { 163 {
164 return this.m_CopyToOutput; 164 return this.m_CopyToOutput;
165 } 165 }
166 } 166 }
167 167
168 public bool IsLink 168 public bool IsLink
169 { 169 {
170 get 170 get
171 { 171 {
172 return this.m_Link; 172 return this.m_Link;
173 } 173 }
174 } 174 }
175 175
176 /// <summary> 176 /// <summary>
177 /// 177 ///
178 /// </summary> 178 /// </summary>
179 public SubType SubType 179 public SubType SubType
180 { 180 {
181 get 181 get
182 { 182 {
183 return m_SubType; 183 return m_SubType;
184 } 184 }
185 } 185 }
186 186
187 /// <summary> 187 /// <summary>
188 /// 188 ///
189 /// </summary> 189 /// </summary>
190 public bool IsValid 190 public bool IsValid
191 { 191 {
192 get 192 get
193 { 193 {
194 return m_Valid; 194 return m_Valid;
195 } 195 }
196 } 196 }
197 197
198 #endregion 198 #endregion
199 199
200 #region Public Methods 200 #region Public Methods
201 201
202 /// <summary> 202 /// <summary>
203 /// 203 ///
204 /// </summary> 204 /// </summary>
205 /// <param name="node"></param> 205 /// <param name="node"></param>
206 public override void Parse(XmlNode node) 206 public override void Parse(XmlNode node)
207 { 207 {
208 m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction), 208 m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction),
209 Helper.AttributeValue(node, "buildAction", m_BuildAction.ToString())); 209 Helper.AttributeValue(node, "buildAction", m_BuildAction.ToString()));
210 m_SubType = (SubType)Enum.Parse(typeof(SubType), 210 m_SubType = (SubType)Enum.Parse(typeof(SubType),
211 Helper.AttributeValue(node, "subType", m_SubType.ToString())); 211 Helper.AttributeValue(node, "subType", m_SubType.ToString()));
212 m_ResourceName = Helper.AttributeValue(node, "resourceName", m_ResourceName.ToString()); 212 m_ResourceName = Helper.AttributeValue(node, "resourceName", m_ResourceName.ToString());
213 this.m_Link = bool.Parse(Helper.AttributeValue(node, "link", bool.FalseString)); 213 this.m_Link = bool.Parse(Helper.AttributeValue(node, "link", bool.FalseString));
214 this.m_CopyToOutput = (CopyToOutput) Enum.Parse(typeof(CopyToOutput), Helper.AttributeValue(node, "copyToOutput", this.m_CopyToOutput.ToString())); 214 this.m_CopyToOutput = (CopyToOutput) Enum.Parse(typeof(CopyToOutput), Helper.AttributeValue(node, "copyToOutput", this.m_CopyToOutput.ToString()));
215 215
216 if( node == null ) 216 if( node == null )
217 { 217 {
218 throw new ArgumentNullException("node"); 218 throw new ArgumentNullException("node");
219 } 219 }
220 220
221 m_Path = Helper.InterpolateForEnvironmentVariables(node.InnerText); 221 m_Path = Helper.InterpolateForEnvironmentVariables(node.InnerText);
222 if(m_Path == null) 222 if(m_Path == null)
223 { 223 {
224 m_Path = ""; 224 m_Path = "";
225 } 225 }
226 226
227 m_Path = m_Path.Trim(); 227 m_Path = m_Path.Trim();
228 m_Valid = true; 228 m_Valid = true;
229 if(!File.Exists(m_Path)) 229 if(!File.Exists(m_Path))
230 { 230 {
231 m_Valid = false; 231 m_Valid = false;
232 Kernel.Instance.Log.Write(LogType.Warning, "File does not exist: {0}", m_Path); 232 Kernel.Instance.Log.Write(LogType.Warning, "File does not exist: {0}", m_Path);
233 } 233 }
234 } 234 }
235 235
236 #endregion 236 #endregion
237 } 237 }
238} 238}
diff --git a/Prebuild/src/Core/Nodes/FilesNode.cs b/Prebuild/src/Core/Nodes/FilesNode.cs
index d31307b..05b2255 100644
--- a/Prebuild/src/Core/Nodes/FilesNode.cs
+++ b/Prebuild/src/Core/Nodes/FilesNode.cs
@@ -1,223 +1,223 @@
1#region BSD License 1#region BSD License
2/* 2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com) 3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4 4
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/ 23*/
24#endregion 24#endregion
25 25
26#region CVS Information 26#region CVS Information
27/* 27/*
28 * $Source$ 28 * $Source$
29 * $Author: jendave $ 29 * $Author: jendave $
30 * $Date: 2006-09-20 09:42:51 +0200 (on, 20 sep 2006) $ 30 * $Date: 2006-09-20 09:42:51 +0200 (on, 20 sep 2006) $
31 * $Revision: 164 $ 31 * $Revision: 164 $
32 */ 32 */
33#endregion 33#endregion
34 34
35using System; 35using System;
36using System.Collections; 36using System.Collections;
37using System.Collections.Specialized; 37using System.Collections.Specialized;
38using System.Xml; 38using System.Xml;
39 39
40using Prebuild.Core.Attributes; 40using Prebuild.Core.Attributes;
41using Prebuild.Core.Interfaces; 41using Prebuild.Core.Interfaces;
42 42
43namespace Prebuild.Core.Nodes 43namespace Prebuild.Core.Nodes
44{ 44{
45 /// <summary> 45 /// <summary>
46 /// 46 ///
47 /// </summary> 47 /// </summary>
48 [DataNode("Files")] 48 [DataNode("Files")]
49 public class FilesNode : DataNode 49 public class FilesNode : DataNode
50 { 50 {
51 #region Fields 51 #region Fields
52 52
53 private StringCollection m_Files; 53 private StringCollection m_Files;
54 private Hashtable m_BuildActions; 54 private Hashtable m_BuildActions;
55 private Hashtable m_SubTypes; 55 private Hashtable m_SubTypes;
56 private Hashtable m_ResourceNames; 56 private Hashtable m_ResourceNames;
57 private Hashtable m_CopyToOutputs; 57 private Hashtable m_CopyToOutputs;
58 private Hashtable m_Links; 58 private Hashtable m_Links;
59 59
60 60
61 #endregion 61 #endregion
62 62
63 #region Constructors 63 #region Constructors
64 64
65 /// <summary> 65 /// <summary>
66 /// 66 ///
67 /// </summary> 67 /// </summary>
68 public FilesNode() 68 public FilesNode()
69 { 69 {
70 m_Files = new StringCollection(); 70 m_Files = new StringCollection();
71 m_BuildActions = new Hashtable(); 71 m_BuildActions = new Hashtable();
72 m_SubTypes = new Hashtable(); 72 m_SubTypes = new Hashtable();
73 m_ResourceNames = new Hashtable(); 73 m_ResourceNames = new Hashtable();
74 m_CopyToOutputs = new Hashtable(); 74 m_CopyToOutputs = new Hashtable();
75 m_Links = new Hashtable(); 75 m_Links = new Hashtable();
76 } 76 }
77 77
78 #endregion 78 #endregion
79 79
80 #region Properties 80 #region Properties
81 81
82 /// <summary> 82 /// <summary>
83 /// 83 ///
84 /// </summary> 84 /// </summary>
85 public int Count 85 public int Count
86 { 86 {
87 get 87 get
88 { 88 {
89 return m_Files.Count; 89 return m_Files.Count;
90 } 90 }
91 } 91 }
92 92
93 #endregion 93 #endregion
94 94
95 #region Public Methods 95 #region Public Methods
96 96
97 /// <summary> 97 /// <summary>
98 /// 98 ///
99 /// </summary> 99 /// </summary>
100 /// <param name="file"></param> 100 /// <param name="file"></param>
101 /// <returns></returns> 101 /// <returns></returns>
102 public BuildAction GetBuildAction(string file) 102 public BuildAction GetBuildAction(string file)
103 { 103 {
104 if(!m_BuildActions.ContainsKey(file)) 104 if(!m_BuildActions.ContainsKey(file))
105 { 105 {
106 return BuildAction.Compile; 106 return BuildAction.Compile;
107 } 107 }
108 108
109 return (BuildAction)m_BuildActions[file]; 109 return (BuildAction)m_BuildActions[file];
110 } 110 }
111 111
112 public CopyToOutput GetCopyToOutput(string file) 112 public CopyToOutput GetCopyToOutput(string file)
113 { 113 {
114 if (!this.m_CopyToOutputs.ContainsKey(file)) 114 if (!this.m_CopyToOutputs.ContainsKey(file))
115 { 115 {
116 return CopyToOutput.Never; 116 return CopyToOutput.Never;
117 } 117 }
118 return (CopyToOutput) this.m_CopyToOutputs[file]; 118 return (CopyToOutput) this.m_CopyToOutputs[file];
119 } 119 }
120 120
121 public bool GetIsLink(string file) 121 public bool GetIsLink(string file)
122 { 122 {
123 if (!this.m_Links.ContainsKey(file)) 123 if (!this.m_Links.ContainsKey(file))
124 { 124 {
125 return false; 125 return false;
126 } 126 }
127 return (bool) this.m_Links[file]; 127 return (bool) this.m_Links[file];
128 } 128 }
129 129
130 /// <summary> 130 /// <summary>
131 /// 131 ///
132 /// </summary> 132 /// </summary>
133 /// <param name="file"></param> 133 /// <param name="file"></param>
134 /// <returns></returns> 134 /// <returns></returns>
135 public SubType GetSubType(string file) 135 public SubType GetSubType(string file)
136 { 136 {
137 if(!m_SubTypes.ContainsKey(file)) 137 if(!m_SubTypes.ContainsKey(file))
138 { 138 {
139 return SubType.Code; 139 return SubType.Code;
140 } 140 }
141 141
142 return (SubType)m_SubTypes[file]; 142 return (SubType)m_SubTypes[file];
143 } 143 }
144 144
145 /// <summary> 145 /// <summary>
146 /// 146 ///
147 /// </summary> 147 /// </summary>
148 /// <param name="file"></param> 148 /// <param name="file"></param>
149 /// <returns></returns> 149 /// <returns></returns>
150 public string GetResourceName(string file) 150 public string GetResourceName(string file)
151 { 151 {
152 if(!m_ResourceNames.ContainsKey(file)) 152 if(!m_ResourceNames.ContainsKey(file))
153 { 153 {
154 return ""; 154 return "";
155 } 155 }
156 156
157 return (string)m_ResourceNames[file]; 157 return (string)m_ResourceNames[file];
158 } 158 }
159 159
160 /// <summary> 160 /// <summary>
161 /// 161 ///
162 /// </summary> 162 /// </summary>
163 /// <param name="node"></param> 163 /// <param name="node"></param>
164 public override void Parse(XmlNode node) 164 public override void Parse(XmlNode node)
165 { 165 {
166 if( node == null ) 166 if( node == null )
167 { 167 {
168 throw new ArgumentNullException("node"); 168 throw new ArgumentNullException("node");
169 } 169 }
170 foreach(XmlNode child in node.ChildNodes) 170 foreach(XmlNode child in node.ChildNodes)
171 { 171 {
172 IDataNode dataNode = Kernel.Instance.ParseNode(child, this); 172 IDataNode dataNode = Kernel.Instance.ParseNode(child, this);
173 if(dataNode is FileNode) 173 if(dataNode is FileNode)
174 { 174 {
175 FileNode fileNode = (FileNode)dataNode; 175 FileNode fileNode = (FileNode)dataNode;
176 if(fileNode.IsValid) 176 if(fileNode.IsValid)
177 { 177 {
178 if (!m_Files.Contains(fileNode.Path)) 178 if (!m_Files.Contains(fileNode.Path))
179 { 179 {
180 m_Files.Add(fileNode.Path); 180 m_Files.Add(fileNode.Path);
181 m_BuildActions[fileNode.Path] = fileNode.BuildAction; 181 m_BuildActions[fileNode.Path] = fileNode.BuildAction;
182 m_SubTypes[fileNode.Path] = fileNode.SubType; 182 m_SubTypes[fileNode.Path] = fileNode.SubType;
183 m_ResourceNames[fileNode.Path] = fileNode.ResourceName; 183 m_ResourceNames[fileNode.Path] = fileNode.ResourceName;
184 this.m_Links[fileNode.Path] = fileNode.IsLink; 184 this.m_Links[fileNode.Path] = fileNode.IsLink;
185 this.m_CopyToOutputs[fileNode.Path] = fileNode.CopyToOutput; 185 this.m_CopyToOutputs[fileNode.Path] = fileNode.CopyToOutput;
186 186
187 } 187 }
188 } 188 }
189 } 189 }
190 else if(dataNode is MatchNode) 190 else if(dataNode is MatchNode)
191 { 191 {
192 foreach(string file in ((MatchNode)dataNode).Files) 192 foreach(string file in ((MatchNode)dataNode).Files)
193 { 193 {
194 if (!m_Files.Contains(file)) 194 if (!m_Files.Contains(file))
195 { 195 {
196 m_Files.Add(file); 196 m_Files.Add(file);
197 m_BuildActions[file] = ((MatchNode)dataNode).BuildAction; 197 m_BuildActions[file] = ((MatchNode)dataNode).BuildAction;
198 m_SubTypes[file] = ((MatchNode)dataNode).SubType; 198 m_SubTypes[file] = ((MatchNode)dataNode).SubType;
199 m_ResourceNames[file] = ((MatchNode)dataNode).ResourceName; 199 m_ResourceNames[file] = ((MatchNode)dataNode).ResourceName;
200 this.m_Links[file] = ((MatchNode) dataNode).IsLink; 200 this.m_Links[file] = ((MatchNode) dataNode).IsLink;
201 this.m_CopyToOutputs[file] = ((MatchNode) dataNode).CopyToOutput; 201 this.m_CopyToOutputs[file] = ((MatchNode) dataNode).CopyToOutput;
202 202
203 } 203 }
204 } 204 }
205 } 205 }
206 } 206 }
207 } 207 }
208 208
209 // TODO: Check in to why StringCollection's enumerator doesn't implement 209 // TODO: Check in to why StringCollection's enumerator doesn't implement
210 // IEnumerator? 210 // IEnumerator?
211 /// <summary> 211 /// <summary>
212 /// 212 ///
213 /// </summary> 213 /// </summary>
214 /// <returns></returns> 214 /// <returns></returns>
215 public StringEnumerator GetEnumerator() 215 public StringEnumerator GetEnumerator()
216 { 216 {
217 return m_Files.GetEnumerator(); 217 return m_Files.GetEnumerator();
218 } 218 }
219 219
220 #endregion 220 #endregion
221 221
222 } 222 }
223} 223}
diff --git a/Prebuild/src/Core/Nodes/MatchNode.cs b/Prebuild/src/Core/Nodes/MatchNode.cs
index e0d2fa8..8d7b467 100644
--- a/Prebuild/src/Core/Nodes/MatchNode.cs
+++ b/Prebuild/src/Core/Nodes/MatchNode.cs
@@ -1,299 +1,299 @@
1#region BSD License 1#region BSD License
2/* 2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com) 3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4 4
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/ 23*/
24#endregion 24#endregion
25 25
26#region CVS Information 26#region CVS Information
27/* 27/*
28 * $Source$ 28 * $Source$
29 * $Author: jendave $ 29 * $Author: jendave $
30 * $Date: 2006-09-20 09:42:51 +0200 (on, 20 sep 2006) $ 30 * $Date: 2006-09-20 09:42:51 +0200 (on, 20 sep 2006) $
31 * $Revision: 164 $ 31 * $Revision: 164 $
32 */ 32 */
33#endregion 33#endregion
34 34
35using System; 35using System;
36using System.Collections.Specialized; 36using System.Collections.Specialized;
37using System.IO; 37using System.IO;
38using System.Text.RegularExpressions; 38using System.Text.RegularExpressions;
39using System.Xml; 39using System.Xml;
40 40
41using Prebuild.Core.Attributes; 41using Prebuild.Core.Attributes;
42using Prebuild.Core.Interfaces; 42using Prebuild.Core.Interfaces;
43using Prebuild.Core.Utilities; 43using Prebuild.Core.Utilities;
44 44
45namespace Prebuild.Core.Nodes 45namespace Prebuild.Core.Nodes
46{ 46{
47 /// <summary> 47 /// <summary>
48 /// 48 ///
49 /// </summary> 49 /// </summary>
50 [DataNode("Match")] 50 [DataNode("Match")]
51 public class MatchNode : DataNode 51 public class MatchNode : DataNode
52 { 52 {
53 #region Fields 53 #region Fields
54 54
55 private StringCollection m_Files; 55 private StringCollection m_Files;
56 private Regex m_Regex; 56 private Regex m_Regex;
57 private BuildAction m_BuildAction = BuildAction.Compile; 57 private BuildAction m_BuildAction = BuildAction.Compile;
58 private SubType m_SubType = SubType.Code; 58 private SubType m_SubType = SubType.Code;
59 string m_ResourceName = ""; 59 string m_ResourceName = "";
60 private CopyToOutput m_CopyToOutput; 60 private CopyToOutput m_CopyToOutput;
61 private bool m_Link; 61 private bool m_Link;
62 62
63 63
64 #endregion 64 #endregion
65 65
66 #region Constructors 66 #region Constructors
67 67
68 /// <summary> 68 /// <summary>
69 /// 69 ///
70 /// </summary> 70 /// </summary>
71 public MatchNode() 71 public MatchNode()
72 { 72 {
73 m_Files = new StringCollection(); 73 m_Files = new StringCollection();
74 } 74 }
75 75
76 #endregion 76 #endregion
77 77
78 #region Properties 78 #region Properties
79 79
80 /// <summary> 80 /// <summary>
81 /// 81 ///
82 /// </summary> 82 /// </summary>
83 public StringCollection Files 83 public StringCollection Files
84 { 84 {
85 get 85 get
86 { 86 {
87 return m_Files; 87 return m_Files;
88 } 88 }
89 } 89 }
90 90
91 /// <summary> 91 /// <summary>
92 /// 92 ///
93 /// </summary> 93 /// </summary>
94 public BuildAction BuildAction 94 public BuildAction BuildAction
95 { 95 {
96 get 96 get
97 { 97 {
98 return m_BuildAction; 98 return m_BuildAction;
99 } 99 }
100 } 100 }
101 101
102 /// <summary> 102 /// <summary>
103 /// 103 ///
104 /// </summary> 104 /// </summary>
105 public SubType SubType 105 public SubType SubType
106 { 106 {
107 get 107 get
108 { 108 {
109 return m_SubType; 109 return m_SubType;
110 } 110 }
111 } 111 }
112 112
113 public CopyToOutput CopyToOutput 113 public CopyToOutput CopyToOutput
114 { 114 {
115 get 115 get
116 { 116 {
117 return this.m_CopyToOutput; 117 return this.m_CopyToOutput;
118 } 118 }
119 } 119 }
120 120
121 public bool IsLink 121 public bool IsLink
122 { 122 {
123 get 123 get
124 { 124 {
125 return this.m_Link; 125 return this.m_Link;
126 } 126 }
127 } 127 }
128 128
129 /// <summary> 129 /// <summary>
130 /// 130 ///
131 /// </summary> 131 /// </summary>
132 public string ResourceName 132 public string ResourceName
133 { 133 {
134 get 134 get
135 { 135 {
136 return m_ResourceName; 136 return m_ResourceName;
137 } 137 }
138 } 138 }
139 139
140 140
141 #endregion 141 #endregion
142 142
143 #region Private Methods 143 #region Private Methods
144 144
145 /// <summary> 145 /// <summary>
146 /// Recurses the directories. 146 /// Recurses the directories.
147 /// </summary> 147 /// </summary>
148 /// <param name="path">The path.</param> 148 /// <param name="path">The path.</param>
149 /// <param name="pattern">The pattern.</param> 149 /// <param name="pattern">The pattern.</param>
150 /// <param name="recurse">if set to <c>true</c> [recurse].</param> 150 /// <param name="recurse">if set to <c>true</c> [recurse].</param>
151 /// <param name="useRegex">if set to <c>true</c> [use regex].</param> 151 /// <param name="useRegex">if set to <c>true</c> [use regex].</param>
152 private void RecurseDirectories(string path, string pattern, bool recurse, bool useRegex) 152 private void RecurseDirectories(string path, string pattern, bool recurse, bool useRegex)
153 { 153 {
154 try 154 try
155 { 155 {
156 string[] files; 156 string[] files;
157 157
158 if(!useRegex) 158 if(!useRegex)
159 { 159 {
160 files = Directory.GetFiles(path, pattern); 160 files = Directory.GetFiles(path, pattern);
161 if(files != null) 161 if(files != null)
162 { 162 {
163 string fileTemp; 163 string fileTemp;
164 foreach (string file in files) 164 foreach (string file in files)
165 { 165 {
166 if (file.Substring(0,2) == "./" || file.Substring(0,2) == ".\\") 166 if (file.Substring(0,2) == "./" || file.Substring(0,2) == ".\\")
167 { 167 {
168 fileTemp = file.Substring(2); 168 fileTemp = file.Substring(2);
169 } 169 }
170 else 170 else
171 { 171 {
172 fileTemp = file; 172 fileTemp = file;
173 } 173 }
174 174
175 m_Files.Add(fileTemp); 175 m_Files.Add(fileTemp);
176 } 176 }
177 } 177 }
178 else 178 else
179 { 179 {
180 return; 180 return;
181 } 181 }
182 } 182 }
183 else 183 else
184 { 184 {
185 Match match; 185 Match match;
186 files = Directory.GetFiles(path); 186 files = Directory.GetFiles(path);
187 foreach(string file in files) 187 foreach(string file in files)
188 { 188 {
189 match = m_Regex.Match(file); 189 match = m_Regex.Match(file);
190 if(match.Success) 190 if(match.Success)
191 { 191 {
192 m_Files.Add(file); 192 m_Files.Add(file);
193 } 193 }
194 } 194 }
195 } 195 }
196 196
197 if(recurse) 197 if(recurse)
198 { 198 {
199 string[] dirs = Directory.GetDirectories(path); 199 string[] dirs = Directory.GetDirectories(path);
200 if(dirs != null && dirs.Length > 0) 200 if(dirs != null && dirs.Length > 0)
201 { 201 {
202 foreach(string str in dirs) 202 foreach(string str in dirs)
203 { 203 {
204 RecurseDirectories(Helper.NormalizePath(str), pattern, recurse, useRegex); 204 RecurseDirectories(Helper.NormalizePath(str), pattern, recurse, useRegex);
205 } 205 }
206 } 206 }
207 } 207 }
208 } 208 }
209 catch(DirectoryNotFoundException) 209 catch(DirectoryNotFoundException)
210 { 210 {
211 return; 211 return;
212 } 212 }
213 catch(ArgumentException) 213 catch(ArgumentException)
214 { 214 {
215 return; 215 return;
216 } 216 }
217 } 217 }
218 218
219 #endregion 219 #endregion
220 220
221 #region Public Methods 221 #region Public Methods
222 222
223 /// <summary> 223 /// <summary>
224 /// 224 ///
225 /// </summary> 225 /// </summary>
226 /// <param name="node"></param> 226 /// <param name="node"></param>
227 public override void Parse(XmlNode node) 227 public override void Parse(XmlNode node)
228 { 228 {
229 if( node == null ) 229 if( node == null )
230 { 230 {
231 throw new ArgumentNullException("node"); 231 throw new ArgumentNullException("node");
232 } 232 }
233 string path = Helper.AttributeValue(node, "path", "."); 233 string path = Helper.AttributeValue(node, "path", ".");
234 string pattern = Helper.AttributeValue(node, "pattern", "*"); 234 string pattern = Helper.AttributeValue(node, "pattern", "*");
235 bool recurse = (bool)Helper.TranslateValue(typeof(bool), Helper.AttributeValue(node, "recurse", "false")); 235 bool recurse = (bool)Helper.TranslateValue(typeof(bool), Helper.AttributeValue(node, "recurse", "false"));
236 bool useRegex = (bool)Helper.TranslateValue(typeof(bool), Helper.AttributeValue(node, "useRegex", "false")); 236 bool useRegex = (bool)Helper.TranslateValue(typeof(bool), Helper.AttributeValue(node, "useRegex", "false"));
237 m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction), 237 m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction),
238 Helper.AttributeValue(node, "buildAction", m_BuildAction.ToString())); 238 Helper.AttributeValue(node, "buildAction", m_BuildAction.ToString()));
239 m_SubType = (SubType)Enum.Parse(typeof(SubType), 239 m_SubType = (SubType)Enum.Parse(typeof(SubType),
240 Helper.AttributeValue(node, "subType", m_SubType.ToString())); 240 Helper.AttributeValue(node, "subType", m_SubType.ToString()));
241 m_ResourceName = Helper.AttributeValue(node, "resourceName", m_ResourceName.ToString()); 241 m_ResourceName = Helper.AttributeValue(node, "resourceName", m_ResourceName.ToString());
242 this.m_CopyToOutput = (CopyToOutput) Enum.Parse(typeof(CopyToOutput), Helper.AttributeValue(node, "copyToOutput", this.m_CopyToOutput.ToString())); 242 this.m_CopyToOutput = (CopyToOutput) Enum.Parse(typeof(CopyToOutput), Helper.AttributeValue(node, "copyToOutput", this.m_CopyToOutput.ToString()));
243 this.m_Link = bool.Parse(Helper.AttributeValue(node, "link", bool.FalseString)); 243 this.m_Link = bool.Parse(Helper.AttributeValue(node, "link", bool.FalseString));
244 244
245 245
246 if(path != null && path.Length == 0) 246 if(path != null && path.Length == 0)
247 { 247 {
248 path = ".";//use current directory 248 path = ".";//use current directory
249 } 249 }
250 //throw new WarningException("Match must have a 'path' attribute"); 250 //throw new WarningException("Match must have a 'path' attribute");
251 251
252 if(pattern == null) 252 if(pattern == null)
253 { 253 {
254 throw new WarningException("Match must have a 'pattern' attribute"); 254 throw new WarningException("Match must have a 'pattern' attribute");
255 } 255 }
256 256
257 path = Helper.NormalizePath(path); 257 path = Helper.NormalizePath(path);
258 if(!Directory.Exists(path)) 258 if(!Directory.Exists(path))
259 { 259 {
260 throw new WarningException("Match path does not exist: {0}", path); 260 throw new WarningException("Match path does not exist: {0}", path);
261 } 261 }
262 262
263 try 263 try
264 { 264 {
265 if(useRegex) 265 if(useRegex)
266 { 266 {
267 m_Regex = new Regex(pattern); 267 m_Regex = new Regex(pattern);
268 } 268 }
269 } 269 }
270 catch(ArgumentException ex) 270 catch(ArgumentException ex)
271 { 271 {
272 throw new WarningException("Could not compile regex pattern: {0}", ex.Message); 272 throw new WarningException("Could not compile regex pattern: {0}", ex.Message);
273 } 273 }
274 274
275 RecurseDirectories(path, pattern, recurse, useRegex); 275 RecurseDirectories(path, pattern, recurse, useRegex);
276 276
277 foreach(XmlNode child in node.ChildNodes) 277 foreach(XmlNode child in node.ChildNodes)
278 { 278 {
279 IDataNode dataNode = Kernel.Instance.ParseNode(child, this); 279 IDataNode dataNode = Kernel.Instance.ParseNode(child, this);
280 if(dataNode is ExcludeNode) 280 if(dataNode is ExcludeNode)
281 { 281 {
282 ExcludeNode excludeNode = (ExcludeNode)dataNode; 282 ExcludeNode excludeNode = (ExcludeNode)dataNode;
283 if (m_Files.Contains(Helper.NormalizePath(excludeNode.Name))) 283 if (m_Files.Contains(Helper.NormalizePath(excludeNode.Name)))
284 { 284 {
285 m_Files.Remove(Helper.NormalizePath(excludeNode.Name)); 285 m_Files.Remove(Helper.NormalizePath(excludeNode.Name));
286 } 286 }
287 } 287 }
288 } 288 }
289 289
290 if(m_Files.Count < 1) 290 if(m_Files.Count < 1)
291 { 291 {
292 throw new WarningException("Match returned no files: {0}{1}", Helper.EndPath(path), pattern); 292 throw new WarningException("Match returned no files: {0}{1}", Helper.EndPath(path), pattern);
293 } 293 }
294 m_Regex = null; 294 m_Regex = null;
295 } 295 }
296 296
297 #endregion 297 #endregion
298 } 298 }
299} 299}
diff --git a/Prebuild/src/Core/Nodes/OptionsNode.cs b/Prebuild/src/Core/Nodes/OptionsNode.cs
index b5a2f60..b7a784d 100644
--- a/Prebuild/src/Core/Nodes/OptionsNode.cs
+++ b/Prebuild/src/Core/Nodes/OptionsNode.cs
@@ -1,655 +1,655 @@
1#region BSD License 1#region BSD License
2/* 2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com) 3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4 4
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/ 23*/
24#endregion 24#endregion
25 25
26#region CVS Information 26#region CVS Information
27/* 27/*
28 * $Source$ 28 * $Source$
29 * $Author: jendave $ 29 * $Author: jendave $
30 * $Date: 2007-01-08 17:55:40 +0100 (må, 08 jan 2007) $ 30 * $Date: 2007-01-08 17:55:40 +0100 (må, 08 jan 2007) $
31 * $Revision: 197 $ 31 * $Revision: 197 $
32 */ 32 */
33#endregion 33#endregion
34 34
35 35
36 36
37using System; 37using System;
38using System.Collections; 38using System.Collections;
39using System.Collections.Specialized; 39using System.Collections.Specialized;
40using System.Reflection; 40using System.Reflection;
41using System.Xml; 41using System.Xml;
42 42
43using Prebuild.Core.Attributes; 43using Prebuild.Core.Attributes;
44using Prebuild.Core.Interfaces; 44using Prebuild.Core.Interfaces;
45using Prebuild.Core.Utilities; 45using Prebuild.Core.Utilities;
46 46
47namespace Prebuild.Core.Nodes 47namespace Prebuild.Core.Nodes
48{ 48{
49 /// <summary> 49 /// <summary>
50 /// 50 ///
51 /// </summary> 51 /// </summary>
52 [DataNode("Options")] 52 [DataNode("Options")]
53 public class OptionsNode : DataNode 53 public class OptionsNode : DataNode
54 { 54 {
55 #region Fields 55 #region Fields
56 56
57 private static Hashtable m_OptionFields; 57 private static Hashtable m_OptionFields;
58 58
59 [OptionNode("CompilerDefines")] 59 [OptionNode("CompilerDefines")]
60 private string m_CompilerDefines = ""; 60 private string m_CompilerDefines = "";
61 61
62 /// <summary> 62 /// <summary>
63 /// 63 ///
64 /// </summary> 64 /// </summary>
65 public string CompilerDefines 65 public string CompilerDefines
66 { 66 {
67 get 67 get
68 { 68 {
69 return m_CompilerDefines; 69 return m_CompilerDefines;
70 } 70 }
71 set 71 set
72 { 72 {
73 m_CompilerDefines = value; 73 m_CompilerDefines = value;
74 } 74 }
75 } 75 }
76 76
77 [OptionNode("OptimizeCode")] 77 [OptionNode("OptimizeCode")]
78 private bool m_OptimizeCode; 78 private bool m_OptimizeCode;
79 79
80 /// <summary> 80 /// <summary>
81 /// 81 ///
82 /// </summary> 82 /// </summary>
83 public bool OptimizeCode 83 public bool OptimizeCode
84 { 84 {
85 get 85 get
86 { 86 {
87 return m_OptimizeCode; 87 return m_OptimizeCode;
88 } 88 }
89 set 89 set
90 { 90 {
91 m_OptimizeCode = value; 91 m_OptimizeCode = value;
92 } 92 }
93 } 93 }
94 94
95 [OptionNode("CheckUnderflowOverflow")] 95 [OptionNode("CheckUnderflowOverflow")]
96 private bool m_CheckUnderflowOverflow; 96 private bool m_CheckUnderflowOverflow;
97 97
98 /// <summary> 98 /// <summary>
99 /// 99 ///
100 /// </summary> 100 /// </summary>
101 public bool CheckUnderflowOverflow 101 public bool CheckUnderflowOverflow
102 { 102 {
103 get 103 get
104 { 104 {
105 return m_CheckUnderflowOverflow; 105 return m_CheckUnderflowOverflow;
106 } 106 }
107 set 107 set
108 { 108 {
109 m_CheckUnderflowOverflow = value; 109 m_CheckUnderflowOverflow = value;
110 } 110 }
111 } 111 }
112 112
113 [OptionNode("AllowUnsafe")] 113 [OptionNode("AllowUnsafe")]
114 private bool m_AllowUnsafe; 114 private bool m_AllowUnsafe;
115 115
116 /// <summary> 116 /// <summary>
117 /// 117 ///
118 /// </summary> 118 /// </summary>
119 public bool AllowUnsafe 119 public bool AllowUnsafe
120 { 120 {
121 get 121 get
122 { 122 {
123 return m_AllowUnsafe; 123 return m_AllowUnsafe;
124 } 124 }
125 set 125 set
126 { 126 {
127 m_AllowUnsafe = value; 127 m_AllowUnsafe = value;
128 } 128 }
129 } 129 }
130 130
131 [OptionNode("PreBuildEvent")] 131 [OptionNode("PreBuildEvent")]
132 private string m_PreBuildEvent; 132 private string m_PreBuildEvent;
133 133
134 /// <summary> 134 /// <summary>
135 /// 135 ///
136 /// </summary> 136 /// </summary>
137 public string PreBuildEvent 137 public string PreBuildEvent
138 { 138 {
139 get 139 get
140 { 140 {
141 return m_PreBuildEvent; 141 return m_PreBuildEvent;
142 } 142 }
143 set 143 set
144 { 144 {
145 m_PreBuildEvent = value; 145 m_PreBuildEvent = value;
146 } 146 }
147 } 147 }
148 148
149 [OptionNode("PostBuildEvent")] 149 [OptionNode("PostBuildEvent")]
150 private string m_PostBuildEvent; 150 private string m_PostBuildEvent;
151 151
152 /// <summary> 152 /// <summary>
153 /// 153 ///
154 /// </summary> 154 /// </summary>
155 public string PostBuildEvent 155 public string PostBuildEvent
156 { 156 {
157 get 157 get
158 { 158 {
159 return m_PostBuildEvent; 159 return m_PostBuildEvent;
160 } 160 }
161 set 161 set
162 { 162 {
163 m_PostBuildEvent = value; 163 m_PostBuildEvent = value;
164 } 164 }
165 } 165 }
166 166
167 [OptionNode("PreBuildEventArgs")] 167 [OptionNode("PreBuildEventArgs")]
168 private string m_PreBuildEventArgs; 168 private string m_PreBuildEventArgs;
169 169
170 /// <summary> 170 /// <summary>
171 /// 171 ///
172 /// </summary> 172 /// </summary>
173 public string PreBuildEventArgs 173 public string PreBuildEventArgs
174 { 174 {
175 get 175 get
176 { 176 {
177 return m_PreBuildEventArgs; 177 return m_PreBuildEventArgs;
178 } 178 }
179 set 179 set
180 { 180 {
181 m_PreBuildEventArgs = value; 181 m_PreBuildEventArgs = value;
182 } 182 }
183 } 183 }
184 184
185 [OptionNode("PostBuildEventArgs")] 185 [OptionNode("PostBuildEventArgs")]
186 private string m_PostBuildEventArgs; 186 private string m_PostBuildEventArgs;
187 187
188 /// <summary> 188 /// <summary>
189 /// 189 ///
190 /// </summary> 190 /// </summary>
191 public string PostBuildEventArgs 191 public string PostBuildEventArgs
192 { 192 {
193 get 193 get
194 { 194 {
195 return m_PostBuildEventArgs; 195 return m_PostBuildEventArgs;
196 } 196 }
197 set 197 set
198 { 198 {
199 m_PostBuildEventArgs = value; 199 m_PostBuildEventArgs = value;
200 } 200 }
201 } 201 }
202 202
203 [OptionNode("RunPostBuildEvent")] 203 [OptionNode("RunPostBuildEvent")]
204 private string m_RunPostBuildEvent; 204 private string m_RunPostBuildEvent;
205 205
206 /// <summary> 206 /// <summary>
207 /// 207 ///
208 /// </summary> 208 /// </summary>
209 public string RunPostBuildEvent 209 public string RunPostBuildEvent
210 { 210 {
211 get 211 get
212 { 212 {
213 return m_RunPostBuildEvent; 213 return m_RunPostBuildEvent;
214 } 214 }
215 set 215 set
216 { 216 {
217 m_RunPostBuildEvent = value; 217 m_RunPostBuildEvent = value;
218 } 218 }
219 } 219 }
220 220
221 [OptionNode("RunScript")] 221 [OptionNode("RunScript")]
222 private string m_RunScript; 222 private string m_RunScript;
223 223
224 /// <summary> 224 /// <summary>
225 /// 225 ///
226 /// </summary> 226 /// </summary>
227 public string RunScript 227 public string RunScript
228 { 228 {
229 get 229 get
230 { 230 {
231 return m_RunScript; 231 return m_RunScript;
232 } 232 }
233 set 233 set
234 { 234 {
235 m_RunScript = value; 235 m_RunScript = value;
236 } 236 }
237 } 237 }
238 238
239 [OptionNode("WarningLevel")] 239 [OptionNode("WarningLevel")]
240 private int m_WarningLevel = 4; 240 private int m_WarningLevel = 4;
241 241
242 /// <summary> 242 /// <summary>
243 /// 243 ///
244 /// </summary> 244 /// </summary>
245 public int WarningLevel 245 public int WarningLevel
246 { 246 {
247 get 247 get
248 { 248 {
249 return m_WarningLevel; 249 return m_WarningLevel;
250 } 250 }
251 set 251 set
252 { 252 {
253 m_WarningLevel = value; 253 m_WarningLevel = value;
254 } 254 }
255 } 255 }
256 256
257 [OptionNode("WarningsAsErrors")] 257 [OptionNode("WarningsAsErrors")]
258 private bool m_WarningsAsErrors; 258 private bool m_WarningsAsErrors;
259 259
260 /// <summary> 260 /// <summary>
261 /// 261 ///
262 /// </summary> 262 /// </summary>
263 public bool WarningsAsErrors 263 public bool WarningsAsErrors
264 { 264 {
265 get 265 get
266 { 266 {
267 return m_WarningsAsErrors; 267 return m_WarningsAsErrors;
268 } 268 }
269 set 269 set
270 { 270 {
271 m_WarningsAsErrors = value; 271 m_WarningsAsErrors = value;
272 } 272 }
273 } 273 }
274 274
275 [OptionNode("SuppressWarnings")] 275 [OptionNode("SuppressWarnings")]
276 private string m_SuppressWarnings = ""; 276 private string m_SuppressWarnings = "";
277 277
278 /// <summary> 278 /// <summary>
279 /// 279 ///
280 /// </summary> 280 /// </summary>
281 public string SuppressWarnings 281 public string SuppressWarnings
282 { 282 {
283 get 283 get
284 { 284 {
285 return m_SuppressWarnings; 285 return m_SuppressWarnings;
286 } 286 }
287 set 287 set
288 { 288 {
289 m_SuppressWarnings = value; 289 m_SuppressWarnings = value;
290 } 290 }
291 } 291 }
292 292
293 [OptionNode("OutputPath")] 293 [OptionNode("OutputPath")]
294 private string m_OutputPath = "bin/"; 294 private string m_OutputPath = "bin/";
295 295
296 /// <summary> 296 /// <summary>
297 /// 297 ///
298 /// </summary> 298 /// </summary>
299 public string OutputPath 299 public string OutputPath
300 { 300 {
301 get 301 get
302 { 302 {
303 return m_OutputPath; 303 return m_OutputPath;
304 } 304 }
305 set 305 set
306 { 306 {
307 m_OutputPath = value; 307 m_OutputPath = value;
308 } 308 }
309 } 309 }
310 310
311 [OptionNode("GenerateDocumentation")] 311 [OptionNode("GenerateDocumentation")]
312 private bool m_GenerateDocumentation; 312 private bool m_GenerateDocumentation;
313 313
314 /// <summary> 314 /// <summary>
315 /// 315 ///
316 /// </summary> 316 /// </summary>
317 public bool GenerateDocumentation 317 public bool GenerateDocumentation
318 { 318 {
319 get 319 get
320 { 320 {
321 return m_GenerateDocumentation; 321 return m_GenerateDocumentation;
322 } 322 }
323 set 323 set
324 { 324 {
325 m_GenerateDocumentation = value; 325 m_GenerateDocumentation = value;
326 } 326 }
327 } 327 }
328 328
329 [OptionNode("GenerateXmlDocFile")] 329 [OptionNode("GenerateXmlDocFile")]
330 private bool m_GenerateXmlDocFile; 330 private bool m_GenerateXmlDocFile;
331 331
332 /// <summary> 332 /// <summary>
333 /// 333 ///
334 /// </summary> 334 /// </summary>
335 public bool GenerateXmlDocFile 335 public bool GenerateXmlDocFile
336 { 336 {
337 get 337 get
338 { 338 {
339 return m_GenerateXmlDocFile; 339 return m_GenerateXmlDocFile;
340 } 340 }
341 set 341 set
342 { 342 {
343 m_GenerateXmlDocFile = value; 343 m_GenerateXmlDocFile = value;
344 } 344 }
345 } 345 }
346 346
347 [OptionNode("XmlDocFile")] 347 [OptionNode("XmlDocFile")]
348 private string m_XmlDocFile = ""; 348 private string m_XmlDocFile = "";
349 349
350 /// <summary> 350 /// <summary>
351 /// 351 ///
352 /// </summary> 352 /// </summary>
353 public string XmlDocFile 353 public string XmlDocFile
354 { 354 {
355 get 355 get
356 { 356 {
357 return m_XmlDocFile; 357 return m_XmlDocFile;
358 } 358 }
359 set 359 set
360 { 360 {
361 m_XmlDocFile = value; 361 m_XmlDocFile = value;
362 } 362 }
363 } 363 }
364 364
365 [OptionNode("KeyFile")] 365 [OptionNode("KeyFile")]
366 private string m_KeyFile = ""; 366 private string m_KeyFile = "";
367 367
368 /// <summary> 368 /// <summary>
369 /// 369 ///
370 /// </summary> 370 /// </summary>
371 public string KeyFile 371 public string KeyFile
372 { 372 {
373 get 373 get
374 { 374 {
375 return m_KeyFile; 375 return m_KeyFile;
376 } 376 }
377 set 377 set
378 { 378 {
379 m_KeyFile = value; 379 m_KeyFile = value;
380 } 380 }
381 } 381 }
382 382
383 [OptionNode("DebugInformation")] 383 [OptionNode("DebugInformation")]
384 private bool m_DebugInformation; 384 private bool m_DebugInformation;
385 385
386 /// <summary> 386 /// <summary>
387 /// 387 ///
388 /// </summary> 388 /// </summary>
389 public bool DebugInformation 389 public bool DebugInformation
390 { 390 {
391 get 391 get
392 { 392 {
393 return m_DebugInformation; 393 return m_DebugInformation;
394 } 394 }
395 set 395 set
396 { 396 {
397 m_DebugInformation = value; 397 m_DebugInformation = value;
398 } 398 }
399 } 399 }
400 400
401 [OptionNode("RegisterComInterop")] 401 [OptionNode("RegisterComInterop")]
402 private bool m_RegisterComInterop; 402 private bool m_RegisterComInterop;
403 403
404 /// <summary> 404 /// <summary>
405 /// 405 ///
406 /// </summary> 406 /// </summary>
407 public bool RegisterComInterop 407 public bool RegisterComInterop
408 { 408 {
409 get 409 get
410 { 410 {
411 return m_RegisterComInterop; 411 return m_RegisterComInterop;
412 } 412 }
413 set 413 set
414 { 414 {
415 m_RegisterComInterop = value; 415 m_RegisterComInterop = value;
416 } 416 }
417 } 417 }
418 418
419 [OptionNode("RemoveIntegerChecks")] 419 [OptionNode("RemoveIntegerChecks")]
420 private bool m_RemoveIntegerChecks; 420 private bool m_RemoveIntegerChecks;
421 421
422 /// <summary> 422 /// <summary>
423 /// 423 ///
424 /// </summary> 424 /// </summary>
425 public bool RemoveIntegerChecks 425 public bool RemoveIntegerChecks
426 { 426 {
427 get 427 get
428 { 428 {
429 return m_RemoveIntegerChecks; 429 return m_RemoveIntegerChecks;
430 } 430 }
431 set 431 set
432 { 432 {
433 m_RemoveIntegerChecks = value; 433 m_RemoveIntegerChecks = value;
434 } 434 }
435 } 435 }
436 436
437 [OptionNode("IncrementalBuild")] 437 [OptionNode("IncrementalBuild")]
438 private bool m_IncrementalBuild; 438 private bool m_IncrementalBuild;
439 439
440 /// <summary> 440 /// <summary>
441 /// 441 ///
442 /// </summary> 442 /// </summary>
443 public bool IncrementalBuild 443 public bool IncrementalBuild
444 { 444 {
445 get 445 get
446 { 446 {
447 return m_IncrementalBuild; 447 return m_IncrementalBuild;
448 } 448 }
449 set 449 set
450 { 450 {
451 m_IncrementalBuild = value; 451 m_IncrementalBuild = value;
452 } 452 }
453 } 453 }
454 454
455 [OptionNode("BaseAddress")] 455 [OptionNode("BaseAddress")]
456 private string m_BaseAddress = "285212672"; 456 private string m_BaseAddress = "285212672";
457 457
458 /// <summary> 458 /// <summary>
459 /// 459 ///
460 /// </summary> 460 /// </summary>
461 public string BaseAddress 461 public string BaseAddress
462 { 462 {
463 get 463 get
464 { 464 {
465 return m_BaseAddress; 465 return m_BaseAddress;
466 } 466 }
467 set 467 set
468 { 468 {
469 m_BaseAddress = value; 469 m_BaseAddress = value;
470 } 470 }
471 } 471 }
472 472
473 [OptionNode("FileAlignment")] 473 [OptionNode("FileAlignment")]
474 private int m_FileAlignment = 4096; 474 private int m_FileAlignment = 4096;
475 475
476 /// <summary> 476 /// <summary>
477 /// 477 ///
478 /// </summary> 478 /// </summary>
479 public int FileAlignment 479 public int FileAlignment
480 { 480 {
481 get 481 get
482 { 482 {
483 return m_FileAlignment; 483 return m_FileAlignment;
484 } 484 }
485 set 485 set
486 { 486 {
487 m_FileAlignment = value; 487 m_FileAlignment = value;
488 } 488 }
489 } 489 }
490 490
491 [OptionNode("NoStdLib")] 491 [OptionNode("NoStdLib")]
492 private bool m_NoStdLib; 492 private bool m_NoStdLib;
493 493
494 /// <summary> 494 /// <summary>
495 /// 495 ///
496 /// </summary> 496 /// </summary>
497 public bool NoStdLib 497 public bool NoStdLib
498 { 498 {
499 get 499 get
500 { 500 {
501 return m_NoStdLib; 501 return m_NoStdLib;
502 } 502 }
503 set 503 set
504 { 504 {
505 m_NoStdLib = value; 505 m_NoStdLib = value;
506 } 506 }
507 } 507 }
508 508
509 private StringCollection m_FieldsDefined; 509 private StringCollection m_FieldsDefined;
510 510
511 #endregion 511 #endregion
512 512
513 #region Constructors 513 #region Constructors
514 514
515 /// <summary> 515 /// <summary>
516 /// Initializes the <see cref="OptionsNode"/> class. 516 /// Initializes the <see cref="OptionsNode"/> class.
517 /// </summary> 517 /// </summary>
518 static OptionsNode() 518 static OptionsNode()
519 { 519 {
520 Type t = typeof(OptionsNode); 520 Type t = typeof(OptionsNode);
521 521
522 m_OptionFields = new Hashtable(); 522 m_OptionFields = new Hashtable();
523 foreach(FieldInfo f in t.GetFields(BindingFlags.NonPublic | BindingFlags.Instance)) 523 foreach(FieldInfo f in t.GetFields(BindingFlags.NonPublic | BindingFlags.Instance))
524 { 524 {
525 object[] attrs = f.GetCustomAttributes(typeof(OptionNodeAttribute), false); 525 object[] attrs = f.GetCustomAttributes(typeof(OptionNodeAttribute), false);
526 if(attrs == null || attrs.Length < 1) 526 if(attrs == null || attrs.Length < 1)
527 { 527 {
528 continue; 528 continue;
529 } 529 }
530 530
531 OptionNodeAttribute ona = (OptionNodeAttribute)attrs[0]; 531 OptionNodeAttribute ona = (OptionNodeAttribute)attrs[0];
532 m_OptionFields[ona.NodeName] = f; 532 m_OptionFields[ona.NodeName] = f;
533 } 533 }
534 } 534 }
535 535
536 /// <summary> 536 /// <summary>
537 /// Initializes a new instance of the <see cref="OptionsNode"/> class. 537 /// Initializes a new instance of the <see cref="OptionsNode"/> class.
538 /// </summary> 538 /// </summary>
539 public OptionsNode() 539 public OptionsNode()
540 { 540 {
541 m_FieldsDefined = new StringCollection(); 541 m_FieldsDefined = new StringCollection();
542 } 542 }
543 543
544 #endregion 544 #endregion
545 545
546 #region Properties 546 #region Properties
547 547
548 /// <summary> 548 /// <summary>
549 /// Gets the <see cref="Object"/> at the specified index. 549 /// Gets the <see cref="Object"/> at the specified index.
550 /// </summary> 550 /// </summary>
551 /// <value></value> 551 /// <value></value>
552 public object this[string index] 552 public object this[string index]
553 { 553 {
554 get 554 get
555 { 555 {
556 if(!m_OptionFields.ContainsKey(index)) 556 if(!m_OptionFields.ContainsKey(index))
557 { 557 {
558 return null; 558 return null;
559 } 559 }
560 560
561 FieldInfo f = (FieldInfo)m_OptionFields[index]; 561 FieldInfo f = (FieldInfo)m_OptionFields[index];
562 return f.GetValue(this); 562 return f.GetValue(this);
563 } 563 }
564 } 564 }
565 565
566 /// <summary> 566 /// <summary>
567 /// Gets the <see cref="Object"/> at the specified index. 567 /// Gets the <see cref="Object"/> at the specified index.
568 /// </summary> 568 /// </summary>
569 /// <value></value> 569 /// <value></value>
570 public object this[string index, object defaultValue] 570 public object this[string index, object defaultValue]
571 { 571 {
572 get 572 get
573 { 573 {
574 object valueObject = this[index]; 574 object valueObject = this[index];
575 if(valueObject != null && valueObject is string && ((string)valueObject).Length == 0) 575 if(valueObject != null && valueObject is string && ((string)valueObject).Length == 0)
576 { 576 {
577 return defaultValue; 577 return defaultValue;
578 } 578 }
579 return valueObject; 579 return valueObject;
580 } 580 }
581 } 581 }
582 582
583 583
584 #endregion 584 #endregion
585 585
586 #region Private Methods 586 #region Private Methods
587 587
588 private void FlagDefined(string name) 588 private void FlagDefined(string name)
589 { 589 {
590 if(!m_FieldsDefined.Contains(name)) 590 if(!m_FieldsDefined.Contains(name))
591 { 591 {
592 m_FieldsDefined.Add(name); 592 m_FieldsDefined.Add(name);
593 } 593 }
594 } 594 }
595 595
596 private void SetOption(string nodeName, string val) 596 private void SetOption(string nodeName, string val)
597 { 597 {
598 lock(m_OptionFields) 598 lock(m_OptionFields)
599 { 599 {
600 if(!m_OptionFields.ContainsKey(nodeName)) 600 if(!m_OptionFields.ContainsKey(nodeName))
601 { 601 {
602 return; 602 return;
603 } 603 }
604 604
605 FieldInfo f = (FieldInfo)m_OptionFields[nodeName]; 605 FieldInfo f = (FieldInfo)m_OptionFields[nodeName];
606 f.SetValue(this, Helper.TranslateValue(f.FieldType, val)); 606 f.SetValue(this, Helper.TranslateValue(f.FieldType, val));
607 FlagDefined(f.Name); 607 FlagDefined(f.Name);
608 } 608 }
609 } 609 }
610 610
611 #endregion 611 #endregion
612 612
613 #region Public Methods 613 #region Public Methods
614 614
615 /// <summary> 615 /// <summary>
616 /// Parses the specified node. 616 /// Parses the specified node.
617 /// </summary> 617 /// </summary>
618 /// <param name="node">The node.</param> 618 /// <param name="node">The node.</param>
619 public override void Parse(XmlNode node) 619 public override void Parse(XmlNode node)
620 { 620 {
621 if( node == null ) 621 if( node == null )
622 { 622 {
623 throw new ArgumentNullException("node"); 623 throw new ArgumentNullException("node");
624 } 624 }
625 625
626 foreach(XmlNode child in node.ChildNodes) 626 foreach(XmlNode child in node.ChildNodes)
627 { 627 {
628 SetOption(child.Name, Helper.InterpolateForEnvironmentVariables(child.InnerText)); 628 SetOption(child.Name, Helper.InterpolateForEnvironmentVariables(child.InnerText));
629 } 629 }
630 } 630 }
631 631
632 /// <summary> 632 /// <summary>
633 /// Copies to. 633 /// Copies to.
634 /// </summary> 634 /// </summary>
635 /// <param name="opt">The opt.</param> 635 /// <param name="opt">The opt.</param>
636 public void CopyTo(OptionsNode opt) 636 public void CopyTo(OptionsNode opt)
637 { 637 {
638 if(opt == null) 638 if(opt == null)
639 { 639 {
640 return; 640 return;
641 } 641 }
642 642
643 foreach(FieldInfo f in m_OptionFields.Values) 643 foreach(FieldInfo f in m_OptionFields.Values)
644 { 644 {
645 if(m_FieldsDefined.Contains(f.Name)) 645 if(m_FieldsDefined.Contains(f.Name))
646 { 646 {
647 f.SetValue(opt, f.GetValue(this)); 647 f.SetValue(opt, f.GetValue(this));
648 opt.m_FieldsDefined.Add(f.Name); 648 opt.m_FieldsDefined.Add(f.Name);
649 } 649 }
650 } 650 }
651 } 651 }
652 652
653 #endregion 653 #endregion
654 } 654 }
655} 655}
diff --git a/Prebuild/src/Core/Nodes/ProcessNode.cs b/Prebuild/src/Core/Nodes/ProcessNode.cs
index f546a4b..5f3dbe6 100644
--- a/Prebuild/src/Core/Nodes/ProcessNode.cs
+++ b/Prebuild/src/Core/Nodes/ProcessNode.cs
@@ -1,119 +1,119 @@
1#region BSD License 1#region BSD License
2/* 2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com) 3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4 4
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/ 23*/
24#endregion 24#endregion
25 25
26#region CVS Information 26#region CVS Information
27/* 27/*
28 * $Source$ 28 * $Source$
29 * $Author: jendave $ 29 * $Author: jendave $
30 * $Date: 2006-01-28 01:49:58 +0100 (lö, 28 jan 2006) $ 30 * $Date: 2006-01-28 01:49:58 +0100 (lö, 28 jan 2006) $
31 * $Revision: 71 $ 31 * $Revision: 71 $
32 */ 32 */
33#endregion 33#endregion
34 34
35using System; 35using System;
36using System.Collections; 36using System.Collections;
37using System.Collections.Specialized; 37using System.Collections.Specialized;
38using System.Xml; 38using System.Xml;
39 39
40using Prebuild.Core.Attributes; 40using Prebuild.Core.Attributes;
41using Prebuild.Core.Interfaces; 41using Prebuild.Core.Interfaces;
42using Prebuild.Core.Utilities; 42using Prebuild.Core.Utilities;
43 43
44namespace Prebuild.Core.Nodes 44namespace Prebuild.Core.Nodes
45{ 45{
46 /// <summary> 46 /// <summary>
47 /// 47 ///
48 /// </summary> 48 /// </summary>
49 [DataNode("Process")] 49 [DataNode("Process")]
50 public class ProcessNode : DataNode 50 public class ProcessNode : DataNode
51 { 51 {
52 #region Fields 52 #region Fields
53 53
54 private string m_Path; 54 private string m_Path;
55 private bool m_IsValid = true; 55 private bool m_IsValid = true;
56 56
57 #endregion 57 #endregion
58 58
59 #region Properties 59 #region Properties
60 60
61 /// <summary> 61 /// <summary>
62 /// Gets the path. 62 /// Gets the path.
63 /// </summary> 63 /// </summary>
64 /// <value>The path.</value> 64 /// <value>The path.</value>
65 public string Path 65 public string Path
66 { 66 {
67 get 67 get
68 { 68 {
69 return m_Path; 69 return m_Path;
70 } 70 }
71 } 71 }
72 72
73 /// <summary> 73 /// <summary>
74 /// Gets a value indicating whether this instance is valid. 74 /// Gets a value indicating whether this instance is valid.
75 /// </summary> 75 /// </summary>
76 /// <value><c>true</c> if this instance is valid; otherwise, <c>false</c>.</value> 76 /// <value><c>true</c> if this instance is valid; otherwise, <c>false</c>.</value>
77 public bool IsValid 77 public bool IsValid
78 { 78 {
79 get 79 get
80 { 80 {
81 return m_IsValid; 81 return m_IsValid;
82 } 82 }
83 } 83 }
84 84
85 #endregion 85 #endregion
86 86
87 #region Public Methods 87 #region Public Methods
88 88
89 /// <summary> 89 /// <summary>
90 /// Parses the specified node. 90 /// Parses the specified node.
91 /// </summary> 91 /// </summary>
92 /// <param name="node">The node.</param> 92 /// <param name="node">The node.</param>
93 public override void Parse(XmlNode node) 93 public override void Parse(XmlNode node)
94 { 94 {
95 if( node == null ) 95 if( node == null )
96 { 96 {
97 throw new ArgumentNullException("node"); 97 throw new ArgumentNullException("node");
98 } 98 }
99 99
100 m_Path = Helper.InterpolateForEnvironmentVariables(node.InnerText); 100 m_Path = Helper.InterpolateForEnvironmentVariables(node.InnerText);
101 if(m_Path == null) 101 if(m_Path == null)
102 { 102 {
103 m_Path = ""; 103 m_Path = "";
104 } 104 }
105 105
106 try 106 try
107 { 107 {
108 m_Path = Helper.ResolvePath(m_Path); 108 m_Path = Helper.ResolvePath(m_Path);
109 } 109 }
110 catch(ArgumentException) 110 catch(ArgumentException)
111 { 111 {
112 Kernel.Instance.Log.Write(LogType.Warning, "Could not find prebuild file for processing: {0}", m_Path); 112 Kernel.Instance.Log.Write(LogType.Warning, "Could not find prebuild file for processing: {0}", m_Path);
113 m_IsValid = false; 113 m_IsValid = false;
114 } 114 }
115 } 115 }
116 116
117 #endregion 117 #endregion
118 } 118 }
119} 119}
diff --git a/Prebuild/src/Core/Nodes/ProjectNode.cs b/Prebuild/src/Core/Nodes/ProjectNode.cs
index c56dacc..bddaace 100644
--- a/Prebuild/src/Core/Nodes/ProjectNode.cs
+++ b/Prebuild/src/Core/Nodes/ProjectNode.cs
@@ -1,510 +1,510 @@
1#region BSD License 1#region BSD License
2/* 2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com) 3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4 4
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/ 23*/
24#endregion 24#endregion
25 25
26#region CVS Information 26#region CVS Information
27/* 27/*
28 * $Source$ 28 * $Source$
29 * $Author: jendave $ 29 * $Author: jendave $
30 * $Date: 2006-11-11 05:43:20 +0100 (lö, 11 nov 2006) $ 30 * $Date: 2006-11-11 05:43:20 +0100 (lö, 11 nov 2006) $
31 * $Revision: 192 $ 31 * $Revision: 192 $
32 */ 32 */
33#endregion 33#endregion
34 34
35using System; 35using System;
36using System.Collections; 36using System.Collections;
37using System.IO; 37using System.IO;
38using System.Xml; 38using System.Xml;
39 39
40using Prebuild.Core.Attributes; 40using Prebuild.Core.Attributes;
41using Prebuild.Core.Interfaces; 41using Prebuild.Core.Interfaces;
42using Prebuild.Core.Utilities; 42using Prebuild.Core.Utilities;
43 43
44namespace Prebuild.Core.Nodes 44namespace Prebuild.Core.Nodes
45{ 45{
46 /// <summary> 46 /// <summary>
47 /// 47 ///
48 /// </summary> 48 /// </summary>
49 public enum ProjectType 49 public enum ProjectType
50 { 50 {
51 /// <summary> 51 /// <summary>
52 /// 52 ///
53 /// </summary> 53 /// </summary>
54 Exe, 54 Exe,
55 /// <summary> 55 /// <summary>
56 /// 56 ///
57 /// </summary> 57 /// </summary>
58 WinExe, 58 WinExe,
59 /// <summary> 59 /// <summary>
60 /// 60 ///
61 /// </summary> 61 /// </summary>
62 Library 62 Library
63 } 63 }
64 64
65 /// <summary> 65 /// <summary>
66 /// 66 ///
67 /// </summary> 67 /// </summary>
68 public enum ClrRuntime 68 public enum ClrRuntime
69 { 69 {
70 /// <summary> 70 /// <summary>
71 /// 71 ///
72 /// </summary> 72 /// </summary>
73 Microsoft, 73 Microsoft,
74 /// <summary> 74 /// <summary>
75 /// 75 ///
76 /// </summary> 76 /// </summary>
77 Mono 77 Mono
78 } 78 }
79 79
80 /// <summary> 80 /// <summary>
81 /// 81 ///
82 /// </summary> 82 /// </summary>
83 [DataNode("Project")] 83 [DataNode("Project")]
84 public class ProjectNode : DataNode, IComparable 84 public class ProjectNode : DataNode, IComparable
85 { 85 {
86 #region Fields 86 #region Fields
87 87
88 private string m_Name = "unknown"; 88 private string m_Name = "unknown";
89 private string m_Path = ""; 89 private string m_Path = "";
90 private string m_FullPath = ""; 90 private string m_FullPath = "";
91 private string m_AssemblyName; 91 private string m_AssemblyName;
92 private string m_AppIcon = ""; 92 private string m_AppIcon = "";
93 private string m_DesignerFolder = ""; 93 private string m_DesignerFolder = "";
94 private string m_Language = "C#"; 94 private string m_Language = "C#";
95 private ProjectType m_Type = ProjectType.Exe; 95 private ProjectType m_Type = ProjectType.Exe;
96 private ClrRuntime m_Runtime = ClrRuntime.Microsoft; 96 private ClrRuntime m_Runtime = ClrRuntime.Microsoft;
97 private string m_StartupObject = ""; 97 private string m_StartupObject = "";
98 private string m_RootNamespace; 98 private string m_RootNamespace;
99 private string m_FilterGroups = ""; 99 private string m_FilterGroups = "";
100 private Guid m_Guid; 100 private Guid m_Guid;
101 101
102 private Hashtable m_Configurations; 102 private Hashtable m_Configurations;
103 private ArrayList m_ReferencePaths; 103 private ArrayList m_ReferencePaths;
104 private ArrayList m_References; 104 private ArrayList m_References;
105 private FilesNode m_Files; 105 private FilesNode m_Files;
106 106
107 #endregion 107 #endregion
108 108
109 #region Constructors 109 #region Constructors
110 110
111 /// <summary> 111 /// <summary>
112 /// Initializes a new instance of the <see cref="ProjectNode"/> class. 112 /// Initializes a new instance of the <see cref="ProjectNode"/> class.
113 /// </summary> 113 /// </summary>
114 public ProjectNode() 114 public ProjectNode()
115 { 115 {
116 m_Configurations = new Hashtable(); 116 m_Configurations = new Hashtable();
117 m_ReferencePaths = new ArrayList(); 117 m_ReferencePaths = new ArrayList();
118 m_References = new ArrayList(); 118 m_References = new ArrayList();
119 } 119 }
120 120
121 #endregion 121 #endregion
122 122
123 #region Properties 123 #region Properties
124 124
125 /// <summary> 125 /// <summary>
126 /// Gets the name. 126 /// Gets the name.
127 /// </summary> 127 /// </summary>
128 /// <value>The name.</value> 128 /// <value>The name.</value>
129 public string Name 129 public string Name
130 { 130 {
131 get 131 get
132 { 132 {
133 return m_Name; 133 return m_Name;
134 } 134 }
135 } 135 }
136 136
137 /// <summary> 137 /// <summary>
138 /// Gets the path. 138 /// Gets the path.
139 /// </summary> 139 /// </summary>
140 /// <value>The path.</value> 140 /// <value>The path.</value>
141 public string Path 141 public string Path
142 { 142 {
143 get 143 get
144 { 144 {
145 return m_Path; 145 return m_Path;
146 } 146 }
147 } 147 }
148 148
149 /// <summary> 149 /// <summary>
150 /// Gets the filter groups. 150 /// Gets the filter groups.
151 /// </summary> 151 /// </summary>
152 /// <value>The filter groups.</value> 152 /// <value>The filter groups.</value>
153 public string FilterGroups 153 public string FilterGroups
154 { 154 {
155 get 155 get
156 { 156 {
157 return m_FilterGroups; 157 return m_FilterGroups;
158 } 158 }
159 } 159 }
160 160
161 /// <summary> 161 /// <summary>
162 /// Gets the full path. 162 /// Gets the full path.
163 /// </summary> 163 /// </summary>
164 /// <value>The full path.</value> 164 /// <value>The full path.</value>
165 public string FullPath 165 public string FullPath
166 { 166 {
167 get 167 get
168 { 168 {
169 return m_FullPath; 169 return m_FullPath;
170 } 170 }
171 } 171 }
172 172
173 /// <summary> 173 /// <summary>
174 /// Gets the name of the assembly. 174 /// Gets the name of the assembly.
175 /// </summary> 175 /// </summary>
176 /// <value>The name of the assembly.</value> 176 /// <value>The name of the assembly.</value>
177 public string AssemblyName 177 public string AssemblyName
178 { 178 {
179 get 179 get
180 { 180 {
181 return m_AssemblyName; 181 return m_AssemblyName;
182 } 182 }
183 } 183 }
184 184
185 /// <summary> 185 /// <summary>
186 /// Gets the app icon. 186 /// Gets the app icon.
187 /// </summary> 187 /// </summary>
188 /// <value>The app icon.</value> 188 /// <value>The app icon.</value>
189 public string AppIcon 189 public string AppIcon
190 { 190 {
191 get 191 get
192 { 192 {
193 return m_AppIcon; 193 return m_AppIcon;
194 } 194 }
195 } 195 }
196 196
197 /// <summary> 197 /// <summary>
198 /// 198 ///
199 /// </summary> 199 /// </summary>
200 public string DesignerFolder 200 public string DesignerFolder
201 { 201 {
202 get 202 get
203 { 203 {
204 return m_DesignerFolder; 204 return m_DesignerFolder;
205 } 205 }
206 } 206 }
207 207
208 /// <summary> 208 /// <summary>
209 /// Gets the language. 209 /// Gets the language.
210 /// </summary> 210 /// </summary>
211 /// <value>The language.</value> 211 /// <value>The language.</value>
212 public string Language 212 public string Language
213 { 213 {
214 get 214 get
215 { 215 {
216 return m_Language; 216 return m_Language;
217 } 217 }
218 } 218 }
219 219
220 /// <summary> 220 /// <summary>
221 /// Gets the type. 221 /// Gets the type.
222 /// </summary> 222 /// </summary>
223 /// <value>The type.</value> 223 /// <value>The type.</value>
224 public ProjectType Type 224 public ProjectType Type
225 { 225 {
226 get 226 get
227 { 227 {
228 return m_Type; 228 return m_Type;
229 } 229 }
230 } 230 }
231 231
232 /// <summary> 232 /// <summary>
233 /// Gets the runtime. 233 /// Gets the runtime.
234 /// </summary> 234 /// </summary>
235 /// <value>The runtime.</value> 235 /// <value>The runtime.</value>
236 public ClrRuntime Runtime 236 public ClrRuntime Runtime
237 { 237 {
238 get 238 get
239 { 239 {
240 return m_Runtime; 240 return m_Runtime;
241 } 241 }
242 } 242 }
243 243
244 private bool m_GenerateAssemblyInfoFile = false; 244 private bool m_GenerateAssemblyInfoFile = false;
245 245
246 /// <summary> 246 /// <summary>
247 /// 247 ///
248 /// </summary> 248 /// </summary>
249 public bool GenerateAssemblyInfoFile 249 public bool GenerateAssemblyInfoFile
250 { 250 {
251 get 251 get
252 { 252 {
253 return m_GenerateAssemblyInfoFile; 253 return m_GenerateAssemblyInfoFile;
254 } 254 }
255 set 255 set
256 { 256 {
257 m_GenerateAssemblyInfoFile = value; 257 m_GenerateAssemblyInfoFile = value;
258 } 258 }
259 } 259 }
260 260
261 /// <summary> 261 /// <summary>
262 /// Gets the startup object. 262 /// Gets the startup object.
263 /// </summary> 263 /// </summary>
264 /// <value>The startup object.</value> 264 /// <value>The startup object.</value>
265 public string StartupObject 265 public string StartupObject
266 { 266 {
267 get 267 get
268 { 268 {
269 return m_StartupObject; 269 return m_StartupObject;
270 } 270 }
271 } 271 }
272 272
273 /// <summary> 273 /// <summary>
274 /// Gets the root namespace. 274 /// Gets the root namespace.
275 /// </summary> 275 /// </summary>
276 /// <value>The root namespace.</value> 276 /// <value>The root namespace.</value>
277 public string RootNamespace 277 public string RootNamespace
278 { 278 {
279 get 279 get
280 { 280 {
281 return m_RootNamespace; 281 return m_RootNamespace;
282 } 282 }
283 } 283 }
284 284
285 /// <summary> 285 /// <summary>
286 /// Gets the configurations. 286 /// Gets the configurations.
287 /// </summary> 287 /// </summary>
288 /// <value>The configurations.</value> 288 /// <value>The configurations.</value>
289 public ICollection Configurations 289 public ICollection Configurations
290 { 290 {
291 get 291 get
292 { 292 {
293 ArrayList tmp = new ArrayList( ConfigurationsTable.Values); 293 ArrayList tmp = new ArrayList( ConfigurationsTable.Values);
294 tmp.Sort(); 294 tmp.Sort();
295 return tmp; 295 return tmp;
296 } 296 }
297 } 297 }
298 298
299 /// <summary> 299 /// <summary>
300 /// Gets the configurations table. 300 /// Gets the configurations table.
301 /// </summary> 301 /// </summary>
302 /// <value>The configurations table.</value> 302 /// <value>The configurations table.</value>
303 public Hashtable ConfigurationsTable 303 public Hashtable ConfigurationsTable
304 { 304 {
305 get 305 get
306 { 306 {
307 return m_Configurations; 307 return m_Configurations;
308 } 308 }
309 } 309 }
310 310
311 /// <summary> 311 /// <summary>
312 /// Gets the reference paths. 312 /// Gets the reference paths.
313 /// </summary> 313 /// </summary>
314 /// <value>The reference paths.</value> 314 /// <value>The reference paths.</value>
315 public ArrayList ReferencePaths 315 public ArrayList ReferencePaths
316 { 316 {
317 get 317 get
318 { 318 {
319 ArrayList tmp = new ArrayList(m_ReferencePaths); 319 ArrayList tmp = new ArrayList(m_ReferencePaths);
320 tmp.Sort(); 320 tmp.Sort();
321 return tmp; 321 return tmp;
322 } 322 }
323 } 323 }
324 324
325 /// <summary> 325 /// <summary>
326 /// Gets the references. 326 /// Gets the references.
327 /// </summary> 327 /// </summary>
328 /// <value>The references.</value> 328 /// <value>The references.</value>
329 public ArrayList References 329 public ArrayList References
330 { 330 {
331 get 331 get
332 { 332 {
333 ArrayList tmp = new ArrayList(m_References); 333 ArrayList tmp = new ArrayList(m_References);
334 tmp.Sort(); 334 tmp.Sort();
335 return tmp; 335 return tmp;
336 } 336 }
337 } 337 }
338 338
339 /// <summary> 339 /// <summary>
340 /// Gets the files. 340 /// Gets the files.
341 /// </summary> 341 /// </summary>
342 /// <value>The files.</value> 342 /// <value>The files.</value>
343 public FilesNode Files 343 public FilesNode Files
344 { 344 {
345 get 345 get
346 { 346 {
347 return m_Files; 347 return m_Files;
348 } 348 }
349 } 349 }
350 350
351 /// <summary> 351 /// <summary>
352 /// Gets or sets the parent. 352 /// Gets or sets the parent.
353 /// </summary> 353 /// </summary>
354 /// <value>The parent.</value> 354 /// <value>The parent.</value>
355 public override IDataNode Parent 355 public override IDataNode Parent
356 { 356 {
357 get 357 get
358 { 358 {
359 return base.Parent; 359 return base.Parent;
360 } 360 }
361 set 361 set
362 { 362 {
363 base.Parent = value; 363 base.Parent = value;
364 if(base.Parent is SolutionNode && m_Configurations.Count < 1) 364 if(base.Parent is SolutionNode && m_Configurations.Count < 1)
365 { 365 {
366 SolutionNode parent = (SolutionNode)base.Parent; 366 SolutionNode parent = (SolutionNode)base.Parent;
367 foreach(ConfigurationNode conf in parent.Configurations) 367 foreach(ConfigurationNode conf in parent.Configurations)
368 { 368 {
369 m_Configurations[conf.Name] = conf.Clone(); 369 m_Configurations[conf.Name] = conf.Clone();
370 } 370 }
371 } 371 }
372 } 372 }
373 } 373 }
374 374
375 /// <summary> 375 /// <summary>
376 /// Gets the GUID. 376 /// Gets the GUID.
377 /// </summary> 377 /// </summary>
378 /// <value>The GUID.</value> 378 /// <value>The GUID.</value>
379 public Guid Guid 379 public Guid Guid
380 { 380 {
381 get 381 get
382 { 382 {
383 return m_Guid; 383 return m_Guid;
384 } 384 }
385 } 385 }
386 386
387 #endregion 387 #endregion
388 388
389 #region Private Methods 389 #region Private Methods
390 390
391 private void HandleConfiguration(ConfigurationNode conf) 391 private void HandleConfiguration(ConfigurationNode conf)
392 { 392 {
393 if(String.Compare(conf.Name, "all", true) == 0) //apply changes to all, this may not always be applied first, 393 if(String.Compare(conf.Name, "all", true) == 0) //apply changes to all, this may not always be applied first,
394 //so it *may* override changes to the same properties for configurations defines at the project level 394 //so it *may* override changes to the same properties for configurations defines at the project level
395 { 395 {
396 foreach(ConfigurationNode confNode in this.m_Configurations.Values) 396 foreach(ConfigurationNode confNode in this.m_Configurations.Values)
397 { 397 {
398 conf.CopyTo(confNode);//update the config templates defines at the project level with the overrides 398 conf.CopyTo(confNode);//update the config templates defines at the project level with the overrides
399 } 399 }
400 } 400 }
401 if(m_Configurations.ContainsKey(conf.Name)) 401 if(m_Configurations.ContainsKey(conf.Name))
402 { 402 {
403 ConfigurationNode parentConf = (ConfigurationNode)m_Configurations[conf.Name]; 403 ConfigurationNode parentConf = (ConfigurationNode)m_Configurations[conf.Name];
404 conf.CopyTo(parentConf);//update the config templates defines at the project level with the overrides 404 conf.CopyTo(parentConf);//update the config templates defines at the project level with the overrides
405 } 405 }
406 else 406 else
407 { 407 {
408 m_Configurations[conf.Name] = conf; 408 m_Configurations[conf.Name] = conf;
409 } 409 }
410 } 410 }
411 411
412 #endregion 412 #endregion
413 413
414 #region Public Methods 414 #region Public Methods
415 415
416 /// <summary> 416 /// <summary>
417 /// Parses the specified node. 417 /// Parses the specified node.
418 /// </summary> 418 /// </summary>
419 /// <param name="node">The node.</param> 419 /// <param name="node">The node.</param>
420 public override void Parse(XmlNode node) 420 public override void Parse(XmlNode node)
421 { 421 {
422 m_Name = Helper.AttributeValue(node, "name", m_Name); 422 m_Name = Helper.AttributeValue(node, "name", m_Name);
423 m_Path = Helper.AttributeValue(node, "path", m_Path); 423 m_Path = Helper.AttributeValue(node, "path", m_Path);
424 m_FilterGroups = Helper.AttributeValue(node, "filterGroups", m_FilterGroups); 424 m_FilterGroups = Helper.AttributeValue(node, "filterGroups", m_FilterGroups);
425 m_AppIcon = Helper.AttributeValue(node, "icon", m_AppIcon); 425 m_AppIcon = Helper.AttributeValue(node, "icon", m_AppIcon);
426 m_DesignerFolder = Helper.AttributeValue(node, "designerFolder", m_DesignerFolder); 426 m_DesignerFolder = Helper.AttributeValue(node, "designerFolder", m_DesignerFolder);
427 m_AssemblyName = Helper.AttributeValue(node, "assemblyName", m_AssemblyName); 427 m_AssemblyName = Helper.AttributeValue(node, "assemblyName", m_AssemblyName);
428 m_Language = Helper.AttributeValue(node, "language", m_Language); 428 m_Language = Helper.AttributeValue(node, "language", m_Language);
429 m_Type = (ProjectType)Helper.EnumAttributeValue(node, "type", typeof(ProjectType), m_Type); 429 m_Type = (ProjectType)Helper.EnumAttributeValue(node, "type", typeof(ProjectType), m_Type);
430 m_Runtime = (ClrRuntime)Helper.EnumAttributeValue(node, "runtime", typeof(ClrRuntime), m_Runtime); 430 m_Runtime = (ClrRuntime)Helper.EnumAttributeValue(node, "runtime", typeof(ClrRuntime), m_Runtime);
431 m_StartupObject = Helper.AttributeValue(node, "startupObject", m_StartupObject); 431 m_StartupObject = Helper.AttributeValue(node, "startupObject", m_StartupObject);
432 m_RootNamespace = Helper.AttributeValue(node, "rootNamespace", m_RootNamespace); 432 m_RootNamespace = Helper.AttributeValue(node, "rootNamespace", m_RootNamespace);
433 433
434 int hash = m_Name.GetHashCode(); 434 int hash = m_Name.GetHashCode();
435 435
436 m_Guid = new Guid( hash, 0, 0, 0, 0, 0, 0,0,0,0,0 ); 436 m_Guid = new Guid( hash, 0, 0, 0, 0, 0, 0,0,0,0,0 );
437 437
438 m_GenerateAssemblyInfoFile = Helper.ParseBoolean(node, "generateAssemblyInfoFile", false); 438 m_GenerateAssemblyInfoFile = Helper.ParseBoolean(node, "generateAssemblyInfoFile", false);
439 439
440 if(m_AssemblyName == null || m_AssemblyName.Length < 1) 440 if(m_AssemblyName == null || m_AssemblyName.Length < 1)
441 { 441 {
442 m_AssemblyName = m_Name; 442 m_AssemblyName = m_Name;
443 } 443 }
444 444
445 if(m_RootNamespace == null || m_RootNamespace.Length < 1) 445 if(m_RootNamespace == null || m_RootNamespace.Length < 1)
446 { 446 {
447 m_RootNamespace = m_Name; 447 m_RootNamespace = m_Name;
448 } 448 }
449 449
450 m_FullPath = m_Path; 450 m_FullPath = m_Path;
451 try 451 try
452 { 452 {
453 m_FullPath = Helper.ResolvePath(m_FullPath); 453 m_FullPath = Helper.ResolvePath(m_FullPath);
454 } 454 }
455 catch 455 catch
456 { 456 {
457 throw new WarningException("Could not resolve Solution path: {0}", m_Path); 457 throw new WarningException("Could not resolve Solution path: {0}", m_Path);
458 } 458 }
459 459
460 Kernel.Instance.CurrentWorkingDirectory.Push(); 460 Kernel.Instance.CurrentWorkingDirectory.Push();
461 try 461 try
462 { 462 {
463 Helper.SetCurrentDir(m_FullPath); 463 Helper.SetCurrentDir(m_FullPath);
464 464
465 if( node == null ) 465 if( node == null )
466 { 466 {
467 throw new ArgumentNullException("node"); 467 throw new ArgumentNullException("node");
468 } 468 }
469 469
470 foreach(XmlNode child in node.ChildNodes) 470 foreach(XmlNode child in node.ChildNodes)
471 { 471 {
472 IDataNode dataNode = Kernel.Instance.ParseNode(child, this); 472 IDataNode dataNode = Kernel.Instance.ParseNode(child, this);
473 if(dataNode is ConfigurationNode) 473 if(dataNode is ConfigurationNode)
474 { 474 {
475 HandleConfiguration((ConfigurationNode)dataNode); 475 HandleConfiguration((ConfigurationNode)dataNode);
476 } 476 }
477 else if(dataNode is ReferencePathNode) 477 else if(dataNode is ReferencePathNode)
478 { 478 {
479 m_ReferencePaths.Add(dataNode); 479 m_ReferencePaths.Add(dataNode);
480 } 480 }
481 else if(dataNode is ReferenceNode) 481 else if(dataNode is ReferenceNode)
482 { 482 {
483 m_References.Add(dataNode); 483 m_References.Add(dataNode);
484 } 484 }
485 else if(dataNode is FilesNode) 485 else if(dataNode is FilesNode)
486 { 486 {
487 m_Files = (FilesNode)dataNode; 487 m_Files = (FilesNode)dataNode;
488 } 488 }
489 } 489 }
490 } 490 }
491 finally 491 finally
492 { 492 {
493 Kernel.Instance.CurrentWorkingDirectory.Pop(); 493 Kernel.Instance.CurrentWorkingDirectory.Pop();
494 } 494 }
495 } 495 }
496 496
497 497
498 #endregion 498 #endregion
499 499
500 #region IComparable Members 500 #region IComparable Members
501 501
502 public int CompareTo(object obj) 502 public int CompareTo(object obj)
503 { 503 {
504 ProjectNode that = (ProjectNode)obj; 504 ProjectNode that = (ProjectNode)obj;
505 return this.m_Name.CompareTo(that.m_Name); 505 return this.m_Name.CompareTo(that.m_Name);
506 } 506 }
507 507
508 #endregion 508 #endregion
509 } 509 }
510} 510}
diff --git a/Prebuild/src/Core/Nodes/ReferenceNode.cs b/Prebuild/src/Core/Nodes/ReferenceNode.cs
index a2880c0..4b8262e 100644
--- a/Prebuild/src/Core/Nodes/ReferenceNode.cs
+++ b/Prebuild/src/Core/Nodes/ReferenceNode.cs
@@ -1,153 +1,153 @@
1#region BSD License 1#region BSD License
2/* 2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com) 3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4 4
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/ 23*/
24#endregion 24#endregion
25 25
26#region CVS Information 26#region CVS Information
27/* 27/*
28 * $Source$ 28 * $Source$
29 * $Author: jendave $ 29 * $Author: jendave $
30 * $Date: 2006-07-25 18:56:49 +0200 (ti, 25 jul 2006) $ 30 * $Date: 2006-07-25 18:56:49 +0200 (ti, 25 jul 2006) $
31 * $Revision: 132 $ 31 * $Revision: 132 $
32 */ 32 */
33#endregion 33#endregion
34 34
35using System; 35using System;
36using System.Xml; 36using System.Xml;
37 37
38using Prebuild.Core.Attributes; 38using Prebuild.Core.Attributes;
39using Prebuild.Core.Interfaces; 39using Prebuild.Core.Interfaces;
40using Prebuild.Core.Utilities; 40using Prebuild.Core.Utilities;
41 41
42namespace Prebuild.Core.Nodes 42namespace Prebuild.Core.Nodes
43{ 43{
44 /// <summary> 44 /// <summary>
45 /// 45 ///
46 /// </summary> 46 /// </summary>
47 [DataNode("Reference")] 47 [DataNode("Reference")]
48 public class ReferenceNode : DataNode, IComparable 48 public class ReferenceNode : DataNode, IComparable
49 { 49 {
50 #region Fields 50 #region Fields
51 51
52 private string m_Name = "unknown"; 52 private string m_Name = "unknown";
53 private string m_Path; 53 private string m_Path;
54 private string m_LocalCopy; 54 private string m_LocalCopy;
55 private string m_Version; 55 private string m_Version;
56 56
57 #endregion 57 #endregion
58 58
59 #region Properties 59 #region Properties
60 60
61 /// <summary> 61 /// <summary>
62 /// Gets the name. 62 /// Gets the name.
63 /// </summary> 63 /// </summary>
64 /// <value>The name.</value> 64 /// <value>The name.</value>
65 public string Name 65 public string Name
66 { 66 {
67 get 67 get
68 { 68 {
69 return m_Name; 69 return m_Name;
70 } 70 }
71 } 71 }
72 72
73 /// <summary> 73 /// <summary>
74 /// Gets the path. 74 /// Gets the path.
75 /// </summary> 75 /// </summary>
76 /// <value>The path.</value> 76 /// <value>The path.</value>
77 public string Path 77 public string Path
78 { 78 {
79 get 79 get
80 { 80 {
81 return m_Path; 81 return m_Path;
82 } 82 }
83 } 83 }
84 84
85 /// <summary> 85 /// <summary>
86 /// Gets a value indicating whether [local copy specified]. 86 /// Gets a value indicating whether [local copy specified].
87 /// </summary> 87 /// </summary>
88 /// <value><c>true</c> if [local copy specified]; otherwise, <c>false</c>.</value> 88 /// <value><c>true</c> if [local copy specified]; otherwise, <c>false</c>.</value>
89 public bool LocalCopySpecified 89 public bool LocalCopySpecified
90 { 90 {
91 get 91 get
92 { 92 {
93 return ( m_LocalCopy != null && m_LocalCopy.Length == 0); 93 return ( m_LocalCopy != null && m_LocalCopy.Length == 0);
94 } 94 }
95 } 95 }
96 96
97 /// <summary> 97 /// <summary>
98 /// Gets a value indicating whether [local copy]. 98 /// Gets a value indicating whether [local copy].
99 /// </summary> 99 /// </summary>
100 /// <value><c>true</c> if [local copy]; otherwise, <c>false</c>.</value> 100 /// <value><c>true</c> if [local copy]; otherwise, <c>false</c>.</value>
101 public bool LocalCopy 101 public bool LocalCopy
102 { 102 {
103 get 103 get
104 { 104 {
105 if( m_LocalCopy == null) 105 if( m_LocalCopy == null)
106 { 106 {
107 return false; 107 return false;
108 } 108 }
109 return bool.Parse(m_LocalCopy); 109 return bool.Parse(m_LocalCopy);
110 } 110 }
111 } 111 }
112 112
113 /// <summary> 113 /// <summary>
114 /// Gets the version. 114 /// Gets the version.
115 /// </summary> 115 /// </summary>
116 /// <value>The version.</value> 116 /// <value>The version.</value>
117 public string Version 117 public string Version
118 { 118 {
119 get 119 get
120 { 120 {
121 return m_Version; 121 return m_Version;
122 } 122 }
123 } 123 }
124 124
125 #endregion 125 #endregion
126 126
127 #region Public Methods 127 #region Public Methods
128 128
129 /// <summary> 129 /// <summary>
130 /// Parses the specified node. 130 /// Parses the specified node.
131 /// </summary> 131 /// </summary>
132 /// <param name="node">The node.</param> 132 /// <param name="node">The node.</param>
133 public override void Parse(XmlNode node) 133 public override void Parse(XmlNode node)
134 { 134 {
135 m_Name = Helper.AttributeValue(node, "name", m_Name); 135 m_Name = Helper.AttributeValue(node, "name", m_Name);
136 m_Path = Helper.AttributeValue(node, "path", m_Path); 136 m_Path = Helper.AttributeValue(node, "path", m_Path);
137 m_LocalCopy = Helper.AttributeValue(node, "localCopy", m_LocalCopy); 137 m_LocalCopy = Helper.AttributeValue(node, "localCopy", m_LocalCopy);
138 m_Version = Helper.AttributeValue(node, "version", m_Version); 138 m_Version = Helper.AttributeValue(node, "version", m_Version);
139 } 139 }
140 140
141 #endregion 141 #endregion
142 142
143 #region IComparable Members 143 #region IComparable Members
144 144
145 public int CompareTo(object obj) 145 public int CompareTo(object obj)
146 { 146 {
147 ReferenceNode that = (ReferenceNode)obj; 147 ReferenceNode that = (ReferenceNode)obj;
148 return this.m_Name.CompareTo(that.m_Name); 148 return this.m_Name.CompareTo(that.m_Name);
149 } 149 }
150 150
151 #endregion 151 #endregion
152 } 152 }
153} 153}
diff --git a/Prebuild/src/Core/Nodes/ReferencePathNode.cs b/Prebuild/src/Core/Nodes/ReferencePathNode.cs
index 0563c1b..4c981e7 100644
--- a/Prebuild/src/Core/Nodes/ReferencePathNode.cs
+++ b/Prebuild/src/Core/Nodes/ReferencePathNode.cs
@@ -1,108 +1,108 @@
1#region BSD License 1#region BSD License
2/* 2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com) 3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4 4
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/ 23*/
24#endregion 24#endregion
25 25
26#region CVS Information 26#region CVS Information
27/* 27/*
28 * $Source$ 28 * $Source$
29 * $Author: jendave $ 29 * $Author: jendave $
30 * $Date: 2006-01-28 01:49:58 +0100 (lö, 28 jan 2006) $ 30 * $Date: 2006-01-28 01:49:58 +0100 (lö, 28 jan 2006) $
31 * $Revision: 71 $ 31 * $Revision: 71 $
32 */ 32 */
33#endregion 33#endregion
34 34
35using System; 35using System;
36using System.Collections; 36using System.Collections;
37using System.Collections.Specialized; 37using System.Collections.Specialized;
38using System.Xml; 38using System.Xml;
39 39
40using Prebuild.Core.Attributes; 40using Prebuild.Core.Attributes;
41using Prebuild.Core.Interfaces; 41using Prebuild.Core.Interfaces;
42using Prebuild.Core.Utilities; 42using Prebuild.Core.Utilities;
43 43
44namespace Prebuild.Core.Nodes 44namespace Prebuild.Core.Nodes
45{ 45{
46 /// <summary> 46 /// <summary>
47 /// 47 ///
48 /// </summary> 48 /// </summary>
49 [DataNode("ReferencePath")] 49 [DataNode("ReferencePath")]
50 public class ReferencePathNode : DataNode, IComparable 50 public class ReferencePathNode : DataNode, IComparable
51 { 51 {
52 #region Fields 52 #region Fields
53 53
54 private string m_Path; 54 private string m_Path;
55 55
56 #endregion 56 #endregion
57 57
58 #region Properties 58 #region Properties
59 59
60 /// <summary> 60 /// <summary>
61 /// Gets the path. 61 /// Gets the path.
62 /// </summary> 62 /// </summary>
63 /// <value>The path.</value> 63 /// <value>The path.</value>
64 public string Path 64 public string Path
65 { 65 {
66 get 66 get
67 { 67 {
68 return m_Path; 68 return m_Path;
69 } 69 }
70 } 70 }
71 71
72 #endregion 72 #endregion
73 73
74 #region Public Methods 74 #region Public Methods
75 75
76 /// <summary> 76 /// <summary>
77 /// Parses the specified node. 77 /// Parses the specified node.
78 /// </summary> 78 /// </summary>
79 /// <param name="node">The node.</param> 79 /// <param name="node">The node.</param>
80 public override void Parse(XmlNode node) 80 public override void Parse(XmlNode node)
81 { 81 {
82 if( node == null ) 82 if( node == null )
83 { 83 {
84 throw new ArgumentNullException("node"); 84 throw new ArgumentNullException("node");
85 } 85 }
86 86
87 m_Path = Helper.InterpolateForEnvironmentVariables(node.InnerText); 87 m_Path = Helper.InterpolateForEnvironmentVariables(node.InnerText);
88 if(m_Path == null) 88 if(m_Path == null)
89 { 89 {
90 m_Path = ""; 90 m_Path = "";
91 } 91 }
92 92
93 m_Path = m_Path.Trim(); 93 m_Path = m_Path.Trim();
94 } 94 }
95 95
96 #endregion 96 #endregion
97 97
98 #region IComparable Members 98 #region IComparable Members
99 99
100 public int CompareTo(object obj) 100 public int CompareTo(object obj)
101 { 101 {
102 ReferencePathNode that = (ReferencePathNode)obj; 102 ReferencePathNode that = (ReferencePathNode)obj;
103 return this.m_Path.CompareTo(that.m_Path); 103 return this.m_Path.CompareTo(that.m_Path);
104 } 104 }
105 105
106 #endregion 106 #endregion
107 } 107 }
108} 108}
diff --git a/Prebuild/src/Core/Nodes/SolutionNode.cs b/Prebuild/src/Core/Nodes/SolutionNode.cs
index c777fa4..bbf867e 100644
--- a/Prebuild/src/Core/Nodes/SolutionNode.cs
+++ b/Prebuild/src/Core/Nodes/SolutionNode.cs
@@ -1,288 +1,288 @@
1#region BSD License 1#region BSD License
2/* 2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com) 3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4 4
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/ 23*/
24#endregion 24#endregion
25 25
26#region CVS Information 26#region CVS Information
27/* 27/*
28 * $Source$ 28 * $Source$
29 * $Author: jendave $ 29 * $Author: jendave $
30 * $Date: 2006-02-28 17:15:42 +0100 (ti, 28 feb 2006) $ 30 * $Date: 2006-02-28 17:15:42 +0100 (ti, 28 feb 2006) $
31 * $Revision: 92 $ 31 * $Revision: 92 $
32 */ 32 */
33#endregion 33#endregion
34 34
35using System; 35using System;
36using System.Collections; 36using System.Collections;
37using System.Diagnostics; 37using System.Diagnostics;
38using System.IO; 38using System.IO;
39using System.Xml; 39using System.Xml;
40 40
41using Prebuild.Core.Attributes; 41using Prebuild.Core.Attributes;
42using Prebuild.Core.Interfaces; 42using Prebuild.Core.Interfaces;
43using Prebuild.Core.Utilities; 43using Prebuild.Core.Utilities;
44 44
45namespace Prebuild.Core.Nodes 45namespace Prebuild.Core.Nodes
46{ 46{
47 /// <summary> 47 /// <summary>
48 /// 48 ///
49 /// </summary> 49 /// </summary>
50 [DataNode("Solution")] 50 [DataNode("Solution")]
51 public class SolutionNode : DataNode 51 public class SolutionNode : DataNode
52 { 52 {
53 #region Fields 53 #region Fields
54 54
55 private string m_Name = "unknown"; 55 private string m_Name = "unknown";
56 private string m_Path = ""; 56 private string m_Path = "";
57 private string m_FullPath = ""; 57 private string m_FullPath = "";
58 private string m_ActiveConfig = "Debug"; 58 private string m_ActiveConfig = "Debug";
59 59
60 private OptionsNode m_Options; 60 private OptionsNode m_Options;
61 private FilesNode m_Files; 61 private FilesNode m_Files;
62 private Hashtable m_Configurations; 62 private Hashtable m_Configurations;
63 private Hashtable m_Projects; 63 private Hashtable m_Projects;
64 private ArrayList m_ProjectsOrder; 64 private ArrayList m_ProjectsOrder;
65 65
66 #endregion 66 #endregion
67 67
68 #region Constructors 68 #region Constructors
69 69
70 /// <summary> 70 /// <summary>
71 /// Initializes a new instance of the <see cref="SolutionNode"/> class. 71 /// Initializes a new instance of the <see cref="SolutionNode"/> class.
72 /// </summary> 72 /// </summary>
73 public SolutionNode() 73 public SolutionNode()
74 { 74 {
75 m_Configurations = new Hashtable(); 75 m_Configurations = new Hashtable();
76 m_Projects = new Hashtable(); 76 m_Projects = new Hashtable();
77 m_ProjectsOrder = new ArrayList(); 77 m_ProjectsOrder = new ArrayList();
78 } 78 }
79 79
80 #endregion 80 #endregion
81 81
82 #region Properties 82 #region Properties
83 83
84 /// <summary> 84 /// <summary>
85 /// Gets or sets the active config. 85 /// Gets or sets the active config.
86 /// </summary> 86 /// </summary>
87 /// <value>The active config.</value> 87 /// <value>The active config.</value>
88 public string ActiveConfig 88 public string ActiveConfig
89 { 89 {
90 get 90 get
91 { 91 {
92 return m_ActiveConfig; 92 return m_ActiveConfig;
93 } 93 }
94 set 94 set
95 { 95 {
96 m_ActiveConfig = value; 96 m_ActiveConfig = value;
97 } 97 }
98 } 98 }
99 99
100 /// <summary> 100 /// <summary>
101 /// Gets the name. 101 /// Gets the name.
102 /// </summary> 102 /// </summary>
103 /// <value>The name.</value> 103 /// <value>The name.</value>
104 public string Name 104 public string Name
105 { 105 {
106 get 106 get
107 { 107 {
108 return m_Name; 108 return m_Name;
109 } 109 }
110 } 110 }
111 111
112 /// <summary> 112 /// <summary>
113 /// Gets the path. 113 /// Gets the path.
114 /// </summary> 114 /// </summary>
115 /// <value>The path.</value> 115 /// <value>The path.</value>
116 public string Path 116 public string Path
117 { 117 {
118 get 118 get
119 { 119 {
120 return m_Path; 120 return m_Path;
121 } 121 }
122 } 122 }
123 123
124 /// <summary> 124 /// <summary>
125 /// Gets the full path. 125 /// Gets the full path.
126 /// </summary> 126 /// </summary>
127 /// <value>The full path.</value> 127 /// <value>The full path.</value>
128 public string FullPath 128 public string FullPath
129 { 129 {
130 get 130 get
131 { 131 {
132 return m_FullPath; 132 return m_FullPath;
133 } 133 }
134 } 134 }
135 135
136 /// <summary> 136 /// <summary>
137 /// Gets the options. 137 /// Gets the options.
138 /// </summary> 138 /// </summary>
139 /// <value>The options.</value> 139 /// <value>The options.</value>
140 public OptionsNode Options 140 public OptionsNode Options
141 { 141 {
142 get 142 get
143 { 143 {
144 return m_Options; 144 return m_Options;
145 } 145 }
146 } 146 }
147 147
148 /// <summary> 148 /// <summary>
149 /// Gets the files. 149 /// Gets the files.
150 /// </summary> 150 /// </summary>
151 /// <value>The files.</value> 151 /// <value>The files.</value>
152 public FilesNode Files 152 public FilesNode Files
153 { 153 {
154 get 154 get
155 { 155 {
156 return m_Files; 156 return m_Files;
157 } 157 }
158 } 158 }
159 159
160 /// <summary> 160 /// <summary>
161 /// Gets the configurations. 161 /// Gets the configurations.
162 /// </summary> 162 /// </summary>
163 /// <value>The configurations.</value> 163 /// <value>The configurations.</value>
164 public ICollection Configurations 164 public ICollection Configurations
165 { 165 {
166 get 166 get
167 { 167 {
168 ArrayList tmp = new ArrayList(ConfigurationsTable.Values); 168 ArrayList tmp = new ArrayList(ConfigurationsTable.Values);
169 tmp.Sort(); 169 tmp.Sort();
170 return tmp; 170 return tmp;
171 } 171 }
172 } 172 }
173 173
174 /// <summary> 174 /// <summary>
175 /// Gets the configurations table. 175 /// Gets the configurations table.
176 /// </summary> 176 /// </summary>
177 /// <value>The configurations table.</value> 177 /// <value>The configurations table.</value>
178 public Hashtable ConfigurationsTable 178 public Hashtable ConfigurationsTable
179 { 179 {
180 get 180 get
181 { 181 {
182 return m_Configurations; 182 return m_Configurations;
183 } 183 }
184 } 184 }
185 185
186 /// <summary> 186 /// <summary>
187 /// Gets the projects. 187 /// Gets the projects.
188 /// </summary> 188 /// </summary>
189 /// <value>The projects.</value> 189 /// <value>The projects.</value>
190 public ICollection Projects 190 public ICollection Projects
191 { 191 {
192 get 192 get
193 { 193 {
194 ArrayList tmp = new ArrayList(m_Projects.Values); 194 ArrayList tmp = new ArrayList(m_Projects.Values);
195 tmp.Sort(); 195 tmp.Sort();
196 return tmp; 196 return tmp;
197 } 197 }
198 } 198 }
199 199
200 /// <summary> 200 /// <summary>
201 /// Gets the projects table. 201 /// Gets the projects table.
202 /// </summary> 202 /// </summary>
203 /// <value>The projects table.</value> 203 /// <value>The projects table.</value>
204 public Hashtable ProjectsTable 204 public Hashtable ProjectsTable
205 { 205 {
206 get 206 get
207 { 207 {
208 return m_Projects; 208 return m_Projects;
209 } 209 }
210 } 210 }
211 211
212 /// <summary> 212 /// <summary>
213 /// Gets the projects table. 213 /// Gets the projects table.
214 /// </summary> 214 /// </summary>
215 /// <value>The projects table.</value> 215 /// <value>The projects table.</value>
216 public ArrayList ProjectsTableOrder 216 public ArrayList ProjectsTableOrder
217 { 217 {
218 get 218 get
219 { 219 {
220 return m_ProjectsOrder; 220 return m_ProjectsOrder;
221 } 221 }
222 } 222 }
223 223
224 #endregion 224 #endregion
225 225
226 #region Public Methods 226 #region Public Methods
227 227
228 /// <summary> 228 /// <summary>
229 /// Parses the specified node. 229 /// Parses the specified node.
230 /// </summary> 230 /// </summary>
231 /// <param name="node">The node.</param> 231 /// <param name="node">The node.</param>
232 public override void Parse(XmlNode node) 232 public override void Parse(XmlNode node)
233 { 233 {
234 m_Name = Helper.AttributeValue(node, "name", m_Name); 234 m_Name = Helper.AttributeValue(node, "name", m_Name);
235 m_ActiveConfig = Helper.AttributeValue(node, "activeConfig", m_ActiveConfig); 235 m_ActiveConfig = Helper.AttributeValue(node, "activeConfig", m_ActiveConfig);
236 m_Path = Helper.AttributeValue(node, "path", m_Path); 236 m_Path = Helper.AttributeValue(node, "path", m_Path);
237 237
238 m_FullPath = m_Path; 238 m_FullPath = m_Path;
239 try 239 try
240 { 240 {
241 m_FullPath = Helper.ResolvePath(m_FullPath); 241 m_FullPath = Helper.ResolvePath(m_FullPath);
242 } 242 }
243 catch 243 catch
244 { 244 {
245 throw new WarningException("Could not resolve solution path: {0}", m_Path); 245 throw new WarningException("Could not resolve solution path: {0}", m_Path);
246 } 246 }
247 247
248 Kernel.Instance.CurrentWorkingDirectory.Push(); 248 Kernel.Instance.CurrentWorkingDirectory.Push();
249 try 249 try
250 { 250 {
251 Helper.SetCurrentDir(m_FullPath); 251 Helper.SetCurrentDir(m_FullPath);
252 252
253 if( node == null ) 253 if( node == null )
254 { 254 {
255 throw new ArgumentNullException("node"); 255 throw new ArgumentNullException("node");
256 } 256 }
257 257
258 foreach(XmlNode child in node.ChildNodes) 258 foreach(XmlNode child in node.ChildNodes)
259 { 259 {
260 IDataNode dataNode = Kernel.Instance.ParseNode(child, this); 260 IDataNode dataNode = Kernel.Instance.ParseNode(child, this);
261 if(dataNode is OptionsNode) 261 if(dataNode is OptionsNode)
262 { 262 {
263 m_Options = (OptionsNode)dataNode; 263 m_Options = (OptionsNode)dataNode;
264 } 264 }
265 else if(dataNode is FilesNode) 265 else if(dataNode is FilesNode)
266 { 266 {
267 m_Files = (FilesNode)dataNode; 267 m_Files = (FilesNode)dataNode;
268 } 268 }
269 else if(dataNode is ConfigurationNode) 269 else if(dataNode is ConfigurationNode)
270 { 270 {
271 m_Configurations[((ConfigurationNode)dataNode).Name] = dataNode; 271 m_Configurations[((ConfigurationNode)dataNode).Name] = dataNode;
272 } 272 }
273 else if(dataNode is ProjectNode) 273 else if(dataNode is ProjectNode)
274 { 274 {
275 m_Projects[((ProjectNode)dataNode).Name] = dataNode; 275 m_Projects[((ProjectNode)dataNode).Name] = dataNode;
276 m_ProjectsOrder.Add(dataNode); 276 m_ProjectsOrder.Add(dataNode);
277 } 277 }
278 } 278 }
279 } 279 }
280 finally 280 finally
281 { 281 {
282 Kernel.Instance.CurrentWorkingDirectory.Pop(); 282 Kernel.Instance.CurrentWorkingDirectory.Pop();
283 } 283 }
284 } 284 }
285 285
286 #endregion 286 #endregion
287 } 287 }
288} 288}