aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Prebuild/src/Core/Nodes/MatchNode.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Prebuild/src/Core/Nodes/MatchNode.cs')
-rw-r--r--Prebuild/src/Core/Nodes/MatchNode.cs51
1 files changed, 17 insertions, 34 deletions
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