aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Prebuild/src/Core/Nodes
diff options
context:
space:
mode:
Diffstat (limited to 'Prebuild/src/Core/Nodes')
-rw-r--r--Prebuild/src/Core/Nodes/AuthorNode.cs9
-rw-r--r--Prebuild/src/Core/Nodes/ConfigurationNode.cs9
-rw-r--r--Prebuild/src/Core/Nodes/DataNode.cs59
-rw-r--r--Prebuild/src/Core/Nodes/DatabaseProjectNode.cs94
-rw-r--r--Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs63
-rw-r--r--Prebuild/src/Core/Nodes/DescriptionNode.cs9
-rw-r--r--Prebuild/src/Core/Nodes/ExcludeNode.cs9
-rw-r--r--Prebuild/src/Core/Nodes/FileNode.cs42
-rw-r--r--Prebuild/src/Core/Nodes/FilesNode.cs14
-rw-r--r--Prebuild/src/Core/Nodes/MatchNode.cs51
-rw-r--r--Prebuild/src/Core/Nodes/OptionsNode.cs11
-rw-r--r--Prebuild/src/Core/Nodes/ProcessNode.cs9
-rw-r--r--Prebuild/src/Core/Nodes/ProjectNode.cs169
-rw-r--r--Prebuild/src/Core/Nodes/ReferenceNode.cs9
-rw-r--r--Prebuild/src/Core/Nodes/ReferencePathNode.cs9
-rw-r--r--Prebuild/src/Core/Nodes/SolutionNode.cs120
16 files changed, 432 insertions, 254 deletions
diff --git a/Prebuild/src/Core/Nodes/AuthorNode.cs b/Prebuild/src/Core/Nodes/AuthorNode.cs
index 03ea934..20e72c0 100644
--- a/Prebuild/src/Core/Nodes/AuthorNode.cs
+++ b/Prebuild/src/Core/Nodes/AuthorNode.cs
@@ -23,15 +23,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
23*/ 23*/
24#endregion 24#endregion
25 25
26#region CVS Information
27/*
28 * $Source $
29 * $Author: $
30 * $Date: $
31 * $Revision: $
32 */
33#endregion
34
35using System; 26using System;
36using System.Collections; 27using System.Collections;
37using System.Collections.Specialized; 28using System.Collections.Specialized;
diff --git a/Prebuild/src/Core/Nodes/ConfigurationNode.cs b/Prebuild/src/Core/Nodes/ConfigurationNode.cs
index 828bff6..67d78d5 100644
--- a/Prebuild/src/Core/Nodes/ConfigurationNode.cs
+++ b/Prebuild/src/Core/Nodes/ConfigurationNode.cs
@@ -23,15 +23,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
23*/ 23*/
24#endregion 24#endregion
25 25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2006-01-28 09:49:58 +0900 (Sat, 28 Jan 2006) $
31 * $Revision: 71 $
32 */
33#endregion
34
35using System; 26using System;
36using System.Xml; 27using System.Xml;
37 28
diff --git a/Prebuild/src/Core/Nodes/DataNode.cs b/Prebuild/src/Core/Nodes/DataNode.cs
index 60ed122..763e6c3 100644
--- a/Prebuild/src/Core/Nodes/DataNode.cs
+++ b/Prebuild/src/Core/Nodes/DataNode.cs
@@ -23,31 +23,24 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
23*/ 23*/
24#endregion 24#endregion
25 25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2006-01-28 09:49:58 +0900 (Sat, 28 Jan 2006) $
31 * $Revision: 71 $
32 */
33#endregion
34
35using System; 26using System;
36using System.Xml; 27using System.Xml;
37 28
38using Prebuild.Core.Attributes; 29using Prebuild.Core.Attributes;
39using Prebuild.Core.Interfaces; 30using Prebuild.Core.Interfaces;
31using System.IO;
40 32
41namespace Prebuild.Core.Nodes 33namespace Prebuild.Core.Nodes
42{ 34{
43 /// <summary> 35 /// <summary>
44 /// 36 ///
45 /// </summary> 37 /// </summary>
46 public class DataNode : IDataNode 38 public abstract class DataNode : IDataNode
47 { 39 {
48 #region Fields 40 #region Fields
49 41
50 private IDataNode parent; 42 private IDataNode parent;
43 string[] m_WebTypes = new string[] { "aspx", "ascx", "master", "ashx", "asmx" };
51 44
52 #endregion 45 #endregion
53 46
@@ -68,7 +61,10 @@ namespace Prebuild.Core.Nodes
68 parent = value; 61 parent = value;
69 } 62 }
70 } 63 }
71 64 public string[] WebTypes
65 {
66 get { return m_WebTypes; }
67 }
72 /// <summary> 68 /// <summary>
73 /// Parses the specified node. 69 /// Parses the specified node.
74 /// </summary> 70 /// </summary>
@@ -76,7 +72,46 @@ namespace Prebuild.Core.Nodes
76 public virtual void Parse(XmlNode node) 72 public virtual void Parse(XmlNode node)
77 { 73 {
78 } 74 }
79 75 public BuildAction GetBuildActionByFileName(string fileName)
76 {
77 string extension = Path.GetExtension(fileName).ToLower();
78 foreach (string type in WebTypes)
79 {
80 if (extension == type)
81 return BuildAction.Content;
82 }
83 return BuildAction.Compile;
84 }
85 /// <summary>
86 /// Parses the file type to figure out what type it is
87 /// </summary>
88 /// <returns></returns>
89 public SubType GetSubTypeByFileName(string fileName)
90 {
91 string extension = System.IO.Path.GetExtension(fileName).ToLower();
92 string designer = String.Format(".designer{0}", extension);
93 string path = fileName.ToLower();
94 if (extension == ".resx")
95 {
96 return SubType.Designer;
97 }
98 else if (path.EndsWith(".settings"))
99 {
100 return SubType.Settings;
101 }
102 else
103 {
104
105 foreach (string type in WebTypes)
106 {
107 if (path.EndsWith(string.Format("{0}{1}", type, extension)))
108 {
109 return SubType.CodeBehind;
110 }
111 }
112 }
113 return SubType.Code;
114 }
80 #endregion 115 #endregion
81 } 116 }
82} 117}
diff --git a/Prebuild/src/Core/Nodes/DatabaseProjectNode.cs b/Prebuild/src/Core/Nodes/DatabaseProjectNode.cs
new file mode 100644
index 0000000..8696a79
--- /dev/null
+++ b/Prebuild/src/Core/Nodes/DatabaseProjectNode.cs
@@ -0,0 +1,94 @@
1using System;
2using System.Collections;
3using System.Collections.Generic;
4using System.Text;
5using System.Xml;
6
7using Prebuild.Core.Attributes;
8using Prebuild.Core.Interfaces;
9using Prebuild.Core.Utilities;
10
11namespace Prebuild.Core.Nodes
12{
13 [DataNode("DatabaseProject")]
14 public class DatabaseProjectNode : DataNode
15 {
16 string name;
17 string path;
18 string fullpath;
19 Guid guid = Guid.NewGuid();
20 readonly List<AuthorNode> authors = new List<AuthorNode>();
21 readonly List<DatabaseReferenceNode> references = new List<DatabaseReferenceNode>();
22
23 public Guid Guid
24 {
25 get { return guid; }
26 }
27
28 public string Name
29 {
30 get { return name; }
31 }
32
33 public string Path
34 {
35 get { return path; }
36 }
37
38 public string FullPath
39 {
40 get { return fullpath; }
41 }
42
43 public IEnumerable<DatabaseReferenceNode> References
44 {
45 get { return references; }
46 }
47
48 public override void Parse(XmlNode node)
49 {
50 name = Helper.AttributeValue(node, "name", name);
51 path = Helper.AttributeValue(node, "path", name);
52
53 try
54 {
55 fullpath = Helper.ResolvePath(path);
56 }
57 catch
58 {
59 throw new WarningException("Could not resolve Solution path: {0}", path);
60 }
61
62 Kernel.Instance.CurrentWorkingDirectory.Push();
63
64 try
65 {
66 Helper.SetCurrentDir(fullpath);
67
68 if (node == null)
69 {
70 throw new ArgumentNullException("node");
71 }
72
73 foreach (XmlNode child in node.ChildNodes)
74 {
75 IDataNode dataNode = Kernel.Instance.ParseNode(child, this);
76
77 if (dataNode == null)
78 continue;
79
80 if (dataNode is AuthorNode)
81 authors.Add((AuthorNode)dataNode);
82 else if (dataNode is DatabaseReferenceNode)
83 references.Add((DatabaseReferenceNode)dataNode);
84 }
85 }
86 finally
87 {
88 Kernel.Instance.CurrentWorkingDirectory.Pop();
89 }
90
91 base.Parse(node);
92 }
93 }
94}
diff --git a/Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs b/Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs
new file mode 100644
index 0000000..97c3964
--- /dev/null
+++ b/Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs
@@ -0,0 +1,63 @@
1using System;
2using Prebuild.Core.Attributes;
3using Prebuild.Core.Utilities;
4
5namespace Prebuild.Core.Nodes
6{
7 [DataNode("DatabaseReference")]
8 public class DatabaseReferenceNode : DataNode
9 {
10 string name;
11 Guid providerId;
12 string connectionString;
13
14 public string Name
15 {
16 get { return name; }
17 }
18
19 public Guid ProviderId
20 {
21 get { return providerId; }
22 }
23
24 public string ConnectionString
25 {
26 get { return connectionString; }
27 }
28
29 public override void Parse(System.Xml.XmlNode node)
30 {
31 name = Helper.AttributeValue(node, "name", name);
32
33 string providerName = Helper.AttributeValue(node, "providerName", string.Empty);
34 if (providerName != null)
35 {
36 switch (providerName)
37 {
38 // digitaljeebus: pulled from HKLM\SOFTWARE\Microsoft\VisualStudio\9.0\DataProviders\*
39 // Not sure if these will help other operating systems, or if there's a better way.
40 case "Microsoft.SqlServerCe.Client.3.5":
41 providerId = new Guid("7C602B5B-ACCB-4acd-9DC0-CA66388C1533"); break;
42 case "System.Data.OleDb":
43 providerId = new Guid("7F041D59-D76A-44ed-9AA2-FBF6B0548B80"); break;
44 case "System.Data.OracleClient":
45 providerId = new Guid("8F5C5018-AE09-42cf-B2CC-2CCCC7CFC2BB"); break;
46 case "System.Data.SqlClient":
47 providerId = new Guid("91510608-8809-4020-8897-FBA057E22D54"); break;
48 case "System.Data.Odbc":
49 providerId = new Guid("C3D4F4CE-2C48-4381-B4D6-34FA50C51C86"); break;
50
51 default:
52 throw new ArgumentOutOfRangeException("providerName", providerName, "Could not provider name to an id.");
53 }
54 }
55 else
56 providerId = new Guid(Helper.AttributeValue(node, "providerId", Guid.Empty.ToString("B")));
57
58 connectionString = Helper.AttributeValue(node, "connectionString", connectionString);
59
60 base.Parse(node);
61 }
62 }
63}
diff --git a/Prebuild/src/Core/Nodes/DescriptionNode.cs b/Prebuild/src/Core/Nodes/DescriptionNode.cs
index cff7afc..353a5ae 100644
--- a/Prebuild/src/Core/Nodes/DescriptionNode.cs
+++ b/Prebuild/src/Core/Nodes/DescriptionNode.cs
@@ -23,15 +23,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
23*/ 23*/
24#endregion 24#endregion
25 25
26#region CVS Information
27/*
28 * $Source $
29 * $Author: $
30 * $Date: $
31 * $Revision: $
32 */
33#endregion
34
35using System; 26using System;
36using System.Collections; 27using System.Collections;
37using System.Collections.Specialized; 28using System.Collections.Specialized;
diff --git a/Prebuild/src/Core/Nodes/ExcludeNode.cs b/Prebuild/src/Core/Nodes/ExcludeNode.cs
index afc869d..7f04cba 100644
--- a/Prebuild/src/Core/Nodes/ExcludeNode.cs
+++ b/Prebuild/src/Core/Nodes/ExcludeNode.cs
@@ -23,15 +23,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
23*/ 23*/
24#endregion 24#endregion
25 25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: borrillis $
30 * $Date: 2007-05-25 01:03:16 +0900 (Fri, 25 May 2007) $
31 * $Revision: 243 $
32 */
33#endregion
34
35using System; 26using System;
36using System.Xml; 27using System.Xml;
37 28
diff --git a/Prebuild/src/Core/Nodes/FileNode.cs b/Prebuild/src/Core/Nodes/FileNode.cs
index 083dba5..1520fcb 100644
--- a/Prebuild/src/Core/Nodes/FileNode.cs
+++ b/Prebuild/src/Core/Nodes/FileNode.cs
@@ -23,15 +23,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
23*/ 23*/
24#endregion 24#endregion
25 25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: borrillis $
30 * $Date: 2007-05-25 01:03:16 +0900 (Fri, 25 May 2007) $
31 * $Revision: 243 $
32 */
33#endregion
34
35using System; 26using System;
36using System.IO; 27using System.IO;
37using System.Xml; 28using System.Xml;
@@ -39,6 +30,7 @@ using System.Xml;
39using Prebuild.Core.Attributes; 30using Prebuild.Core.Attributes;
40using Prebuild.Core.Interfaces; 31using Prebuild.Core.Interfaces;
41using Prebuild.Core.Utilities; 32using Prebuild.Core.Utilities;
33using Prebuild.Core.Targets;
42 34
43namespace Prebuild.Core.Nodes 35namespace Prebuild.Core.Nodes
44{ 36{
@@ -93,7 +85,11 @@ namespace Prebuild.Core.Nodes
93 /// <summary> 85 /// <summary>
94 /// 86 ///
95 /// </summary> 87 /// </summary>
96 UserControl 88 UserControl,
89 /// <summary>
90 ///
91 /// </summary>
92 CodeBehind,
97 } 93 }
98 94
99 public enum CopyToOutput 95 public enum CopyToOutput
@@ -113,9 +109,9 @@ namespace Prebuild.Core.Nodes
113 109
114 private string m_Path; 110 private string m_Path;
115 private string m_ResourceName = ""; 111 private string m_ResourceName = "";
116 private BuildAction m_BuildAction = BuildAction.Compile; 112 private BuildAction? m_BuildAction;
117 private bool m_Valid; 113 private bool m_Valid;
118 private SubType m_SubType = SubType.Code; 114 private SubType? m_SubType;
119 private CopyToOutput m_CopyToOutput = CopyToOutput.Never; 115 private CopyToOutput m_CopyToOutput = CopyToOutput.Never;
120 private bool m_Link = false; 116 private bool m_Link = false;
121 private string m_LinkPath = string.Empty; 117 private string m_LinkPath = string.Empty;
@@ -155,7 +151,11 @@ namespace Prebuild.Core.Nodes
155 { 151 {
156 get 152 get
157 { 153 {
158 return m_BuildAction; 154 if (m_BuildAction != null)
155 return m_BuildAction.Value;
156 else
157 return GetBuildActionByFileName(this.Path);
158
159 } 159 }
160 } 160 }
161 161
@@ -189,7 +189,10 @@ namespace Prebuild.Core.Nodes
189 { 189 {
190 get 190 get
191 { 191 {
192 return m_SubType; 192 if (m_SubType != null)
193 return m_SubType.Value;
194 else
195 return GetSubTypeByFileName(this.Path);
193 } 196 }
194 } 197 }
195 198
@@ -227,10 +230,13 @@ namespace Prebuild.Core.Nodes
227 /// <param name="node"></param> 230 /// <param name="node"></param>
228 public override void Parse(XmlNode node) 231 public override void Parse(XmlNode node)
229 { 232 {
230 m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction), 233 string buildAction = Helper.AttributeValue(node, "buildAction", String.Empty);
231 Helper.AttributeValue(node, "buildAction", m_BuildAction.ToString())); 234 if (buildAction != string.Empty)
232 m_SubType = (SubType)Enum.Parse(typeof(SubType), 235 m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction), buildAction);
233 Helper.AttributeValue(node, "subType", m_SubType.ToString())); 236 string subType = Helper.AttributeValue(node, "subType", string.Empty);
237 if (subType != String.Empty)
238 m_SubType = (SubType)Enum.Parse(typeof(SubType), subType);
239
234 m_ResourceName = Helper.AttributeValue(node, "resourceName", m_ResourceName.ToString()); 240 m_ResourceName = Helper.AttributeValue(node, "resourceName", m_ResourceName.ToString());
235 this.m_Link = bool.Parse(Helper.AttributeValue(node, "link", bool.FalseString)); 241 this.m_Link = bool.Parse(Helper.AttributeValue(node, "link", bool.FalseString));
236 if ( this.m_Link == true ) 242 if ( this.m_Link == true )
diff --git a/Prebuild/src/Core/Nodes/FilesNode.cs b/Prebuild/src/Core/Nodes/FilesNode.cs
index 7c1dd19..dc306c2 100644
--- a/Prebuild/src/Core/Nodes/FilesNode.cs
+++ b/Prebuild/src/Core/Nodes/FilesNode.cs
@@ -23,15 +23,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
23*/ 23*/
24#endregion 24#endregion
25 25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: borrillis $
30 * $Date: 2007-05-25 01:03:16 +0900 (Fri, 25 May 2007) $
31 * $Revision: 243 $
32 */
33#endregion
34
35using System; 26using System;
36using System.Collections; 27using System.Collections;
37using System.Collections.Specialized; 28using System.Collections.Specialized;
@@ -39,6 +30,7 @@ using System.Xml;
39 30
40using Prebuild.Core.Attributes; 31using Prebuild.Core.Attributes;
41using Prebuild.Core.Interfaces; 32using Prebuild.Core.Interfaces;
33using System.IO;
42 34
43namespace Prebuild.Core.Nodes 35namespace Prebuild.Core.Nodes
44{ 36{
@@ -224,8 +216,8 @@ namespace Prebuild.Core.Nodes
224 if (!m_Files.Contains(file)) 216 if (!m_Files.Contains(file))
225 { 217 {
226 m_Files.Add(file); 218 m_Files.Add(file);
227 m_BuildActions[ file ] = matchNode.BuildAction; 219 m_BuildActions[ file ] = matchNode.BuildAction == null ? GetBuildActionByFileName(file) : matchNode.BuildAction;
228 m_SubTypes[ file ] = matchNode.SubType; 220 m_SubTypes[file] = matchNode.SubType == null ? GetSubTypeByFileName(file) : matchNode.SubType.Value;
229 m_ResourceNames[ file ] = matchNode.ResourceName; 221 m_ResourceNames[ file ] = matchNode.ResourceName;
230 this.m_PreservePaths[ file ] = matchNode.PreservePath; 222 this.m_PreservePaths[ file ] = matchNode.PreservePath;
231 this.m_Links[ file ] = matchNode.IsLink; 223 this.m_Links[ file ] = matchNode.IsLink;
diff --git a/Prebuild/src/Core/Nodes/MatchNode.cs b/Prebuild/src/Core/Nodes/MatchNode.cs
index aeaf3c1..656d7d0 100644
--- a/Prebuild/src/Core/Nodes/MatchNode.cs
+++ b/Prebuild/src/Core/Nodes/MatchNode.cs
@@ -23,16 +23,8 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
23*/ 23*/
24#endregion 24#endregion
25 25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: borrillis $
30 * $Date: 2007-05-25 01:03:16 +0900 (Fri, 25 May 2007) $
31 * $Revision: 243 $
32 */
33#endregion
34
35using System; 26using System;
27using System.Collections.Generic;
36using System.Collections.Specialized; 28using System.Collections.Specialized;
37using System.IO; 29using System.IO;
38using System.Text.RegularExpressions; 30using System.Text.RegularExpressions;
@@ -53,29 +45,16 @@ namespace Prebuild.Core.Nodes
53 { 45 {
54 #region Fields 46 #region Fields
55 47
56 private StringCollection m_Files; 48 private readonly StringCollection m_Files = new StringCollection();
57 private Regex m_Regex; 49 private Regex m_Regex;
58 private BuildAction m_BuildAction = BuildAction.Compile; 50 private BuildAction? m_BuildAction;
59 private SubType m_SubType = SubType.Code; 51 private SubType? m_SubType;
60 string m_ResourceName = ""; 52 string m_ResourceName = "";
61 private CopyToOutput m_CopyToOutput; 53 private CopyToOutput m_CopyToOutput;
62 private bool m_Link; 54 private bool m_Link;
63 private string m_LinkPath; 55 private string m_LinkPath;
64 private bool m_PreservePath; 56 private bool m_PreservePath;
65 private ArrayList m_Exclusions; 57 private readonly List<ExcludeNode> m_Exclusions = new List<ExcludeNode>();
66
67 #endregion
68
69 #region Constructors
70
71 /// <summary>
72 ///
73 /// </summary>
74 public MatchNode()
75 {
76 m_Files = new StringCollection();
77 m_Exclusions = new ArrayList();
78 }
79 58
80 #endregion 59 #endregion
81 60
@@ -95,7 +74,7 @@ namespace Prebuild.Core.Nodes
95 /// <summary> 74 /// <summary>
96 /// 75 ///
97 /// </summary> 76 /// </summary>
98 public BuildAction BuildAction 77 public BuildAction? BuildAction
99 { 78 {
100 get 79 get
101 { 80 {
@@ -106,7 +85,7 @@ namespace Prebuild.Core.Nodes
106 /// <summary> 85 /// <summary>
107 /// 86 ///
108 /// </summary> 87 /// </summary>
109 public SubType SubType 88 public SubType? SubType
110 { 89 {
111 get 90 get
112 { 91 {
@@ -167,7 +146,7 @@ namespace Prebuild.Core.Nodes
167 /// <param name="pattern">The pattern.</param> 146 /// <param name="pattern">The pattern.</param>
168 /// <param name="recurse">if set to <c>true</c> [recurse].</param> 147 /// <param name="recurse">if set to <c>true</c> [recurse].</param>
169 /// <param name="useRegex">if set to <c>true</c> [use regex].</param> 148 /// <param name="useRegex">if set to <c>true</c> [use regex].</param>
170 private void RecurseDirectories(string path, string pattern, bool recurse, bool useRegex, ArrayList exclusions) 149 private void RecurseDirectories(string path, string pattern, bool recurse, bool useRegex, List<ExcludeNode> exclusions)
171 { 150 {
172 Match match; 151 Match match;
173 Boolean excludeFile; 152 Boolean excludeFile;
@@ -279,10 +258,14 @@ namespace Prebuild.Core.Nodes
279 string pattern = Helper.AttributeValue(node, "pattern", "*"); 258 string pattern = Helper.AttributeValue(node, "pattern", "*");
280 bool recurse = (bool)Helper.TranslateValue(typeof(bool), Helper.AttributeValue(node, "recurse", "false")); 259 bool recurse = (bool)Helper.TranslateValue(typeof(bool), Helper.AttributeValue(node, "recurse", "false"));
281 bool useRegex = (bool)Helper.TranslateValue(typeof(bool), Helper.AttributeValue(node, "useRegex", "false")); 260 bool useRegex = (bool)Helper.TranslateValue(typeof(bool), Helper.AttributeValue(node, "useRegex", "false"));
282 m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction), 261 string buildAction = Helper.AttributeValue(node, "buildAction", String.Empty);
283 Helper.AttributeValue(node, "buildAction", m_BuildAction.ToString())); 262 if (buildAction != string.Empty)
284 m_SubType = (SubType)Enum.Parse(typeof(SubType), 263 m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction), buildAction);
285 Helper.AttributeValue(node, "subType", m_SubType.ToString())); 264
265 //TODO: Figure out where the subtype node is being assigned
266 //string subType = Helper.AttributeValue(node, "subType", string.Empty);
267 //if (subType != String.Empty)
268 // m_SubType = (SubType)Enum.Parse(typeof(SubType), subType);
286 m_ResourceName = Helper.AttributeValue(node, "resourceName", m_ResourceName.ToString()); 269 m_ResourceName = Helper.AttributeValue(node, "resourceName", m_ResourceName.ToString());
287 this.m_CopyToOutput = (CopyToOutput) Enum.Parse(typeof(CopyToOutput), Helper.AttributeValue(node, "copyToOutput", this.m_CopyToOutput.ToString())); 270 this.m_CopyToOutput = (CopyToOutput) Enum.Parse(typeof(CopyToOutput), Helper.AttributeValue(node, "copyToOutput", this.m_CopyToOutput.ToString()));
288 this.m_Link = bool.Parse(Helper.AttributeValue(node, "link", bool.FalseString)); 271 this.m_Link = bool.Parse(Helper.AttributeValue(node, "link", bool.FalseString));
@@ -329,7 +312,7 @@ namespace Prebuild.Core.Nodes
329 if(dataNode is ExcludeNode) 312 if(dataNode is ExcludeNode)
330 { 313 {
331 ExcludeNode excludeNode = (ExcludeNode)dataNode; 314 ExcludeNode excludeNode = (ExcludeNode)dataNode;
332 m_Exclusions.Add( dataNode ); 315 m_Exclusions.Add( excludeNode );
333 } 316 }
334 } 317 }
335 318
diff --git a/Prebuild/src/Core/Nodes/OptionsNode.cs b/Prebuild/src/Core/Nodes/OptionsNode.cs
index 651c339..b63034b 100644
--- a/Prebuild/src/Core/Nodes/OptionsNode.cs
+++ b/Prebuild/src/Core/Nodes/OptionsNode.cs
@@ -23,17 +23,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
23*/ 23*/
24#endregion 24#endregion
25 25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2007-01-09 01:55:40 +0900 (Tue, 09 Jan 2007) $
31 * $Revision: 197 $
32 */
33#endregion
34
35
36
37using System; 26using System;
38using System.Collections; 27using System.Collections;
39using System.Collections.Specialized; 28using System.Collections.Specialized;
diff --git a/Prebuild/src/Core/Nodes/ProcessNode.cs b/Prebuild/src/Core/Nodes/ProcessNode.cs
index 2d2162c..6bfbe16 100644
--- a/Prebuild/src/Core/Nodes/ProcessNode.cs
+++ b/Prebuild/src/Core/Nodes/ProcessNode.cs
@@ -23,15 +23,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
23*/ 23*/
24#endregion 24#endregion
25 25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2006-01-28 09:49:58 +0900 (Sat, 28 Jan 2006) $
31 * $Revision: 71 $
32 */
33#endregion
34
35using System; 26using System;
36using System.Collections; 27using System.Collections;
37using System.Collections.Specialized; 28using System.Collections.Specialized;
diff --git a/Prebuild/src/Core/Nodes/ProjectNode.cs b/Prebuild/src/Core/Nodes/ProjectNode.cs
index e98ab5f..0a24abf 100644
--- a/Prebuild/src/Core/Nodes/ProjectNode.cs
+++ b/Prebuild/src/Core/Nodes/ProjectNode.cs
@@ -23,17 +23,9 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
23*/ 23*/
24#endregion 24#endregion
25 25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2007-05-26 06:58:26 +0900 (Sat, 26 May 2007) $
31 * $Revision: 244 $
32 */
33#endregion
34
35using System; 26using System;
36using System.Collections; 27using System.Collections;
28using System.Collections.Generic;
37using System.IO; 29using System.IO;
38using System.Xml; 30using System.Xml;
39 31
@@ -59,7 +51,11 @@ namespace Prebuild.Core.Nodes
59 /// <summary> 51 /// <summary>
60 /// The project is a library 52 /// The project is a library
61 /// </summary> 53 /// </summary>
62 Library 54 Library,
55 /// <summary>
56 /// The project is a website
57 /// </summary>
58 Web,
63 } 59 }
64 60
65 /// <summary> 61 /// <summary>
@@ -76,7 +72,25 @@ namespace Prebuild.Core.Nodes
76 /// </summary> 72 /// </summary>
77 Mono 73 Mono
78 } 74 }
79 75 /// <summary>
76 /// The version of the .NET framework to use (Required for VS2008)
77 /// <remarks>We don't need .NET 1.1 in here, it'll default when using vs2003.</remarks>
78 /// </summary>
79 public enum FrameworkVersion
80 {
81 /// <summary>
82 /// .NET 2.0
83 /// </summary>
84 v2_0,
85 /// <summary>
86 /// .NET 3.0
87 /// </summary>
88 v3_0,
89 /// <summary>
90 /// .NET 3.5
91 /// </summary>
92 v3_5,
93 }
80 /// <summary> 94 /// <summary>
81 /// The Node object representing /Prebuild/Solution/Project elements 95 /// The Node object representing /Prebuild/Solution/Project elements
82 /// </summary> 96 /// </summary>
@@ -95,35 +109,22 @@ namespace Prebuild.Core.Nodes
95 private string m_Language = "C#"; 109 private string m_Language = "C#";
96 private ProjectType m_Type = ProjectType.Exe; 110 private ProjectType m_Type = ProjectType.Exe;
97 private ClrRuntime m_Runtime = ClrRuntime.Microsoft; 111 private ClrRuntime m_Runtime = ClrRuntime.Microsoft;
112 private FrameworkVersion m_Framework = FrameworkVersion.v2_0;
98 private string m_StartupObject = ""; 113 private string m_StartupObject = "";
99 private string m_RootNamespace; 114 private string m_RootNamespace;
100 private string m_FilterGroups = ""; 115 private string m_FilterGroups = "";
101 private string m_Version = ""; 116 private string m_Version = "";
102 private Guid m_Guid; 117 private Guid m_Guid;
118 private string m_DebugStartParameters;
103 119
104 private Hashtable m_Configurations; 120 private Hashtable m_Configurations = new Hashtable();
105 private ArrayList m_ReferencePaths; 121 private readonly List<ReferencePathNode> m_ReferencePaths = new List<ReferencePathNode>();
106 private ArrayList m_References; 122 private readonly List<ReferenceNode> m_References = new List<ReferenceNode>();
107 private ArrayList m_Authors; 123 private readonly List<AuthorNode> m_Authors = new List<AuthorNode>();
108 private FilesNode m_Files; 124 private FilesNode m_Files;
109 125
110 #endregion 126 #endregion
111 127
112 #region Constructors
113
114 /// <summary>
115 /// Initializes a new instance of the <see cref="ProjectNode"/> class.
116 /// </summary>
117 public ProjectNode()
118 {
119 m_Configurations = new Hashtable();
120 m_ReferencePaths = new ArrayList();
121 m_References = new ArrayList();
122 m_Authors = new ArrayList();
123 }
124
125 #endregion
126
127 #region Properties 128 #region Properties
128 129
129 /// <summary> 130 /// <summary>
@@ -134,10 +135,19 @@ namespace Prebuild.Core.Nodes
134 { 135 {
135 get 136 get
136 { 137 {
137 return m_Name; 138 return m_Name;
139 }
140 }
141 /// <summary>
142 /// The version of the .NET Framework to compile under
143 /// </summary>
144 public FrameworkVersion FrameworkVersion
145 {
146 get
147 {
148 return this.m_Framework;
138 } 149 }
139 } 150 }
140
141 /// <summary> 151 /// <summary>
142 /// Gets the path. 152 /// Gets the path.
143 /// </summary> 153 /// </summary>
@@ -210,17 +220,17 @@ namespace Prebuild.Core.Nodes
210 } 220 }
211 } 221 }
212 222
213 /// <summary> 223 /// <summary>
214 /// Gets the app icon. 224 /// Gets the app icon.
215 /// </summary> 225 /// </summary>
216 /// <value>The app icon.</value> 226 /// <value>The app icon.</value>
217 public string ConfigFile 227 public string ConfigFile
218 { 228 {
219 get 229 get
220 { 230 {
221 return m_ConfigFile; 231 return m_ConfigFile;
222 } 232 }
223 } 233 }
224 234
225 /// <summary> 235 /// <summary>
226 /// 236 ///
@@ -269,22 +279,22 @@ namespace Prebuild.Core.Nodes
269 } 279 }
270 } 280 }
271 281
272 private bool m_GenerateAssemblyInfoFile = false; 282 private bool m_GenerateAssemblyInfoFile = false;
273 283
274 /// <summary> 284 /// <summary>
275 /// 285 ///
276 /// </summary> 286 /// </summary>
277 public bool GenerateAssemblyInfoFile 287 public bool GenerateAssemblyInfoFile
278 { 288 {
279 get 289 get
280 { 290 {
281 return m_GenerateAssemblyInfoFile; 291 return m_GenerateAssemblyInfoFile;
282 } 292 }
283 set 293 set
284 { 294 {
285 m_GenerateAssemblyInfoFile = value; 295 m_GenerateAssemblyInfoFile = value;
286 } 296 }
287 } 297 }
288 298
289 /// <summary> 299 /// <summary>
290 /// Gets the startup object. 300 /// Gets the startup object.
@@ -314,7 +324,7 @@ namespace Prebuild.Core.Nodes
314 /// Gets the configurations. 324 /// Gets the configurations.
315 /// </summary> 325 /// </summary>
316 /// <value>The configurations.</value> 326 /// <value>The configurations.</value>
317 public ICollection Configurations 327 public IList Configurations
318 { 328 {
319 get 329 get
320 { 330 {
@@ -340,11 +350,11 @@ namespace Prebuild.Core.Nodes
340 /// Gets the reference paths. 350 /// Gets the reference paths.
341 /// </summary> 351 /// </summary>
342 /// <value>The reference paths.</value> 352 /// <value>The reference paths.</value>
343 public ArrayList ReferencePaths 353 public List<ReferencePathNode> ReferencePaths
344 { 354 {
345 get 355 get
346 { 356 {
347 ArrayList tmp = new ArrayList(m_ReferencePaths); 357 List<ReferencePathNode> tmp = new List<ReferencePathNode>(m_ReferencePaths);
348 tmp.Sort(); 358 tmp.Sort();
349 return tmp; 359 return tmp;
350 } 360 }
@@ -354,11 +364,11 @@ namespace Prebuild.Core.Nodes
354 /// Gets the references. 364 /// Gets the references.
355 /// </summary> 365 /// </summary>
356 /// <value>The references.</value> 366 /// <value>The references.</value>
357 public ArrayList References 367 public List<ReferenceNode> References
358 { 368 {
359 get 369 get
360 { 370 {
361 ArrayList tmp = new ArrayList(m_References); 371 List<ReferenceNode> tmp = new List<ReferenceNode>(m_References);
362 tmp.Sort(); 372 tmp.Sort();
363 return tmp; 373 return tmp;
364 } 374 }
@@ -368,7 +378,7 @@ namespace Prebuild.Core.Nodes
368 /// Gets the Authors list. 378 /// Gets the Authors list.
369 /// </summary> 379 /// </summary>
370 /// <value>The list of the project's authors.</value> 380 /// <value>The list of the project's authors.</value>
371 public ArrayList Authors 381 public List<AuthorNode> Authors
372 { 382 {
373 get 383 get
374 { 384 {
@@ -424,7 +434,15 @@ namespace Prebuild.Core.Nodes
424 } 434 }
425 } 435 }
426 436
427 #endregion 437 public string DebugStartParameters
438 {
439 get
440 {
441 return m_DebugStartParameters;
442 }
443 }
444
445 #endregion
428 446
429 #region Private Methods 447 #region Private Methods
430 448
@@ -470,13 +488,18 @@ namespace Prebuild.Core.Nodes
470 m_Language = Helper.AttributeValue(node, "language", m_Language); 488 m_Language = Helper.AttributeValue(node, "language", m_Language);
471 m_Type = (ProjectType)Helper.EnumAttributeValue(node, "type", typeof(ProjectType), m_Type); 489 m_Type = (ProjectType)Helper.EnumAttributeValue(node, "type", typeof(ProjectType), m_Type);
472 m_Runtime = (ClrRuntime)Helper.EnumAttributeValue(node, "runtime", typeof(ClrRuntime), m_Runtime); 490 m_Runtime = (ClrRuntime)Helper.EnumAttributeValue(node, "runtime", typeof(ClrRuntime), m_Runtime);
491 m_Framework = (FrameworkVersion)Helper.EnumAttributeValue(node, "frameworkVersion", typeof(FrameworkVersion), m_Framework);
473 m_StartupObject = Helper.AttributeValue(node, "startupObject", m_StartupObject); 492 m_StartupObject = Helper.AttributeValue(node, "startupObject", m_StartupObject);
474 m_RootNamespace = Helper.AttributeValue(node, "rootNamespace", m_RootNamespace); 493 m_RootNamespace = Helper.AttributeValue(node, "rootNamespace", m_RootNamespace);
475 m_GenerateAssemblyInfoFile = Helper.ParseBoolean(node, "generateAssemblyInfoFile", false); 494
476
477 int hash = m_Name.GetHashCode(); 495 int hash = m_Name.GetHashCode();
478 m_Guid = new Guid(hash, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); 496 Guid guidByHash = new Guid(hash, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
497 string guid = Helper.AttributeValue(node, "guid", guidByHash.ToString());
498 m_Guid = new Guid(guid);
479 499
500 m_GenerateAssemblyInfoFile = Helper.ParseBoolean(node, "generateAssemblyInfoFile", false);
501 m_DebugStartParameters = Helper.AttributeValue(node, "debugStartParameters", string.Empty);
502
480 if(m_AssemblyName == null || m_AssemblyName.Length < 1) 503 if(m_AssemblyName == null || m_AssemblyName.Length < 1)
481 { 504 {
482 m_AssemblyName = m_Name; 505 m_AssemblyName = m_Name;
@@ -516,15 +539,15 @@ namespace Prebuild.Core.Nodes
516 } 539 }
517 else if(dataNode is ReferencePathNode) 540 else if(dataNode is ReferencePathNode)
518 { 541 {
519 m_ReferencePaths.Add(dataNode); 542 m_ReferencePaths.Add((ReferencePathNode)dataNode);
520 } 543 }
521 else if(dataNode is ReferenceNode) 544 else if(dataNode is ReferenceNode)
522 { 545 {
523 m_References.Add(dataNode); 546 m_References.Add((ReferenceNode)dataNode);
524 } 547 }
525 else if(dataNode is AuthorNode) 548 else if(dataNode is AuthorNode)
526 { 549 {
527 m_Authors.Add(dataNode); 550 m_Authors.Add((AuthorNode)dataNode);
528 } 551 }
529 else if(dataNode is FilesNode) 552 else if(dataNode is FilesNode)
530 { 553 {
@@ -548,6 +571,6 @@ namespace Prebuild.Core.Nodes
548 return this.m_Name.CompareTo(that.m_Name); 571 return this.m_Name.CompareTo(that.m_Name);
549 } 572 }
550 573
551 #endregion 574 #endregion
552 } 575 }
553} 576}
diff --git a/Prebuild/src/Core/Nodes/ReferenceNode.cs b/Prebuild/src/Core/Nodes/ReferenceNode.cs
index df0c2e4..9c5d1a3 100644
--- a/Prebuild/src/Core/Nodes/ReferenceNode.cs
+++ b/Prebuild/src/Core/Nodes/ReferenceNode.cs
@@ -23,15 +23,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
23*/ 23*/
24#endregion 24#endregion
25 25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2006-07-26 01:56:49 +0900 (Wed, 26 Jul 2006) $
31 * $Revision: 132 $
32 */
33#endregion
34
35using System; 26using System;
36using System.Xml; 27using System.Xml;
37 28
diff --git a/Prebuild/src/Core/Nodes/ReferencePathNode.cs b/Prebuild/src/Core/Nodes/ReferencePathNode.cs
index d4042ef..f0543c2 100644
--- a/Prebuild/src/Core/Nodes/ReferencePathNode.cs
+++ b/Prebuild/src/Core/Nodes/ReferencePathNode.cs
@@ -23,15 +23,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
23*/ 23*/
24#endregion 24#endregion
25 25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2006-01-28 09:49:58 +0900 (Sat, 28 Jan 2006) $
31 * $Revision: 71 $
32 */
33#endregion
34
35using System; 26using System;
36using System.Collections; 27using System.Collections;
37using System.Collections.Specialized; 28using System.Collections.Specialized;
diff --git a/Prebuild/src/Core/Nodes/SolutionNode.cs b/Prebuild/src/Core/Nodes/SolutionNode.cs
index 9473fe6..2a1b8e2 100644
--- a/Prebuild/src/Core/Nodes/SolutionNode.cs
+++ b/Prebuild/src/Core/Nodes/SolutionNode.cs
@@ -23,17 +23,9 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
23*/ 23*/
24#endregion 24#endregion
25 25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2006-03-01 01:15:42 +0900 (Wed, 01 Mar 2006) $
31 * $Revision: 92 $
32 */
33#endregion
34
35using System; 26using System;
36using System.Collections; 27using System.Collections;
28using System.Collections.Generic;
37using System.Diagnostics; 29using System.Diagnostics;
38using System.IO; 30using System.IO;
39using System.Xml; 31using System.Xml;
@@ -48,40 +40,62 @@ namespace Prebuild.Core.Nodes
48 /// 40 ///
49 /// </summary> 41 /// </summary>
50 [DataNode("Solution")] 42 [DataNode("Solution")]
43 [DataNode("EmbeddedSolution")]
44 [DebuggerDisplay("{Name}")]
51 public class SolutionNode : DataNode 45 public class SolutionNode : DataNode
52 { 46 {
53 #region Fields 47 #region Fields
54 48
49 private Guid m_Guid = Guid.NewGuid();
55 private string m_Name = "unknown"; 50 private string m_Name = "unknown";
56 private string m_Path = ""; 51 private string m_Path = "";
57 private string m_FullPath = ""; 52 private string m_FullPath = "";
58 private string m_ActiveConfig = "Debug"; 53 private string m_ActiveConfig = "Debug";
59 private string m_Version = "1.0.0"; 54 private string m_Version = "1.0.0";
60 55
61 private OptionsNode m_Options; 56 private OptionsNode m_Options;
62 private FilesNode m_Files; 57 private FilesNode m_Files;
63 private Hashtable m_Configurations; 58 private readonly Hashtable m_Configurations = new Hashtable();
64 private Hashtable m_Projects; 59 private readonly Hashtable m_Projects = new Hashtable();
65 private ArrayList m_ProjectsOrder; 60 private readonly Hashtable m_DatabaseProjects = new Hashtable();
66 61 private readonly List<ProjectNode> m_ProjectsOrder = new List<ProjectNode>();
67 #endregion 62 private readonly Hashtable m_Solutions = new Hashtable();
68
69 #region Constructors
70
71 /// <summary>
72 /// Initializes a new instance of the <see cref="SolutionNode"/> class.
73 /// </summary>
74 public SolutionNode()
75 {
76 m_Configurations = new Hashtable();
77 m_Projects = new Hashtable();
78 m_ProjectsOrder = new ArrayList();
79 }
80 63
81 #endregion 64 #endregion
82 65
83 #region Properties 66 #region Properties
84 67 public override IDataNode Parent
68 {
69 get
70 {
71 return base.Parent;
72 }
73 set
74 {
75 if (value is SolutionNode)
76 {
77 SolutionNode solution = (SolutionNode)value;
78 foreach (ConfigurationNode conf in solution.Configurations)
79 {
80 m_Configurations[conf.Name] = conf.Clone();
81 }
82 }
83
84 base.Parent = value;
85 }
86 }
87
88 public Guid Guid
89 {
90 get
91 {
92 return m_Guid;
93 }
94 set
95 {
96 m_Guid = value;
97 }
98 }
85 /// <summary> 99 /// <summary>
86 /// Gets or sets the active config. 100 /// Gets or sets the active config.
87 /// </summary> 101 /// </summary>
@@ -195,7 +209,36 @@ namespace Prebuild.Core.Nodes
195 return m_Configurations; 209 return m_Configurations;
196 } 210 }
197 } 211 }
198 212 /// <summary>
213 /// Gets the database projects.
214 /// </summary>
215 public ICollection DatabaseProjects
216 {
217 get
218 {
219 return m_DatabaseProjects.Values;
220 }
221 }
222 /// <summary>
223 /// Gets the nested solutions.
224 /// </summary>
225 public ICollection Solutions
226 {
227 get
228 {
229 return m_Solutions.Values;
230 }
231 }
232 /// <summary>
233 /// Gets the nested solutions hash table.
234 /// </summary>
235 public Hashtable SolutionsTable
236 {
237 get
238 {
239 return this.m_Solutions;
240 }
241 }
199 /// <summary> 242 /// <summary>
200 /// Gets the projects. 243 /// Gets the projects.
201 /// </summary> 244 /// </summary>
@@ -226,7 +269,7 @@ namespace Prebuild.Core.Nodes
226 /// Gets the projects table. 269 /// Gets the projects table.
227 /// </summary> 270 /// </summary>
228 /// <value>The projects table.</value> 271 /// <value>The projects table.</value>
229 public ArrayList ProjectsTableOrder 272 public List<ProjectNode> ProjectsTableOrder
230 { 273 {
231 get 274 get
232 { 275 {
@@ -287,8 +330,21 @@ namespace Prebuild.Core.Nodes
287 else if(dataNode is ProjectNode) 330 else if(dataNode is ProjectNode)
288 { 331 {
289 m_Projects[((ProjectNode)dataNode).Name] = dataNode; 332 m_Projects[((ProjectNode)dataNode).Name] = dataNode;
290 m_ProjectsOrder.Add(dataNode); 333 m_ProjectsOrder.Add((ProjectNode)dataNode);
291 } 334 }
335 else if(dataNode is SolutionNode)
336 {
337 m_Solutions[((SolutionNode)dataNode).Name] = dataNode;
338 }
339 else if (dataNode is ProcessNode)
340 {
341 ProcessNode p = (ProcessNode)dataNode;
342 Kernel.Instance.ProcessFile(p, this);
343 }
344 else if (dataNode is DatabaseProjectNode)
345 {
346 m_DatabaseProjects[((DatabaseProjectNode)dataNode).Name] = dataNode;
347 }
292 } 348 }
293 } 349 }
294 finally 350 finally