diff options
Diffstat (limited to 'Prebuild/src/Core/Nodes')
-rw-r--r-- | Prebuild/src/Core/Nodes/CleanFilesNode.cs | 158 | ||||
-rw-r--r-- | Prebuild/src/Core/Nodes/CleanupNode.cs | 168 | ||||
-rw-r--r-- | Prebuild/src/Core/Nodes/ConfigurationNodeCollection.cs | 142 | ||||
-rw-r--r-- | Prebuild/src/Core/Nodes/DatabaseProjectNode.cs | 186 | ||||
-rw-r--r-- | Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs | 126 | ||||
-rw-r--r-- | Prebuild/src/Core/Nodes/FileNode.cs | 9 | ||||
-rw-r--r-- | Prebuild/src/Core/Nodes/FilesNode.cs | 34 | ||||
-rw-r--r-- | Prebuild/src/Core/Nodes/MatchNode.cs | 17 |
8 files changed, 446 insertions, 394 deletions
diff --git a/Prebuild/src/Core/Nodes/CleanFilesNode.cs b/Prebuild/src/Core/Nodes/CleanFilesNode.cs index 71405f9..dc2da9a 100644 --- a/Prebuild/src/Core/Nodes/CleanFilesNode.cs +++ b/Prebuild/src/Core/Nodes/CleanFilesNode.cs | |||
@@ -1,80 +1,80 @@ | |||
1 | #region BSD License | 1 | #region BSD License |
2 | /* | 2 | /* |
3 | Copyright (c) 2007 C.J. Adams-Collier (cjac@colliertech.org) | 3 | Copyright (c) 2007 C.J. Adams-Collier (cjac@colliertech.org) |
4 | 4 | ||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided 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 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
21 | OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | 21 | OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
22 | IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 22 | IN 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 | using System; | 26 | using System; |
27 | using System.Collections.Generic; | 27 | using System.Collections.Generic; |
28 | using System.Xml; | 28 | using System.Xml; |
29 | 29 | ||
30 | using Prebuild.Core.Attributes; | 30 | using Prebuild.Core.Attributes; |
31 | using Prebuild.Core.Interfaces; | 31 | using Prebuild.Core.Interfaces; |
32 | using Prebuild.Core.Utilities; | 32 | using Prebuild.Core.Utilities; |
33 | 33 | ||
34 | namespace Prebuild.Core.Nodes | 34 | namespace Prebuild.Core.Nodes |
35 | { | 35 | { |
36 | [DataNode("CleanFiles")] | 36 | [DataNode("CleanFiles")] |
37 | public class CleanFilesNode : DataNode | 37 | public class CleanFilesNode : DataNode |
38 | { | 38 | { |
39 | #region Fields | 39 | #region Fields |
40 | 40 | ||
41 | private string m_Pattern; | 41 | private string m_Pattern; |
42 | 42 | ||
43 | #endregion | 43 | #endregion |
44 | 44 | ||
45 | #region Properties | 45 | #region Properties |
46 | 46 | ||
47 | /// <summary> | 47 | /// <summary> |
48 | /// Gets the signature. | 48 | /// Gets the signature. |
49 | /// </summary> | 49 | /// </summary> |
50 | /// <value>The signature.</value> | 50 | /// <value>The signature.</value> |
51 | public string Pattern | 51 | public string Pattern |
52 | { | 52 | { |
53 | get | 53 | get |
54 | { | 54 | { |
55 | return m_Pattern; | 55 | return m_Pattern; |
56 | } | 56 | } |
57 | } | 57 | } |
58 | 58 | ||
59 | #endregion | 59 | #endregion |
60 | 60 | ||
61 | #region Public Methods | 61 | #region Public Methods |
62 | 62 | ||
63 | /// <summary> | 63 | /// <summary> |
64 | /// Parses the specified node. | 64 | /// Parses the specified node. |
65 | /// </summary> | 65 | /// </summary> |
66 | /// <param name="node">The node.</param> | 66 | /// <param name="node">The node.</param> |
67 | public override void Parse(XmlNode node) | 67 | public override void Parse(XmlNode node) |
68 | { | 68 | { |
69 | if (node == null) | 69 | if (node == null) |
70 | { | 70 | { |
71 | throw new ArgumentNullException("node"); | 71 | throw new ArgumentNullException("node"); |
72 | } | 72 | } |
73 | 73 | ||
74 | m_Pattern = Helper.AttributeValue(node, "pattern", String.Empty); ; | 74 | m_Pattern = Helper.AttributeValue(node, "pattern", String.Empty); ; |
75 | m_Pattern = m_Pattern.Trim(); | 75 | m_Pattern = m_Pattern.Trim(); |
76 | } | 76 | } |
77 | 77 | ||
78 | #endregion | 78 | #endregion |
79 | } | 79 | } |
80 | } \ No newline at end of file | 80 | } \ No newline at end of file |
diff --git a/Prebuild/src/Core/Nodes/CleanupNode.cs b/Prebuild/src/Core/Nodes/CleanupNode.cs index b8131b0..a9b77eb 100644 --- a/Prebuild/src/Core/Nodes/CleanupNode.cs +++ b/Prebuild/src/Core/Nodes/CleanupNode.cs | |||
@@ -1,85 +1,85 @@ | |||
1 | #region BSD License | 1 | #region BSD License |
2 | /* | 2 | /* |
3 | Copyright (c) 2007 C.J. Adams-Collier (cjac@colliertech.org) | 3 | Copyright (c) 2007 C.J. Adams-Collier (cjac@colliertech.org) |
4 | 4 | ||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided 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 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
21 | OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | 21 | OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
22 | IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 22 | IN 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 | using System; | 26 | using System; |
27 | using System.Collections.Generic; | 27 | using System.Collections.Generic; |
28 | using System.Xml; | 28 | using System.Xml; |
29 | 29 | ||
30 | using Prebuild.Core.Attributes; | 30 | using Prebuild.Core.Attributes; |
31 | using Prebuild.Core.Interfaces; | 31 | using Prebuild.Core.Interfaces; |
32 | 32 | ||
33 | namespace Prebuild.Core.Nodes | 33 | namespace Prebuild.Core.Nodes |
34 | { | 34 | { |
35 | [DataNode("Cleanup")] | 35 | [DataNode("Cleanup")] |
36 | public class CleanupNode : DataNode | 36 | public class CleanupNode : DataNode |
37 | { | 37 | { |
38 | #region Fields | 38 | #region Fields |
39 | 39 | ||
40 | private List<CleanFilesNode> m_CleanFiles = new List<CleanFilesNode>(); | 40 | private List<CleanFilesNode> m_CleanFiles = new List<CleanFilesNode>(); |
41 | 41 | ||
42 | #endregion | 42 | #endregion |
43 | 43 | ||
44 | #region Properties | 44 | #region Properties |
45 | 45 | ||
46 | /// <summary> | 46 | /// <summary> |
47 | /// Gets the signature. | 47 | /// Gets the signature. |
48 | /// </summary> | 48 | /// </summary> |
49 | /// <value>The signature.</value> | 49 | /// <value>The signature.</value> |
50 | public List<CleanFilesNode> CleanFiles | 50 | public List<CleanFilesNode> CleanFiles |
51 | { | 51 | { |
52 | get | 52 | get |
53 | { | 53 | { |
54 | return m_CleanFiles; | 54 | return m_CleanFiles; |
55 | } | 55 | } |
56 | } | 56 | } |
57 | 57 | ||
58 | #endregion | 58 | #endregion |
59 | 59 | ||
60 | #region Public Methods | 60 | #region Public Methods |
61 | 61 | ||
62 | /// <summary> | 62 | /// <summary> |
63 | /// Parses the specified node. | 63 | /// Parses the specified node. |
64 | /// </summary> | 64 | /// </summary> |
65 | /// <param name="node">The node.</param> | 65 | /// <param name="node">The node.</param> |
66 | public override void Parse(XmlNode node) | 66 | public override void Parse(XmlNode node) |
67 | { | 67 | { |
68 | if( node == null ) | 68 | if( node == null ) |
69 | { | 69 | { |
70 | throw new ArgumentNullException("node"); | 70 | throw new ArgumentNullException("node"); |
71 | } | 71 | } |
72 | 72 | ||
73 | foreach (XmlNode child in node.ChildNodes) | 73 | foreach (XmlNode child in node.ChildNodes) |
74 | { | 74 | { |
75 | IDataNode dataNode = Kernel.Instance.ParseNode(child, this); | 75 | IDataNode dataNode = Kernel.Instance.ParseNode(child, this); |
76 | if (dataNode is CleanFilesNode) | 76 | if (dataNode is CleanFilesNode) |
77 | { | 77 | { |
78 | m_CleanFiles.Add((CleanFilesNode)dataNode); | 78 | m_CleanFiles.Add((CleanFilesNode)dataNode); |
79 | } | 79 | } |
80 | } | 80 | } |
81 | } | 81 | } |
82 | 82 | ||
83 | #endregion | 83 | #endregion |
84 | } | 84 | } |
85 | } \ No newline at end of file | 85 | } \ No newline at end of file |
diff --git a/Prebuild/src/Core/Nodes/ConfigurationNodeCollection.cs b/Prebuild/src/Core/Nodes/ConfigurationNodeCollection.cs index 1c38d9e..7c59ac5 100644 --- a/Prebuild/src/Core/Nodes/ConfigurationNodeCollection.cs +++ b/Prebuild/src/Core/Nodes/ConfigurationNodeCollection.cs | |||
@@ -1,71 +1,71 @@ | |||
1 | #region BSD License | 1 | #region BSD License |
2 | /* | 2 | /* |
3 | Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com) | 3 | Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com) |
4 | 4 | ||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided 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 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
21 | OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | 21 | OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
22 | IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 22 | IN 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 | using System.Collections.Generic; | 26 | using System.Collections.Generic; |
27 | 27 | ||
28 | namespace Prebuild.Core.Nodes | 28 | namespace Prebuild.Core.Nodes |
29 | { | 29 | { |
30 | /// <summary> | 30 | /// <summary> |
31 | /// Implements a specialized list of configuration nodes which allows for lookup via | 31 | /// Implements a specialized list of configuration nodes which allows for lookup via |
32 | /// configuration name and platform. | 32 | /// configuration name and platform. |
33 | /// </summary> | 33 | /// </summary> |
34 | public class ConfigurationNodeCollection : List<ConfigurationNode> | 34 | public class ConfigurationNodeCollection : List<ConfigurationNode> |
35 | { | 35 | { |
36 | #region Properties | 36 | #region Properties |
37 | 37 | ||
38 | public ConfigurationNode this[string nameAndPlatform] | 38 | public ConfigurationNode this[string nameAndPlatform] |
39 | { | 39 | { |
40 | get | 40 | get |
41 | { | 41 | { |
42 | foreach (ConfigurationNode configurationNode in this) | 42 | foreach (ConfigurationNode configurationNode in this) |
43 | { | 43 | { |
44 | if (configurationNode.NameAndPlatform == nameAndPlatform) | 44 | if (configurationNode.NameAndPlatform == nameAndPlatform) |
45 | { | 45 | { |
46 | return configurationNode; | 46 | return configurationNode; |
47 | } | 47 | } |
48 | } | 48 | } |
49 | 49 | ||
50 | return null; | 50 | return null; |
51 | } | 51 | } |
52 | 52 | ||
53 | set | 53 | set |
54 | { | 54 | { |
55 | // See if the node | 55 | // See if the node |
56 | ConfigurationNode configurationNode = this[nameAndPlatform]; | 56 | ConfigurationNode configurationNode = this[nameAndPlatform]; |
57 | 57 | ||
58 | if (configurationNode != null) | 58 | if (configurationNode != null) |
59 | { | 59 | { |
60 | this[IndexOf(configurationNode)] = value; | 60 | this[IndexOf(configurationNode)] = value; |
61 | } | 61 | } |
62 | else | 62 | else |
63 | { | 63 | { |
64 | Add(value); | 64 | Add(value); |
65 | } | 65 | } |
66 | } | 66 | } |
67 | } | 67 | } |
68 | 68 | ||
69 | #endregion | 69 | #endregion |
70 | } | 70 | } |
71 | } | 71 | } |
diff --git a/Prebuild/src/Core/Nodes/DatabaseProjectNode.cs b/Prebuild/src/Core/Nodes/DatabaseProjectNode.cs index 278ecd8..20095c3 100644 --- a/Prebuild/src/Core/Nodes/DatabaseProjectNode.cs +++ b/Prebuild/src/Core/Nodes/DatabaseProjectNode.cs | |||
@@ -1,93 +1,93 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
3 | using System.Text; | 3 | using System.Text; |
4 | using System.Xml; | 4 | using System.Xml; |
5 | 5 | ||
6 | using Prebuild.Core.Attributes; | 6 | using Prebuild.Core.Attributes; |
7 | using Prebuild.Core.Interfaces; | 7 | using Prebuild.Core.Interfaces; |
8 | using Prebuild.Core.Utilities; | 8 | using Prebuild.Core.Utilities; |
9 | 9 | ||
10 | namespace Prebuild.Core.Nodes | 10 | namespace Prebuild.Core.Nodes |
11 | { | 11 | { |
12 | [DataNode("DatabaseProject")] | 12 | [DataNode("DatabaseProject")] |
13 | public class DatabaseProjectNode : DataNode | 13 | public class DatabaseProjectNode : DataNode |
14 | { | 14 | { |
15 | string name; | 15 | string name; |
16 | string path; | 16 | string path; |
17 | string fullpath; | 17 | string fullpath; |
18 | Guid guid = Guid.NewGuid(); | 18 | Guid guid = Guid.NewGuid(); |
19 | readonly List<AuthorNode> authors = new List<AuthorNode>(); | 19 | readonly List<AuthorNode> authors = new List<AuthorNode>(); |
20 | readonly List<DatabaseReferenceNode> references = new List<DatabaseReferenceNode>(); | 20 | readonly List<DatabaseReferenceNode> references = new List<DatabaseReferenceNode>(); |
21 | 21 | ||
22 | public Guid Guid | 22 | public Guid Guid |
23 | { | 23 | { |
24 | get { return guid; } | 24 | get { return guid; } |
25 | } | 25 | } |
26 | 26 | ||
27 | public string Name | 27 | public string Name |
28 | { | 28 | { |
29 | get { return name; } | 29 | get { return name; } |
30 | } | 30 | } |
31 | 31 | ||
32 | public string Path | 32 | public string Path |
33 | { | 33 | { |
34 | get { return path; } | 34 | get { return path; } |
35 | } | 35 | } |
36 | 36 | ||
37 | public string FullPath | 37 | public string FullPath |
38 | { | 38 | { |
39 | get { return fullpath; } | 39 | get { return fullpath; } |
40 | } | 40 | } |
41 | 41 | ||
42 | public IEnumerable<DatabaseReferenceNode> References | 42 | public IEnumerable<DatabaseReferenceNode> References |
43 | { | 43 | { |
44 | get { return references; } | 44 | get { return references; } |
45 | } | 45 | } |
46 | 46 | ||
47 | public override void Parse(XmlNode node) | 47 | public override void Parse(XmlNode node) |
48 | { | 48 | { |
49 | name = Helper.AttributeValue(node, "name", name); | 49 | name = Helper.AttributeValue(node, "name", name); |
50 | path = Helper.AttributeValue(node, "path", name); | 50 | path = Helper.AttributeValue(node, "path", name); |
51 | 51 | ||
52 | try | 52 | try |
53 | { | 53 | { |
54 | fullpath = Helper.ResolvePath(path); | 54 | fullpath = Helper.ResolvePath(path); |
55 | } | 55 | } |
56 | catch | 56 | catch |
57 | { | 57 | { |
58 | throw new WarningException("Could not resolve Solution path: {0}", path); | 58 | throw new WarningException("Could not resolve Solution path: {0}", path); |
59 | } | 59 | } |
60 | 60 | ||
61 | Kernel.Instance.CurrentWorkingDirectory.Push(); | 61 | Kernel.Instance.CurrentWorkingDirectory.Push(); |
62 | 62 | ||
63 | try | 63 | try |
64 | { | 64 | { |
65 | Helper.SetCurrentDir(fullpath); | 65 | Helper.SetCurrentDir(fullpath); |
66 | 66 | ||
67 | if (node == null) | 67 | if (node == null) |
68 | { | 68 | { |
69 | throw new ArgumentNullException("node"); | 69 | throw new ArgumentNullException("node"); |
70 | } | 70 | } |
71 | 71 | ||
72 | foreach (XmlNode child in node.ChildNodes) | 72 | foreach (XmlNode child in node.ChildNodes) |
73 | { | 73 | { |
74 | IDataNode dataNode = Kernel.Instance.ParseNode(child, this); | 74 | IDataNode dataNode = Kernel.Instance.ParseNode(child, this); |
75 | 75 | ||
76 | if (dataNode == null) | 76 | if (dataNode == null) |
77 | continue; | 77 | continue; |
78 | 78 | ||
79 | if (dataNode is AuthorNode) | 79 | if (dataNode is AuthorNode) |
80 | authors.Add((AuthorNode)dataNode); | 80 | authors.Add((AuthorNode)dataNode); |
81 | else if (dataNode is DatabaseReferenceNode) | 81 | else if (dataNode is DatabaseReferenceNode) |
82 | references.Add((DatabaseReferenceNode)dataNode); | 82 | references.Add((DatabaseReferenceNode)dataNode); |
83 | } | 83 | } |
84 | } | 84 | } |
85 | finally | 85 | finally |
86 | { | 86 | { |
87 | Kernel.Instance.CurrentWorkingDirectory.Pop(); | 87 | Kernel.Instance.CurrentWorkingDirectory.Pop(); |
88 | } | 88 | } |
89 | 89 | ||
90 | base.Parse(node); | 90 | base.Parse(node); |
91 | } | 91 | } |
92 | } | 92 | } |
93 | } | 93 | } |
diff --git a/Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs b/Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs index 845db24..97c3964 100644 --- a/Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs +++ b/Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs | |||
@@ -1,63 +1,63 @@ | |||
1 | using System; | 1 | using System; |
2 | using Prebuild.Core.Attributes; | 2 | using Prebuild.Core.Attributes; |
3 | using Prebuild.Core.Utilities; | 3 | using Prebuild.Core.Utilities; |
4 | 4 | ||
5 | namespace Prebuild.Core.Nodes | 5 | namespace Prebuild.Core.Nodes |
6 | { | 6 | { |
7 | [DataNode("DatabaseReference")] | 7 | [DataNode("DatabaseReference")] |
8 | public class DatabaseReferenceNode : DataNode | 8 | public class DatabaseReferenceNode : DataNode |
9 | { | 9 | { |
10 | string name; | 10 | string name; |
11 | Guid providerId; | 11 | Guid providerId; |
12 | string connectionString; | 12 | string connectionString; |
13 | 13 | ||
14 | public string Name | 14 | public string Name |
15 | { | 15 | { |
16 | get { return name; } | 16 | get { return name; } |
17 | } | 17 | } |
18 | 18 | ||
19 | public Guid ProviderId | 19 | public Guid ProviderId |
20 | { | 20 | { |
21 | get { return providerId; } | 21 | get { return providerId; } |
22 | } | 22 | } |
23 | 23 | ||
24 | public string ConnectionString | 24 | public string ConnectionString |
25 | { | 25 | { |
26 | get { return connectionString; } | 26 | get { return connectionString; } |
27 | } | 27 | } |
28 | 28 | ||
29 | public override void Parse(System.Xml.XmlNode node) | 29 | public override void Parse(System.Xml.XmlNode node) |
30 | { | 30 | { |
31 | name = Helper.AttributeValue(node, "name", name); | 31 | name = Helper.AttributeValue(node, "name", name); |
32 | 32 | ||
33 | string providerName = Helper.AttributeValue(node, "providerName", string.Empty); | 33 | string providerName = Helper.AttributeValue(node, "providerName", string.Empty); |
34 | if (providerName != null) | 34 | if (providerName != null) |
35 | { | 35 | { |
36 | switch (providerName) | 36 | switch (providerName) |
37 | { | 37 | { |
38 | // digitaljeebus: pulled from HKLM\SOFTWARE\Microsoft\VisualStudio\9.0\DataProviders\* | 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. | 39 | // Not sure if these will help other operating systems, or if there's a better way. |
40 | case "Microsoft.SqlServerCe.Client.3.5": | 40 | case "Microsoft.SqlServerCe.Client.3.5": |
41 | providerId = new Guid("7C602B5B-ACCB-4acd-9DC0-CA66388C1533"); break; | 41 | providerId = new Guid("7C602B5B-ACCB-4acd-9DC0-CA66388C1533"); break; |
42 | case "System.Data.OleDb": | 42 | case "System.Data.OleDb": |
43 | providerId = new Guid("7F041D59-D76A-44ed-9AA2-FBF6B0548B80"); break; | 43 | providerId = new Guid("7F041D59-D76A-44ed-9AA2-FBF6B0548B80"); break; |
44 | case "System.Data.OracleClient": | 44 | case "System.Data.OracleClient": |
45 | providerId = new Guid("8F5C5018-AE09-42cf-B2CC-2CCCC7CFC2BB"); break; | 45 | providerId = new Guid("8F5C5018-AE09-42cf-B2CC-2CCCC7CFC2BB"); break; |
46 | case "System.Data.SqlClient": | 46 | case "System.Data.SqlClient": |
47 | providerId = new Guid("91510608-8809-4020-8897-FBA057E22D54"); break; | 47 | providerId = new Guid("91510608-8809-4020-8897-FBA057E22D54"); break; |
48 | case "System.Data.Odbc": | 48 | case "System.Data.Odbc": |
49 | providerId = new Guid("C3D4F4CE-2C48-4381-B4D6-34FA50C51C86"); break; | 49 | providerId = new Guid("C3D4F4CE-2C48-4381-B4D6-34FA50C51C86"); break; |
50 | 50 | ||
51 | default: | 51 | default: |
52 | throw new ArgumentOutOfRangeException("providerName", providerName, "Could not provider name to an id."); | 52 | throw new ArgumentOutOfRangeException("providerName", providerName, "Could not provider name to an id."); |
53 | } | 53 | } |
54 | } | 54 | } |
55 | else | 55 | else |
56 | providerId = new Guid(Helper.AttributeValue(node, "providerId", Guid.Empty.ToString("B"))); | 56 | providerId = new Guid(Helper.AttributeValue(node, "providerId", Guid.Empty.ToString("B"))); |
57 | 57 | ||
58 | connectionString = Helper.AttributeValue(node, "connectionString", connectionString); | 58 | connectionString = Helper.AttributeValue(node, "connectionString", connectionString); |
59 | 59 | ||
60 | base.Parse(node); | 60 | base.Parse(node); |
61 | } | 61 | } |
62 | } | 62 | } |
63 | } | 63 | } |
diff --git a/Prebuild/src/Core/Nodes/FileNode.cs b/Prebuild/src/Core/Nodes/FileNode.cs index 01cea1e..b313ffa 100644 --- a/Prebuild/src/Core/Nodes/FileNode.cs +++ b/Prebuild/src/Core/Nodes/FileNode.cs | |||
@@ -62,7 +62,11 @@ namespace Prebuild.Core.Nodes | |||
62 | /// <summary> | 62 | /// <summary> |
63 | /// | 63 | /// |
64 | /// </summary> | 64 | /// </summary> |
65 | Page | 65 | Page, |
66 | /// <summary> | ||
67 | /// | ||
68 | /// </summary> | ||
69 | Copy | ||
66 | } | 70 | } |
67 | 71 | ||
68 | /// <summary> | 72 | /// <summary> |
@@ -245,6 +249,9 @@ namespace Prebuild.Core.Nodes | |||
245 | if (subType != String.Empty) | 249 | if (subType != String.Empty) |
246 | m_SubType = (SubType)Enum.Parse(typeof(SubType), subType); | 250 | m_SubType = (SubType)Enum.Parse(typeof(SubType), subType); |
247 | 251 | ||
252 | Console.WriteLine("[FileNode]:BuildAction is {0}", buildAction); | ||
253 | |||
254 | |||
248 | m_ResourceName = Helper.AttributeValue(node, "resourceName", m_ResourceName.ToString()); | 255 | m_ResourceName = Helper.AttributeValue(node, "resourceName", m_ResourceName.ToString()); |
249 | this.m_Link = bool.Parse(Helper.AttributeValue(node, "link", bool.FalseString)); | 256 | this.m_Link = bool.Parse(Helper.AttributeValue(node, "link", bool.FalseString)); |
250 | if ( this.m_Link == true ) | 257 | if ( this.m_Link == true ) |
diff --git a/Prebuild/src/Core/Nodes/FilesNode.cs b/Prebuild/src/Core/Nodes/FilesNode.cs index 23a716c..16658f3 100644 --- a/Prebuild/src/Core/Nodes/FilesNode.cs +++ b/Prebuild/src/Core/Nodes/FilesNode.cs | |||
@@ -25,6 +25,7 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O | |||
25 | 25 | ||
26 | using System; | 26 | using System; |
27 | using System.Collections.Generic; | 27 | using System.Collections.Generic; |
28 | using System.Collections.Specialized; | ||
28 | using System.Xml; | 29 | using System.Xml; |
29 | 30 | ||
30 | using Prebuild.Core.Attributes; | 31 | using Prebuild.Core.Attributes; |
@@ -49,6 +50,8 @@ namespace Prebuild.Core.Nodes | |||
49 | private readonly Dictionary<string, bool> m_Links = new Dictionary<string, bool>(); | 50 | private readonly Dictionary<string, bool> m_Links = new Dictionary<string, bool>(); |
50 | private readonly Dictionary<string, string> m_LinkPaths = new Dictionary<string, string>(); | 51 | private readonly Dictionary<string, string> m_LinkPaths = new Dictionary<string, string>(); |
51 | private readonly Dictionary<string, bool> m_PreservePaths = new Dictionary<string, bool>(); | 52 | private readonly Dictionary<string, bool> m_PreservePaths = new Dictionary<string, bool>(); |
53 | private readonly Dictionary<string, string> m_DestinationPath = new Dictionary<string, string>(); | ||
54 | private readonly NameValueCollection m_CopyFiles = new NameValueCollection(); | ||
52 | 55 | ||
53 | #endregion | 56 | #endregion |
54 | 57 | ||
@@ -62,6 +65,16 @@ namespace Prebuild.Core.Nodes | |||
62 | } | 65 | } |
63 | } | 66 | } |
64 | 67 | ||
68 | public string[] Destinations | ||
69 | { | ||
70 | get { return m_CopyFiles.AllKeys; } | ||
71 | } | ||
72 | |||
73 | public int CopyFiles | ||
74 | { | ||
75 | get { return m_CopyFiles.Count; } | ||
76 | } | ||
77 | |||
65 | #endregion | 78 | #endregion |
66 | 79 | ||
67 | #region Public Methods | 80 | #region Public Methods |
@@ -76,6 +89,20 @@ namespace Prebuild.Core.Nodes | |||
76 | return m_BuildActions[file]; | 89 | return m_BuildActions[file]; |
77 | } | 90 | } |
78 | 91 | ||
92 | public string GetDestinationPath(string file) | ||
93 | { | ||
94 | if( !m_DestinationPath.ContainsKey(file)) | ||
95 | { | ||
96 | return null; | ||
97 | } | ||
98 | return m_DestinationPath[file]; | ||
99 | } | ||
100 | |||
101 | public string[] SourceFiles(string dest) | ||
102 | { | ||
103 | return m_CopyFiles.GetValues(dest); | ||
104 | } | ||
105 | |||
79 | public CopyToOutput GetCopyToOutput(string file) | 106 | public CopyToOutput GetCopyToOutput(string file) |
80 | { | 107 | { |
81 | if (!m_CopyToOutputs.ContainsKey(file)) | 108 | if (!m_CopyToOutputs.ContainsKey(file)) |
@@ -178,6 +205,13 @@ namespace Prebuild.Core.Nodes | |||
178 | m_BuildActions[file] = GetBuildActionByFileName(file); | 205 | m_BuildActions[file] = GetBuildActionByFileName(file); |
179 | else | 206 | else |
180 | m_BuildActions[file] = matchNode.BuildAction.Value; | 207 | m_BuildActions[file] = matchNode.BuildAction.Value; |
208 | |||
209 | if (matchNode.BuildAction == BuildAction.Copy) | ||
210 | { | ||
211 | m_CopyFiles.Add(matchNode.DestinationPath, file); | ||
212 | m_DestinationPath[file] = matchNode.DestinationPath; | ||
213 | } | ||
214 | |||
181 | m_SubTypes[file] = matchNode.SubType == null ? GetSubTypeByFileName(file) : matchNode.SubType.Value; | 215 | m_SubTypes[file] = matchNode.SubType == null ? GetSubTypeByFileName(file) : matchNode.SubType.Value; |
182 | m_ResourceNames[ file ] = matchNode.ResourceName; | 216 | m_ResourceNames[ file ] = matchNode.ResourceName; |
183 | m_PreservePaths[ file ] = matchNode.PreservePath; | 217 | m_PreservePaths[ file ] = matchNode.PreservePath; |
diff --git a/Prebuild/src/Core/Nodes/MatchNode.cs b/Prebuild/src/Core/Nodes/MatchNode.cs index 9735265..000bde9 100644 --- a/Prebuild/src/Core/Nodes/MatchNode.cs +++ b/Prebuild/src/Core/Nodes/MatchNode.cs | |||
@@ -52,6 +52,7 @@ namespace Prebuild.Core.Nodes | |||
52 | private bool m_Link; | 52 | private bool m_Link; |
53 | private string m_LinkPath; | 53 | private string m_LinkPath; |
54 | private bool m_PreservePath; | 54 | private bool m_PreservePath; |
55 | private string m_Destination = ""; | ||
55 | private readonly List<ExcludeNode> m_Exclusions = new List<ExcludeNode>(); | 56 | private readonly List<ExcludeNode> m_Exclusions = new List<ExcludeNode>(); |
56 | 57 | ||
57 | #endregion | 58 | #endregion |
@@ -80,6 +81,13 @@ namespace Prebuild.Core.Nodes | |||
80 | } | 81 | } |
81 | } | 82 | } |
82 | 83 | ||
84 | public string DestinationPath | ||
85 | { | ||
86 | get | ||
87 | { | ||
88 | return m_Destination; | ||
89 | } | ||
90 | } | ||
83 | /// <summary> | 91 | /// <summary> |
84 | /// | 92 | /// |
85 | /// </summary> | 93 | /// </summary> |
@@ -285,12 +293,14 @@ namespace Prebuild.Core.Nodes | |||
285 | } | 293 | } |
286 | string path = Helper.AttributeValue(node, "path", "."); | 294 | string path = Helper.AttributeValue(node, "path", "."); |
287 | string pattern = Helper.AttributeValue(node, "pattern", "*"); | 295 | string pattern = Helper.AttributeValue(node, "pattern", "*"); |
296 | string destination = Helper.AttributeValue(node, "destination", string.Empty); | ||
288 | bool recurse = (bool)Helper.TranslateValue(typeof(bool), Helper.AttributeValue(node, "recurse", "false")); | 297 | bool recurse = (bool)Helper.TranslateValue(typeof(bool), Helper.AttributeValue(node, "recurse", "false")); |
289 | bool useRegex = (bool)Helper.TranslateValue(typeof(bool), Helper.AttributeValue(node, "useRegex", "false")); | 298 | bool useRegex = (bool)Helper.TranslateValue(typeof(bool), Helper.AttributeValue(node, "useRegex", "false")); |
290 | string buildAction = Helper.AttributeValue(node, "buildAction", String.Empty); | 299 | string buildAction = Helper.AttributeValue(node, "buildAction", String.Empty); |
291 | if (buildAction != string.Empty) | 300 | if (buildAction != string.Empty) |
292 | m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction), buildAction); | 301 | m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction), buildAction); |
293 | 302 | ||
303 | |||
294 | //TODO: Figure out where the subtype node is being assigned | 304 | //TODO: Figure out where the subtype node is being assigned |
295 | //string subType = Helper.AttributeValue(node, "subType", string.Empty); | 305 | //string subType = Helper.AttributeValue(node, "subType", string.Empty); |
296 | //if (subType != String.Empty) | 306 | //if (subType != String.Empty) |
@@ -304,11 +314,12 @@ namespace Prebuild.Core.Nodes | |||
304 | } | 314 | } |
305 | m_PreservePath = bool.Parse( Helper.AttributeValue( node, "preservePath", bool.FalseString ) ); | 315 | m_PreservePath = bool.Parse( Helper.AttributeValue( node, "preservePath", bool.FalseString ) ); |
306 | 316 | ||
317 | if ( buildAction == "Copy") | ||
318 | m_Destination = destination; | ||
307 | 319 | ||
308 | if(path != null && path.Length == 0) | 320 | if(path != null && path.Length == 0) |
309 | { | ||
310 | path = ".";//use current directory | 321 | path = ".";//use current directory |
311 | } | 322 | |
312 | //throw new WarningException("Match must have a 'path' attribute"); | 323 | //throw new WarningException("Match must have a 'path' attribute"); |
313 | 324 | ||
314 | if(pattern == null) | 325 | if(pattern == null) |