diff options
Diffstat (limited to 'Prebuild/src/Core/Nodes')
-rw-r--r-- | Prebuild/src/Core/Nodes/AuthorNode.cs | 124 | ||||
-rw-r--r-- | Prebuild/src/Core/Nodes/CleanFilesNode.cs | 18 | ||||
-rw-r--r-- | Prebuild/src/Core/Nodes/CleanupNode.cs | 74 | ||||
-rw-r--r-- | Prebuild/src/Core/Nodes/ConfigurationNode.cs | 372 | ||||
-rw-r--r-- | Prebuild/src/Core/Nodes/ConfigurationNodeCollection.cs | 90 | ||||
-rw-r--r-- | Prebuild/src/Core/Nodes/DataNode.cs | 172 | ||||
-rw-r--r-- | Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs | 6 | ||||
-rw-r--r-- | Prebuild/src/Core/Nodes/DescriptionNode.cs | 124 | ||||
-rw-r--r-- | Prebuild/src/Core/Nodes/ExcludeNode.cs | 78 | ||||
-rw-r--r-- | Prebuild/src/Core/Nodes/FileNode.cs | 456 | ||||
-rw-r--r-- | Prebuild/src/Core/Nodes/FilesNode.cs | 284 | ||||
-rw-r--r-- | Prebuild/src/Core/Nodes/MatchNode.cs | 458 | ||||
-rw-r--r-- | Prebuild/src/Core/Nodes/OptionsNode.cs | 1178 | ||||
-rw-r--r-- | Prebuild/src/Core/Nodes/ProcessNode.cs | 166 | ||||
-rw-r--r-- | Prebuild/src/Core/Nodes/ProjectNode.cs | 1024 | ||||
-rw-r--r-- | Prebuild/src/Core/Nodes/ReferenceNode.cs | 218 | ||||
-rw-r--r-- | Prebuild/src/Core/Nodes/ReferencePathNode.cs | 124 | ||||
-rw-r--r-- | Prebuild/src/Core/Nodes/SolutionNode.cs | 516 |
18 files changed, 2741 insertions, 2741 deletions
diff --git a/Prebuild/src/Core/Nodes/AuthorNode.cs b/Prebuild/src/Core/Nodes/AuthorNode.cs index 4c415bb..e4b024f 100644 --- a/Prebuild/src/Core/Nodes/AuthorNode.cs +++ b/Prebuild/src/Core/Nodes/AuthorNode.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2007 C.J. Adams-Collier (cjac@colliertech.org) | |||
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 |
@@ -32,56 +32,56 @@ using Prebuild.Core.Utilities; | |||
32 | 32 | ||
33 | namespace Prebuild.Core.Nodes | 33 | namespace Prebuild.Core.Nodes |
34 | { | 34 | { |
35 | /// <summary> | 35 | /// <summary> |
36 | /// | 36 | /// |
37 | /// </summary> | 37 | /// </summary> |
38 | [DataNode("Author")] | 38 | [DataNode("Author")] |
39 | public class AuthorNode : DataNode | 39 | public class AuthorNode : DataNode |
40 | { | 40 | { |
41 | #region Fields | 41 | #region Fields |
42 | 42 | ||
43 | private string m_Signature; | 43 | private string m_Signature; |
44 | 44 | ||
45 | #endregion | 45 | #endregion |
46 | 46 | ||
47 | #region Properties | 47 | #region Properties |
48 | 48 | ||
49 | /// <summary> | 49 | /// <summary> |
50 | /// Gets the signature. | 50 | /// Gets the signature. |
51 | /// </summary> | 51 | /// </summary> |
52 | /// <value>The signature.</value> | 52 | /// <value>The signature.</value> |
53 | public string Signature | 53 | public string Signature |
54 | { | 54 | { |
55 | get | 55 | get |
56 | { | 56 | { |
57 | return m_Signature; | 57 | return m_Signature; |
58 | } | 58 | } |
59 | } | 59 | } |
60 | 60 | ||
61 | #endregion | 61 | #endregion |
62 | 62 | ||
63 | #region Public Methods | 63 | #region Public Methods |
64 | 64 | ||
65 | /// <summary> | 65 | /// <summary> |
66 | /// Parses the specified node. | 66 | /// Parses the specified node. |
67 | /// </summary> | 67 | /// </summary> |
68 | /// <param name="node">The node.</param> | 68 | /// <param name="node">The node.</param> |
69 | public override void Parse(XmlNode node) | 69 | public override void Parse(XmlNode node) |
70 | { | 70 | { |
71 | if( node == null ) | 71 | if( node == null ) |
72 | { | 72 | { |
73 | throw new ArgumentNullException("node"); | 73 | throw new ArgumentNullException("node"); |
74 | } | 74 | } |
75 | 75 | ||
76 | m_Signature = Helper.InterpolateForEnvironmentVariables(node.InnerText); | 76 | m_Signature = Helper.InterpolateForEnvironmentVariables(node.InnerText); |
77 | if(m_Signature == null) | 77 | if(m_Signature == null) |
78 | { | 78 | { |
79 | m_Signature = ""; | 79 | m_Signature = ""; |
80 | } | 80 | } |
81 | 81 | ||
82 | m_Signature = m_Signature.Trim(); | 82 | m_Signature = m_Signature.Trim(); |
83 | } | 83 | } |
84 | 84 | ||
85 | #endregion | 85 | #endregion |
86 | } | 86 | } |
87 | } | 87 | } |
diff --git a/Prebuild/src/Core/Nodes/CleanFilesNode.cs b/Prebuild/src/Core/Nodes/CleanFilesNode.cs index 71405f9..bd564d5 100644 --- a/Prebuild/src/Core/Nodes/CleanFilesNode.cs +++ b/Prebuild/src/Core/Nodes/CleanFilesNode.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2007 C.J. Adams-Collier (cjac@colliertech.org) | |||
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 |
diff --git a/Prebuild/src/Core/Nodes/CleanupNode.cs b/Prebuild/src/Core/Nodes/CleanupNode.cs index b8131b0..f334ea3 100644 --- a/Prebuild/src/Core/Nodes/CleanupNode.cs +++ b/Prebuild/src/Core/Nodes/CleanupNode.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2007 C.J. Adams-Collier (cjac@colliertech.org) | |||
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 |
@@ -35,40 +35,40 @@ namespace Prebuild.Core.Nodes | |||
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 | { |
@@ -78,8 +78,8 @@ namespace Prebuild.Core.Nodes | |||
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/ConfigurationNode.cs b/Prebuild/src/Core/Nodes/ConfigurationNode.cs index cd2f740..a101799 100644 --- a/Prebuild/src/Core/Nodes/ConfigurationNode.cs +++ b/Prebuild/src/Core/Nodes/ConfigurationNode.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
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 |
@@ -32,185 +32,185 @@ using Prebuild.Core.Utilities; | |||
32 | 32 | ||
33 | namespace Prebuild.Core.Nodes | 33 | namespace Prebuild.Core.Nodes |
34 | { | 34 | { |
35 | /// <summary> | 35 | /// <summary> |
36 | /// | 36 | /// |
37 | /// </summary> | 37 | /// </summary> |
38 | [DataNode("Configuration")] | 38 | [DataNode("Configuration")] |
39 | public class ConfigurationNode : DataNode, ICloneable, IComparable | 39 | public class ConfigurationNode : DataNode, ICloneable, IComparable |
40 | { | 40 | { |
41 | #region Fields | 41 | #region Fields |
42 | 42 | ||
43 | private string m_Name = "unknown"; | 43 | private string m_Name = "unknown"; |
44 | private string m_Platform = "AnyCPU"; | 44 | private string m_Platform = "AnyCPU"; |
45 | private OptionsNode m_Options; | 45 | private OptionsNode m_Options; |
46 | 46 | ||
47 | #endregion | 47 | #endregion |
48 | 48 | ||
49 | #region Constructors | 49 | #region Constructors |
50 | 50 | ||
51 | /// <summary> | 51 | /// <summary> |
52 | /// Initializes a new instance of the <see cref="ConfigurationNode"/> class. | 52 | /// Initializes a new instance of the <see cref="ConfigurationNode"/> class. |
53 | /// </summary> | 53 | /// </summary> |
54 | public ConfigurationNode() | 54 | public ConfigurationNode() |
55 | { | 55 | { |
56 | m_Options = new OptionsNode(); | 56 | m_Options = new OptionsNode(); |
57 | } | 57 | } |
58 | 58 | ||
59 | #endregion | 59 | #endregion |
60 | 60 | ||
61 | #region Properties | 61 | #region Properties |
62 | 62 | ||
63 | /// <summary> | 63 | /// <summary> |
64 | /// Gets or sets the parent. | 64 | /// Gets or sets the parent. |
65 | /// </summary> | 65 | /// </summary> |
66 | /// <value>The parent.</value> | 66 | /// <value>The parent.</value> |
67 | public override IDataNode Parent | 67 | public override IDataNode Parent |
68 | { | 68 | { |
69 | get | 69 | get |
70 | { | 70 | { |
71 | return base.Parent; | 71 | return base.Parent; |
72 | } | 72 | } |
73 | set | 73 | set |
74 | { | 74 | { |
75 | base.Parent = value; | 75 | base.Parent = value; |
76 | if(base.Parent is SolutionNode) | 76 | if(base.Parent is SolutionNode) |
77 | { | 77 | { |
78 | SolutionNode node = (SolutionNode)base.Parent; | 78 | SolutionNode node = (SolutionNode)base.Parent; |
79 | if(node != null && node.Options != null) | 79 | if(node != null && node.Options != null) |
80 | { | 80 | { |
81 | node.Options.CopyTo(m_Options); | 81 | node.Options.CopyTo(m_Options); |
82 | } | 82 | } |
83 | } | 83 | } |
84 | } | 84 | } |
85 | } | 85 | } |
86 | 86 | ||
87 | /// <summary> | 87 | /// <summary> |
88 | /// Identifies the platform for this specific configuration. | 88 | /// Identifies the platform for this specific configuration. |
89 | /// </summary> | 89 | /// </summary> |
90 | public string Platform | 90 | public string Platform |
91 | { | 91 | { |
92 | get | 92 | get |
93 | { | 93 | { |
94 | return m_Platform; | 94 | return m_Platform; |
95 | } | 95 | } |
96 | set | 96 | set |
97 | { | 97 | { |
98 | switch ((value + "").ToLower()) | 98 | switch ((value + "").ToLower()) |
99 | { | 99 | { |
100 | case "x86": | 100 | case "x86": |
101 | case "x64": | 101 | case "x64": |
102 | m_Platform = value; | 102 | m_Platform = value; |
103 | break; | 103 | break; |
104 | case "itanium": | 104 | case "itanium": |
105 | m_Platform = "Itanium"; | 105 | m_Platform = "Itanium"; |
106 | break; | 106 | break; |
107 | default: | 107 | default: |
108 | m_Platform = "AnyCPU"; | 108 | m_Platform = "AnyCPU"; |
109 | break; | 109 | break; |
110 | } | 110 | } |
111 | } | 111 | } |
112 | } | 112 | } |
113 | 113 | ||
114 | /// <summary> | 114 | /// <summary> |
115 | /// Gets the name. | 115 | /// Gets the name. |
116 | /// </summary> | 116 | /// </summary> |
117 | /// <value>The name.</value> | 117 | /// <value>The name.</value> |
118 | public string Name | 118 | public string Name |
119 | { | 119 | { |
120 | get | 120 | get |
121 | { | 121 | { |
122 | return m_Name; | 122 | return m_Name; |
123 | } | 123 | } |
124 | } | 124 | } |
125 | 125 | ||
126 | /// <summary> | 126 | /// <summary> |
127 | /// Gets the name and platform for the configuration. | 127 | /// Gets the name and platform for the configuration. |
128 | /// </summary> | 128 | /// </summary> |
129 | /// <value>The name and platform.</value> | 129 | /// <value>The name and platform.</value> |
130 | public string NameAndPlatform | 130 | public string NameAndPlatform |
131 | { | 131 | { |
132 | get | 132 | get |
133 | { | 133 | { |
134 | string platform = m_Platform; | 134 | string platform = m_Platform; |
135 | if (platform == "AnyCPU") | 135 | if (platform == "AnyCPU") |
136 | platform = "Any CPU"; | 136 | platform = "Any CPU"; |
137 | 137 | ||
138 | return String.Format("{0}|{1}", m_Name, platform); | 138 | return String.Format("{0}|{1}", m_Name, platform); |
139 | } | 139 | } |
140 | } | 140 | } |
141 | 141 | ||
142 | /// <summary> | 142 | /// <summary> |
143 | /// Gets or sets the options. | 143 | /// Gets or sets the options. |
144 | /// </summary> | 144 | /// </summary> |
145 | /// <value>The options.</value> | 145 | /// <value>The options.</value> |
146 | public OptionsNode Options | 146 | public OptionsNode Options |
147 | { | 147 | { |
148 | get | 148 | get |
149 | { | 149 | { |
150 | return m_Options; | 150 | return m_Options; |
151 | } | 151 | } |
152 | set | 152 | set |
153 | { | 153 | { |
154 | m_Options = value; | 154 | m_Options = value; |
155 | } | 155 | } |
156 | } | 156 | } |
157 | 157 | ||
158 | #endregion | 158 | #endregion |
159 | 159 | ||
160 | #region Public Methods | 160 | #region Public Methods |
161 | 161 | ||
162 | /// <summary> | 162 | /// <summary> |
163 | /// Parses the specified node. | 163 | /// Parses the specified node. |
164 | /// </summary> | 164 | /// </summary> |
165 | /// <param name="node">The node.</param> | 165 | /// <param name="node">The node.</param> |
166 | public override void Parse(XmlNode node) | 166 | public override void Parse(XmlNode node) |
167 | { | 167 | { |
168 | m_Name = Helper.AttributeValue(node, "name", m_Name); | 168 | m_Name = Helper.AttributeValue(node, "name", m_Name); |
169 | Platform = Helper.AttributeValue(node, "platform", m_Platform); | 169 | Platform = Helper.AttributeValue(node, "platform", m_Platform); |
170 | 170 | ||
171 | if (node == null) | 171 | if (node == null) |
172 | { | 172 | { |
173 | throw new ArgumentNullException("node"); | 173 | throw new ArgumentNullException("node"); |
174 | } | 174 | } |
175 | foreach(XmlNode child in node.ChildNodes) | 175 | foreach(XmlNode child in node.ChildNodes) |
176 | { | 176 | { |
177 | IDataNode dataNode = Kernel.Instance.ParseNode(child, this); | 177 | IDataNode dataNode = Kernel.Instance.ParseNode(child, this); |
178 | if(dataNode is OptionsNode) | 178 | if(dataNode is OptionsNode) |
179 | { | 179 | { |
180 | ((OptionsNode)dataNode).CopyTo(m_Options); | 180 | ((OptionsNode)dataNode).CopyTo(m_Options); |
181 | } | 181 | } |
182 | } | 182 | } |
183 | } | 183 | } |
184 | 184 | ||
185 | /// <summary> | 185 | /// <summary> |
186 | /// Copies to. | 186 | /// Copies to. |
187 | /// </summary> | 187 | /// </summary> |
188 | /// <param name="conf">The conf.</param> | 188 | /// <param name="conf">The conf.</param> |
189 | public void CopyTo(ConfigurationNode conf) | 189 | public void CopyTo(ConfigurationNode conf) |
190 | { | 190 | { |
191 | m_Options.CopyTo(conf.m_Options); | 191 | m_Options.CopyTo(conf.m_Options); |
192 | } | 192 | } |
193 | 193 | ||
194 | #endregion | 194 | #endregion |
195 | 195 | ||
196 | #region ICloneable Members | 196 | #region ICloneable Members |
197 | 197 | ||
198 | /// <summary> | 198 | /// <summary> |
199 | /// Creates a new object that is a copy of the current instance. | 199 | /// Creates a new object that is a copy of the current instance. |
200 | /// </summary> | 200 | /// </summary> |
201 | /// <returns> | 201 | /// <returns> |
202 | /// A new object that is a copy of this instance. | 202 | /// A new object that is a copy of this instance. |
203 | /// </returns> | 203 | /// </returns> |
204 | public object Clone() | 204 | public object Clone() |
205 | { | 205 | { |
206 | ConfigurationNode ret = new ConfigurationNode(); | 206 | ConfigurationNode ret = new ConfigurationNode(); |
207 | ret.m_Name = m_Name; | 207 | ret.m_Name = m_Name; |
208 | ret.m_Platform = m_Platform; | 208 | ret.m_Platform = m_Platform; |
209 | m_Options.CopyTo(ret.m_Options); | 209 | m_Options.CopyTo(ret.m_Options); |
210 | return ret; | 210 | return ret; |
211 | } | 211 | } |
212 | 212 | ||
213 | #endregion | 213 | #endregion |
214 | 214 | ||
215 | #region IComparable Members | 215 | #region IComparable Members |
216 | 216 | ||
@@ -221,5 +221,5 @@ namespace Prebuild.Core.Nodes | |||
221 | } | 221 | } |
222 | 222 | ||
223 | #endregion | 223 | #endregion |
224 | } | 224 | } |
225 | } | 225 | } |
diff --git a/Prebuild/src/Core/Nodes/ConfigurationNodeCollection.cs b/Prebuild/src/Core/Nodes/ConfigurationNodeCollection.cs index 1c38d9e..eba6550 100644 --- a/Prebuild/src/Core/Nodes/ConfigurationNodeCollection.cs +++ b/Prebuild/src/Core/Nodes/ConfigurationNodeCollection.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
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 |
@@ -27,45 +27,45 @@ 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/DataNode.cs b/Prebuild/src/Core/Nodes/DataNode.cs index 318b13c..4f20588 100644 --- a/Prebuild/src/Core/Nodes/DataNode.cs +++ b/Prebuild/src/Core/Nodes/DataNode.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
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 |
@@ -32,86 +32,86 @@ using System.IO; | |||
32 | 32 | ||
33 | namespace Prebuild.Core.Nodes | 33 | namespace Prebuild.Core.Nodes |
34 | { | 34 | { |
35 | /// <summary> | 35 | /// <summary> |
36 | /// | 36 | /// |
37 | /// </summary> | 37 | /// </summary> |
38 | public abstract class DataNode : IDataNode | 38 | public abstract class DataNode : IDataNode |
39 | { | 39 | { |
40 | #region Fields | 40 | #region Fields |
41 | 41 | ||
42 | private IDataNode parent; | 42 | private IDataNode parent; |
43 | string[] m_WebTypes = new string[] { "aspx", "ascx", "master", "ashx", "asmx" }; | 43 | string[] m_WebTypes = new string[] { "aspx", "ascx", "master", "ashx", "asmx" }; |
44 | 44 | ||
45 | #endregion | 45 | #endregion |
46 | 46 | ||
47 | #region IDataNode Members | 47 | #region IDataNode Members |
48 | 48 | ||
49 | /// <summary> | 49 | /// <summary> |
50 | /// Gets or sets the parent. | 50 | /// Gets or sets the parent. |
51 | /// </summary> | 51 | /// </summary> |
52 | /// <value>The parent.</value> | 52 | /// <value>The parent.</value> |
53 | public virtual IDataNode Parent | 53 | public virtual IDataNode Parent |
54 | { | 54 | { |
55 | get | 55 | get |
56 | { | 56 | { |
57 | return parent; | 57 | return parent; |
58 | } | 58 | } |
59 | set | 59 | set |
60 | { | 60 | { |
61 | parent = value; | 61 | parent = value; |
62 | } | 62 | } |
63 | } | 63 | } |
64 | public string[] WebTypes | 64 | public string[] WebTypes |
65 | { | 65 | { |
66 | get { return m_WebTypes; } | 66 | get { return m_WebTypes; } |
67 | } | 67 | } |
68 | /// <summary> | 68 | /// <summary> |
69 | /// Parses the specified node. | 69 | /// Parses the specified node. |
70 | /// </summary> | 70 | /// </summary> |
71 | /// <param name="node">The node.</param> | 71 | /// <param name="node">The node.</param> |
72 | public virtual void Parse(XmlNode node) | 72 | public virtual void Parse(XmlNode node) |
73 | { | 73 | { |
74 | } | 74 | } |
75 | public BuildAction GetBuildActionByFileName(string fileName) | 75 | public BuildAction GetBuildActionByFileName(string fileName) |
76 | { | 76 | { |
77 | string extension = Path.GetExtension(fileName).ToLower(); | 77 | string extension = Path.GetExtension(fileName).ToLower(); |
78 | foreach (string type in WebTypes) | 78 | foreach (string type in WebTypes) |
79 | { | 79 | { |
80 | if (extension == type) | 80 | if (extension == type) |
81 | return BuildAction.Content; | 81 | return BuildAction.Content; |
82 | } | 82 | } |
83 | return BuildAction.Compile; | 83 | return BuildAction.Compile; |
84 | } | 84 | } |
85 | /// <summary> | 85 | /// <summary> |
86 | /// Parses the file type to figure out what type it is | 86 | /// Parses the file type to figure out what type it is |
87 | /// </summary> | 87 | /// </summary> |
88 | /// <returns></returns> | 88 | /// <returns></returns> |
89 | public SubType GetSubTypeByFileName(string fileName) | 89 | public SubType GetSubTypeByFileName(string fileName) |
90 | { | 90 | { |
91 | string extension = System.IO.Path.GetExtension(fileName).ToLower(); | 91 | string extension = System.IO.Path.GetExtension(fileName).ToLower(); |
92 | string designer = String.Format(".designer{0}", extension); | 92 | string designer = String.Format(".designer{0}", extension); |
93 | string path = fileName.ToLower(); | 93 | string path = fileName.ToLower(); |
94 | if (extension == ".resx") | 94 | if (extension == ".resx") |
95 | { | 95 | { |
96 | return SubType.Designer; | 96 | return SubType.Designer; |
97 | } | 97 | } |
98 | else if (path.EndsWith(".settings")) | 98 | else if (path.EndsWith(".settings")) |
99 | { | 99 | { |
100 | return SubType.Settings; | 100 | return SubType.Settings; |
101 | } | 101 | } |
102 | else | 102 | else |
103 | { | 103 | { |
104 | 104 | ||
105 | foreach (string type in WebTypes) | 105 | foreach (string type in WebTypes) |
106 | { | 106 | { |
107 | if (path.EndsWith(type)) | 107 | if (path.EndsWith(type)) |
108 | { | 108 | { |
109 | return SubType.CodeBehind; | 109 | return SubType.CodeBehind; |
110 | } | 110 | } |
111 | } | 111 | } |
112 | } | 112 | } |
113 | return SubType.Code; | 113 | return SubType.Code; |
114 | } | 114 | } |
115 | #endregion | 115 | #endregion |
116 | } | 116 | } |
117 | } | 117 | } |
diff --git a/Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs b/Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs index 845db24..974b74e 100644 --- a/Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs +++ b/Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs | |||
@@ -43,18 +43,18 @@ namespace Prebuild.Core.Nodes | |||
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); |
diff --git a/Prebuild/src/Core/Nodes/DescriptionNode.cs b/Prebuild/src/Core/Nodes/DescriptionNode.cs index d1293a0..713b47c 100644 --- a/Prebuild/src/Core/Nodes/DescriptionNode.cs +++ b/Prebuild/src/Core/Nodes/DescriptionNode.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2007 C.J. Adams-Collier (cjac@colliertech.org) | |||
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 |
@@ -32,56 +32,56 @@ using Prebuild.Core.Utilities; | |||
32 | 32 | ||
33 | namespace Prebuild.Core.Nodes | 33 | namespace Prebuild.Core.Nodes |
34 | { | 34 | { |
35 | /// <summary> | 35 | /// <summary> |
36 | /// The object representing the /Prebuild/Solution/Project/Description element | 36 | /// The object representing the /Prebuild/Solution/Project/Description element |
37 | /// </summary> | 37 | /// </summary> |
38 | [DataNode("Description")] | 38 | [DataNode("Description")] |
39 | public class DescriptionNode : DataNode | 39 | public class DescriptionNode : DataNode |
40 | { | 40 | { |
41 | #region Fields | 41 | #region Fields |
42 | 42 | ||
43 | private string m_Value; | 43 | private string m_Value; |
44 | 44 | ||
45 | #endregion | 45 | #endregion |
46 | 46 | ||
47 | #region Properties | 47 | #region Properties |
48 | 48 | ||
49 | /// <summary> | 49 | /// <summary> |
50 | /// Gets the description Value. | 50 | /// Gets the description Value. |
51 | /// </summary> | 51 | /// </summary> |
52 | /// <value>The description Value.</value> | 52 | /// <value>The description Value.</value> |
53 | public string Value | 53 | public string Value |
54 | { | 54 | { |
55 | get | 55 | get |
56 | { | 56 | { |
57 | return m_Value; | 57 | return m_Value; |
58 | } | 58 | } |
59 | } | 59 | } |
60 | 60 | ||
61 | #endregion | 61 | #endregion |
62 | 62 | ||
63 | #region Public Methods | 63 | #region Public Methods |
64 | 64 | ||
65 | /// <summary> | 65 | /// <summary> |
66 | /// Parses the specified node. | 66 | /// Parses the specified node. |
67 | /// </summary> | 67 | /// </summary> |
68 | /// <param name="node">The node.</param> | 68 | /// <param name="node">The node.</param> |
69 | public override void Parse(XmlNode node) | 69 | public override void Parse(XmlNode node) |
70 | { | 70 | { |
71 | if( node == null ) | 71 | if( node == null ) |
72 | { | 72 | { |
73 | throw new ArgumentNullException("node"); | 73 | throw new ArgumentNullException("node"); |
74 | } | 74 | } |
75 | 75 | ||
76 | m_Value = Helper.InterpolateForEnvironmentVariables(node.InnerText); | 76 | m_Value = Helper.InterpolateForEnvironmentVariables(node.InnerText); |
77 | if(m_Value == null) | 77 | if(m_Value == null) |
78 | { | 78 | { |
79 | m_Value = ""; | 79 | m_Value = ""; |
80 | } | 80 | } |
81 | 81 | ||
82 | m_Value = m_Value.Trim(); | 82 | m_Value = m_Value.Trim(); |
83 | } | 83 | } |
84 | 84 | ||
85 | #endregion | 85 | #endregion |
86 | } | 86 | } |
87 | } | 87 | } |
diff --git a/Prebuild/src/Core/Nodes/ExcludeNode.cs b/Prebuild/src/Core/Nodes/ExcludeNode.cs index 7f04cba..addbdb4 100644 --- a/Prebuild/src/Core/Nodes/ExcludeNode.cs +++ b/Prebuild/src/Core/Nodes/ExcludeNode.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
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 |
@@ -32,31 +32,31 @@ using Prebuild.Core.Utilities; | |||
32 | 32 | ||
33 | namespace Prebuild.Core.Nodes | 33 | namespace Prebuild.Core.Nodes |
34 | { | 34 | { |
35 | /// <summary> | 35 | /// <summary> |
36 | /// | 36 | /// |
37 | /// </summary> | 37 | /// </summary> |
38 | [DataNode("Exclude")] | 38 | [DataNode("Exclude")] |
39 | public class ExcludeNode : DataNode | 39 | public class ExcludeNode : DataNode |
40 | { | 40 | { |
41 | #region Fields | 41 | #region Fields |
42 | 42 | ||
43 | private string m_Pattern = ""; | 43 | private string m_Pattern = ""; |
44 | 44 | ||
45 | #endregion | 45 | #endregion |
46 | 46 | ||
47 | #region Properties | 47 | #region Properties |
48 | 48 | ||
49 | /// <summary> | 49 | /// <summary> |
50 | /// Gets the name. | 50 | /// Gets the name. |
51 | /// </summary> | 51 | /// </summary> |
52 | /// <value>The name.</value> | 52 | /// <value>The name.</value> |
53 | public string Name | 53 | public string Name |
54 | { | 54 | { |
55 | get | 55 | get |
56 | { | 56 | { |
57 | return m_Pattern; | 57 | return m_Pattern; |
58 | } | 58 | } |
59 | } | 59 | } |
60 | 60 | ||
61 | /// <summary> | 61 | /// <summary> |
62 | /// Gets the pattern. | 62 | /// Gets the pattern. |
@@ -72,18 +72,18 @@ namespace Prebuild.Core.Nodes | |||
72 | 72 | ||
73 | #endregion | 73 | #endregion |
74 | 74 | ||
75 | #region Public Methods | 75 | #region Public Methods |
76 | 76 | ||
77 | /// <summary> | 77 | /// <summary> |
78 | /// Parses the specified node. | 78 | /// Parses the specified node. |
79 | /// </summary> | 79 | /// </summary> |
80 | /// <param name="node">The node.</param> | 80 | /// <param name="node">The node.</param> |
81 | public override void Parse(XmlNode node) | 81 | public override void Parse(XmlNode node) |
82 | { | 82 | { |
83 | m_Pattern = Helper.AttributeValue( node, "name", m_Pattern ); | 83 | m_Pattern = Helper.AttributeValue( node, "name", m_Pattern ); |
84 | m_Pattern = Helper.AttributeValue(node, "pattern", m_Pattern ); | 84 | m_Pattern = Helper.AttributeValue(node, "pattern", m_Pattern ); |
85 | } | 85 | } |
86 | 86 | ||
87 | #endregion | 87 | #endregion |
88 | } | 88 | } |
89 | } | 89 | } |
diff --git a/Prebuild/src/Core/Nodes/FileNode.cs b/Prebuild/src/Core/Nodes/FileNode.cs index b313ffa..c66f123 100644 --- a/Prebuild/src/Core/Nodes/FileNode.cs +++ b/Prebuild/src/Core/Nodes/FileNode.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
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 |
@@ -34,193 +34,193 @@ using Prebuild.Core.Targets; | |||
34 | 34 | ||
35 | namespace Prebuild.Core.Nodes | 35 | namespace Prebuild.Core.Nodes |
36 | { | 36 | { |
37 | /// <summary> | 37 | /// <summary> |
38 | /// | 38 | /// |
39 | /// </summary> | 39 | /// </summary> |
40 | public enum BuildAction | 40 | public enum BuildAction |
41 | { | 41 | { |
42 | /// <summary> | ||
43 | /// | ||
44 | /// </summary> | ||
45 | None, | ||
46 | /// <summary> | ||
47 | /// | ||
48 | /// </summary> | ||
49 | Compile, | ||
50 | /// <summary> | ||
51 | /// | ||
52 | /// </summary> | ||
53 | Content, | ||
54 | /// <summary> | ||
55 | /// | ||
56 | /// </summary> | ||
57 | EmbeddedResource, | ||
58 | /// <summary> | ||
59 | /// | ||
60 | /// </summary> | ||
61 | ApplicationDefinition, | ||
62 | /// <summary> | ||
63 | /// | ||
64 | /// </summary> | ||
65 | Page, | ||
66 | /// <summary> | 42 | /// <summary> |
67 | /// | 43 | /// |
44 | /// </summary> | ||
45 | None, | ||
46 | /// <summary> | ||
47 | /// | ||
48 | /// </summary> | ||
49 | Compile, | ||
50 | /// <summary> | ||
51 | /// | ||
52 | /// </summary> | ||
53 | Content, | ||
54 | /// <summary> | ||
55 | /// | ||
56 | /// </summary> | ||
57 | EmbeddedResource, | ||
58 | /// <summary> | ||
59 | /// | ||
60 | /// </summary> | ||
61 | ApplicationDefinition, | ||
62 | /// <summary> | ||
63 | /// | ||
64 | /// </summary> | ||
65 | Page, | ||
66 | /// <summary> | ||
67 | /// | ||
68 | /// </summary> | 68 | /// </summary> |
69 | Copy | 69 | Copy |
70 | } | 70 | } |
71 | 71 | ||
72 | /// <summary> | 72 | /// <summary> |
73 | /// | 73 | /// |
74 | /// </summary> | 74 | /// </summary> |
75 | public enum SubType | 75 | public enum SubType |
76 | { | 76 | { |
77 | /// <summary> | ||
78 | /// | ||
79 | /// </summary> | ||
80 | Code, | ||
81 | /// <summary> | ||
82 | /// | ||
83 | /// </summary> | ||
84 | Component, | ||
85 | /// <summary> | 77 | /// <summary> |
86 | /// | 78 | /// |
79 | /// </summary> | ||
80 | Code, | ||
81 | /// <summary> | ||
82 | /// | ||
83 | /// </summary> | ||
84 | Component, | ||
85 | /// <summary> | ||
86 | /// | ||
87 | /// </summary> | 87 | /// </summary> |
88 | Designer, | 88 | Designer, |
89 | /// <summary> | 89 | /// <summary> |
90 | /// | 90 | /// |
91 | /// </summary> | 91 | /// </summary> |
92 | Form, | 92 | Form, |
93 | /// <summary> | 93 | /// <summary> |
94 | /// | 94 | /// |
95 | /// </summary> | 95 | /// </summary> |
96 | Settings, | 96 | Settings, |
97 | /// <summary> | 97 | /// <summary> |
98 | /// | 98 | /// |
99 | /// </summary> | 99 | /// </summary> |
100 | UserControl, | 100 | UserControl, |
101 | /// <summary> | 101 | /// <summary> |
102 | /// | 102 | /// |
103 | /// </summary> | 103 | /// </summary> |
104 | CodeBehind, | 104 | CodeBehind, |
105 | } | 105 | } |
106 | 106 | ||
107 | public enum CopyToOutput | 107 | public enum CopyToOutput |
108 | { | 108 | { |
109 | Never, | 109 | Never, |
110 | Always, | 110 | Always, |
111 | PreserveNewest | 111 | PreserveNewest |
112 | } | 112 | } |
113 | 113 | ||
114 | /// <summary> | 114 | /// <summary> |
115 | /// | 115 | /// |
116 | /// </summary> | 116 | /// </summary> |
117 | [DataNode("File")] | 117 | [DataNode("File")] |
118 | public class FileNode : DataNode | 118 | public class FileNode : DataNode |
119 | { | 119 | { |
120 | #region Fields | 120 | #region Fields |
121 | 121 | ||
122 | private string m_Path; | 122 | private string m_Path; |
123 | private string m_ResourceName = ""; | 123 | private string m_ResourceName = ""; |
124 | private BuildAction? m_BuildAction; | 124 | private BuildAction? m_BuildAction; |
125 | private bool m_Valid; | 125 | private bool m_Valid; |
126 | private SubType? m_SubType; | 126 | private SubType? m_SubType; |
127 | private CopyToOutput m_CopyToOutput = CopyToOutput.Never; | 127 | private CopyToOutput m_CopyToOutput = CopyToOutput.Never; |
128 | private bool m_Link = false; | 128 | private bool m_Link = false; |
129 | private string m_LinkPath = string.Empty; | 129 | private string m_LinkPath = string.Empty; |
130 | private bool m_PreservePath = false; | 130 | private bool m_PreservePath = false; |
131 | 131 | ||
132 | 132 | ||
133 | #endregion | 133 | #endregion |
134 | 134 | ||
135 | #region Properties | 135 | #region Properties |
136 | 136 | ||
137 | /// <summary> | 137 | /// <summary> |
138 | /// | 138 | /// |
139 | /// </summary> | 139 | /// </summary> |
140 | public string Path | 140 | public string Path |
141 | { | 141 | { |
142 | get | 142 | get |
143 | { | 143 | { |
144 | return m_Path; | 144 | return m_Path; |
145 | } | 145 | } |
146 | } | 146 | } |
147 | 147 | ||
148 | /// <summary> | 148 | /// <summary> |
149 | /// | 149 | /// |
150 | /// </summary> | 150 | /// </summary> |
151 | public string ResourceName | 151 | public string ResourceName |
152 | { | 152 | { |
153 | get | 153 | get |
154 | { | 154 | { |
155 | return m_ResourceName; | 155 | return m_ResourceName; |
156 | } | 156 | } |
157 | } | 157 | } |
158 | 158 | ||
159 | /// <summary> | 159 | /// <summary> |
160 | /// | 160 | /// |
161 | /// </summary> | 161 | /// </summary> |
162 | public BuildAction BuildAction | 162 | public BuildAction BuildAction |
163 | { | 163 | { |
164 | get | 164 | get |
165 | { | 165 | { |
166 | if (m_BuildAction != null) | 166 | if (m_BuildAction != null) |
167 | return m_BuildAction.Value; | 167 | return m_BuildAction.Value; |
168 | else | 168 | else |
169 | return GetBuildActionByFileName(this.Path); | 169 | return GetBuildActionByFileName(this.Path); |
170 | 170 | ||
171 | } | 171 | } |
172 | } | 172 | } |
173 | 173 | ||
174 | public CopyToOutput CopyToOutput | 174 | public CopyToOutput CopyToOutput |
175 | { | 175 | { |
176 | get | 176 | get |
177 | { | 177 | { |
178 | return this.m_CopyToOutput; | 178 | return this.m_CopyToOutput; |
179 | } | 179 | } |
180 | } | 180 | } |
181 | |||
182 | public bool IsLink | ||
183 | { | ||
184 | get | ||
185 | { | ||
186 | return this.m_Link; | ||
187 | } | ||
188 | } | ||
189 | |||
190 | public string LinkPath | ||
191 | { | ||
192 | get | ||
193 | { | ||
194 | return this.m_LinkPath; | ||
195 | } | ||
196 | } | ||
197 | /// <summary> | ||
198 | /// | ||
199 | /// </summary> | ||
200 | public SubType SubType | ||
201 | { | ||
202 | get | ||
203 | { | ||
204 | if (m_SubType != null) | ||
205 | return m_SubType.Value; | ||
206 | else | ||
207 | return GetSubTypeByFileName(this.Path); | ||
208 | } | ||
209 | } | ||
210 | |||
211 | /// <summary> | ||
212 | /// | ||
213 | /// </summary> | ||
214 | public bool IsValid | ||
215 | { | ||
216 | get | ||
217 | { | ||
218 | return m_Valid; | ||
219 | } | ||
220 | } | ||
221 | 181 | ||
182 | public bool IsLink | ||
183 | { | ||
184 | get | ||
185 | { | ||
186 | return this.m_Link; | ||
187 | } | ||
188 | } | ||
189 | |||
190 | public string LinkPath | ||
191 | { | ||
192 | get | ||
193 | { | ||
194 | return this.m_LinkPath; | ||
195 | } | ||
196 | } | ||
222 | /// <summary> | 197 | /// <summary> |
223 | /// | 198 | /// |
199 | /// </summary> | ||
200 | public SubType SubType | ||
201 | { | ||
202 | get | ||
203 | { | ||
204 | if (m_SubType != null) | ||
205 | return m_SubType.Value; | ||
206 | else | ||
207 | return GetSubTypeByFileName(this.Path); | ||
208 | } | ||
209 | } | ||
210 | |||
211 | /// <summary> | ||
212 | /// | ||
213 | /// </summary> | ||
214 | public bool IsValid | ||
215 | { | ||
216 | get | ||
217 | { | ||
218 | return m_Valid; | ||
219 | } | ||
220 | } | ||
221 | |||
222 | /// <summary> | ||
223 | /// | ||
224 | /// </summary> | 224 | /// </summary> |
225 | /// <param name="file"></param> | 225 | /// <param name="file"></param> |
226 | /// <returns></returns> | 226 | /// <returns></returns> |
@@ -232,61 +232,61 @@ namespace Prebuild.Core.Nodes | |||
232 | } | 232 | } |
233 | } | 233 | } |
234 | 234 | ||
235 | #endregion | 235 | #endregion |
236 | 236 | ||
237 | #region Public Methods | 237 | #region Public Methods |
238 | 238 | ||
239 | /// <summary> | 239 | /// <summary> |
240 | /// | 240 | /// |
241 | /// </summary> | 241 | /// </summary> |
242 | /// <param name="node"></param> | 242 | /// <param name="node"></param> |
243 | public override void Parse(XmlNode node) | 243 | public override void Parse(XmlNode node) |
244 | { | 244 | { |
245 | string buildAction = Helper.AttributeValue(node, "buildAction", String.Empty); | 245 | string buildAction = Helper.AttributeValue(node, "buildAction", String.Empty); |
246 | if (buildAction != string.Empty) | 246 | if (buildAction != string.Empty) |
247 | m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction), buildAction); | 247 | m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction), buildAction); |
248 | string subType = Helper.AttributeValue(node, "subType", string.Empty); | 248 | string subType = Helper.AttributeValue(node, "subType", string.Empty); |
249 | if (subType != String.Empty) | 249 | if (subType != String.Empty) |
250 | m_SubType = (SubType)Enum.Parse(typeof(SubType), subType); | 250 | m_SubType = (SubType)Enum.Parse(typeof(SubType), subType); |
251 | 251 | ||
252 | Console.WriteLine("[FileNode]:BuildAction is {0}", buildAction); | 252 | Console.WriteLine("[FileNode]:BuildAction is {0}", buildAction); |
253 | 253 | ||
254 | 254 | ||
255 | m_ResourceName = Helper.AttributeValue(node, "resourceName", m_ResourceName.ToString()); | 255 | m_ResourceName = Helper.AttributeValue(node, "resourceName", m_ResourceName.ToString()); |
256 | this.m_Link = bool.Parse(Helper.AttributeValue(node, "link", bool.FalseString)); | 256 | this.m_Link = bool.Parse(Helper.AttributeValue(node, "link", bool.FalseString)); |
257 | if ( this.m_Link == true ) | 257 | if ( this.m_Link == true ) |
258 | { | 258 | { |
259 | this.m_LinkPath = Helper.AttributeValue( node, "linkPath", string.Empty ); | 259 | this.m_LinkPath = Helper.AttributeValue( node, "linkPath", string.Empty ); |
260 | } | 260 | } |
261 | this.m_CopyToOutput = (CopyToOutput) Enum.Parse(typeof(CopyToOutput), Helper.AttributeValue(node, "copyToOutput", this.m_CopyToOutput.ToString())); | 261 | this.m_CopyToOutput = (CopyToOutput) Enum.Parse(typeof(CopyToOutput), Helper.AttributeValue(node, "copyToOutput", this.m_CopyToOutput.ToString())); |
262 | this.m_PreservePath = bool.Parse( Helper.AttributeValue( node, "preservePath", bool.FalseString ) ); | 262 | this.m_PreservePath = bool.Parse( Helper.AttributeValue( node, "preservePath", bool.FalseString ) ); |
263 | 263 | ||
264 | if( node == null ) | 264 | if( node == null ) |
265 | { | 265 | { |
266 | throw new ArgumentNullException("node"); | 266 | throw new ArgumentNullException("node"); |
267 | } | 267 | } |
268 | 268 | ||
269 | m_Path = Helper.InterpolateForEnvironmentVariables(node.InnerText); | 269 | m_Path = Helper.InterpolateForEnvironmentVariables(node.InnerText); |
270 | if(m_Path == null) | 270 | if(m_Path == null) |
271 | { | 271 | { |
272 | m_Path = ""; | 272 | m_Path = ""; |
273 | } | 273 | } |
274 | 274 | ||
275 | m_Path = m_Path.Trim(); | 275 | m_Path = m_Path.Trim(); |
276 | m_Valid = true; | 276 | m_Valid = true; |
277 | if(!File.Exists(m_Path)) | 277 | if(!File.Exists(m_Path)) |
278 | { | 278 | { |
279 | m_Valid = false; | 279 | m_Valid = false; |
280 | Kernel.Instance.Log.Write(LogType.Warning, "File does not exist: {0}", m_Path); | 280 | Kernel.Instance.Log.Write(LogType.Warning, "File does not exist: {0}", m_Path); |
281 | } | 281 | } |
282 | 282 | ||
283 | if (System.IO.Path.GetExtension(m_Path) == ".settings") | 283 | if (System.IO.Path.GetExtension(m_Path) == ".settings") |
284 | { | 284 | { |
285 | m_SubType = SubType.Settings; | 285 | m_SubType = SubType.Settings; |
286 | m_BuildAction = BuildAction.None; | 286 | m_BuildAction = BuildAction.None; |
287 | } | 287 | } |
288 | } | 288 | } |
289 | 289 | ||
290 | #endregion | 290 | #endregion |
291 | } | 291 | } |
292 | } | 292 | } |
diff --git a/Prebuild/src/Core/Nodes/FilesNode.cs b/Prebuild/src/Core/Nodes/FilesNode.cs index 16658f3..58b54fb 100644 --- a/Prebuild/src/Core/Nodes/FilesNode.cs +++ b/Prebuild/src/Core/Nodes/FilesNode.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
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 |
@@ -34,36 +34,36 @@ using System.IO; | |||
34 | 34 | ||
35 | namespace Prebuild.Core.Nodes | 35 | namespace Prebuild.Core.Nodes |
36 | { | 36 | { |
37 | /// <summary> | 37 | /// <summary> |
38 | /// | 38 | /// |
39 | /// </summary> | 39 | /// </summary> |
40 | [DataNode("Files")] | 40 | [DataNode("Files")] |
41 | public class FilesNode : DataNode | 41 | public class FilesNode : DataNode |
42 | { | 42 | { |
43 | #region Fields | 43 | #region Fields |
44 | 44 | ||
45 | private readonly List<string> m_Files = new List<string>(); | 45 | private readonly List<string> m_Files = new List<string>(); |
46 | private readonly Dictionary<string,BuildAction> m_BuildActions = new Dictionary<string, BuildAction>(); | 46 | private readonly Dictionary<string,BuildAction> m_BuildActions = new Dictionary<string, BuildAction>(); |
47 | private readonly Dictionary<string, SubType> m_SubTypes = new Dictionary<string, SubType>(); | 47 | private readonly Dictionary<string, SubType> m_SubTypes = new Dictionary<string, SubType>(); |
48 | private readonly Dictionary<string, string> m_ResourceNames = new Dictionary<string, string>(); | 48 | private readonly Dictionary<string, string> m_ResourceNames = new Dictionary<string, string>(); |
49 | private readonly Dictionary<string, CopyToOutput> m_CopyToOutputs = new Dictionary<string, CopyToOutput>(); | 49 | private readonly Dictionary<string, CopyToOutput> m_CopyToOutputs = new Dictionary<string, CopyToOutput>(); |
50 | private readonly Dictionary<string, bool> m_Links = new Dictionary<string, bool>(); | 50 | private readonly Dictionary<string, bool> m_Links = new Dictionary<string, bool>(); |
51 | private readonly Dictionary<string, string> m_LinkPaths = new Dictionary<string, string>(); | 51 | private readonly Dictionary<string, string> m_LinkPaths = new Dictionary<string, string>(); |
52 | 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>(); | 53 | private readonly Dictionary<string, string> m_DestinationPath = new Dictionary<string, string>(); |
54 | private readonly NameValueCollection m_CopyFiles = new NameValueCollection(); | 54 | private readonly NameValueCollection m_CopyFiles = new NameValueCollection(); |
55 | 55 | ||
56 | #endregion | 56 | #endregion |
57 | 57 | ||
58 | #region Properties | 58 | #region Properties |
59 | 59 | ||
60 | public int Count | 60 | public int Count |
61 | { | 61 | { |
62 | get | 62 | get |
63 | { | 63 | { |
64 | return m_Files.Count; | 64 | return m_Files.Count; |
65 | } | 65 | } |
66 | } | 66 | } |
67 | 67 | ||
68 | public string[] Destinations | 68 | public string[] Destinations |
69 | { | 69 | { |
@@ -75,19 +75,19 @@ namespace Prebuild.Core.Nodes | |||
75 | get { return m_CopyFiles.Count; } | 75 | get { return m_CopyFiles.Count; } |
76 | } | 76 | } |
77 | 77 | ||
78 | #endregion | 78 | #endregion |
79 | 79 | ||
80 | #region Public Methods | 80 | #region Public Methods |
81 | 81 | ||
82 | public BuildAction GetBuildAction(string file) | 82 | public BuildAction GetBuildAction(string file) |
83 | { | 83 | { |
84 | if(!m_BuildActions.ContainsKey(file)) | 84 | if(!m_BuildActions.ContainsKey(file)) |
85 | { | 85 | { |
86 | return BuildAction.Compile; | 86 | return BuildAction.Compile; |
87 | } | 87 | } |
88 | 88 | ||
89 | return m_BuildActions[file]; | 89 | return m_BuildActions[file]; |
90 | } | 90 | } |
91 | 91 | ||
92 | public string GetDestinationPath(string file) | 92 | public string GetDestinationPath(string file) |
93 | { | 93 | { |
@@ -103,57 +103,57 @@ namespace Prebuild.Core.Nodes | |||
103 | return m_CopyFiles.GetValues(dest); | 103 | return m_CopyFiles.GetValues(dest); |
104 | } | 104 | } |
105 | 105 | ||
106 | public CopyToOutput GetCopyToOutput(string file) | 106 | public CopyToOutput GetCopyToOutput(string file) |
107 | { | 107 | { |
108 | if (!m_CopyToOutputs.ContainsKey(file)) | 108 | if (!m_CopyToOutputs.ContainsKey(file)) |
109 | { | 109 | { |
110 | return CopyToOutput.Never; | 110 | return CopyToOutput.Never; |
111 | } | 111 | } |
112 | return m_CopyToOutputs[file]; | 112 | return m_CopyToOutputs[file]; |
113 | } | 113 | } |
114 | 114 | ||
115 | public bool GetIsLink(string file) | 115 | public bool GetIsLink(string file) |
116 | { | 116 | { |
117 | if (!m_Links.ContainsKey(file)) | 117 | if (!m_Links.ContainsKey(file)) |
118 | { | 118 | { |
119 | return false; | 119 | return false; |
120 | } | 120 | } |
121 | return m_Links[file]; | 121 | return m_Links[file]; |
122 | } | 122 | } |
123 | 123 | ||
124 | public bool Contains(string file) | 124 | public bool Contains(string file) |
125 | { | 125 | { |
126 | return m_Files.Contains(file); | 126 | return m_Files.Contains(file); |
127 | } | 127 | } |
128 | 128 | ||
129 | public string GetLinkPath( string file ) | 129 | public string GetLinkPath( string file ) |
130 | { | 130 | { |
131 | if ( !m_LinkPaths.ContainsKey( file ) ) | 131 | if ( !m_LinkPaths.ContainsKey( file ) ) |
132 | { | 132 | { |
133 | return string.Empty; | 133 | return string.Empty; |
134 | } | 134 | } |
135 | return m_LinkPaths[ file ]; | 135 | return m_LinkPaths[ file ]; |
136 | } | 136 | } |
137 | 137 | ||
138 | public SubType GetSubType(string file) | 138 | public SubType GetSubType(string file) |
139 | { | 139 | { |
140 | if(!m_SubTypes.ContainsKey(file)) | 140 | if(!m_SubTypes.ContainsKey(file)) |
141 | { | 141 | { |
142 | return SubType.Code; | 142 | return SubType.Code; |
143 | } | 143 | } |
144 | 144 | ||
145 | return m_SubTypes[file]; | 145 | return m_SubTypes[file]; |
146 | } | 146 | } |
147 | 147 | ||
148 | public string GetResourceName(string file) | 148 | public string GetResourceName(string file) |
149 | { | 149 | { |
150 | if(!m_ResourceNames.ContainsKey(file)) | 150 | if(!m_ResourceNames.ContainsKey(file)) |
151 | { | 151 | { |
152 | return string.Empty; | 152 | return string.Empty; |
153 | } | 153 | } |
154 | 154 | ||
155 | return m_ResourceNames[file]; | 155 | return m_ResourceNames[file]; |
156 | } | 156 | } |
157 | 157 | ||
158 | public bool GetPreservePath( string file ) | 158 | public bool GetPreservePath( string file ) |
159 | { | 159 | { |
@@ -165,45 +165,45 @@ namespace Prebuild.Core.Nodes | |||
165 | return m_PreservePaths[ file ]; | 165 | return m_PreservePaths[ file ]; |
166 | } | 166 | } |
167 | 167 | ||
168 | public override void Parse(XmlNode node) | 168 | public override void Parse(XmlNode node) |
169 | { | 169 | { |
170 | if( node == null ) | 170 | if( node == null ) |
171 | { | 171 | { |
172 | throw new ArgumentNullException("node"); | 172 | throw new ArgumentNullException("node"); |
173 | } | 173 | } |
174 | foreach(XmlNode child in node.ChildNodes) | 174 | foreach(XmlNode child in node.ChildNodes) |
175 | { | 175 | { |
176 | IDataNode dataNode = Kernel.Instance.ParseNode(child, this); | 176 | IDataNode dataNode = Kernel.Instance.ParseNode(child, this); |
177 | if(dataNode is FileNode) | 177 | if(dataNode is FileNode) |
178 | { | 178 | { |
179 | FileNode fileNode = (FileNode)dataNode; | 179 | FileNode fileNode = (FileNode)dataNode; |
180 | if(fileNode.IsValid) | 180 | if(fileNode.IsValid) |
181 | { | 181 | { |
182 | if (!m_Files.Contains(fileNode.Path)) | 182 | if (!m_Files.Contains(fileNode.Path)) |
183 | { | 183 | { |
184 | m_Files.Add(fileNode.Path); | 184 | m_Files.Add(fileNode.Path); |
185 | m_BuildActions[fileNode.Path] = fileNode.BuildAction; | 185 | m_BuildActions[fileNode.Path] = fileNode.BuildAction; |
186 | m_SubTypes[fileNode.Path] = fileNode.SubType; | 186 | m_SubTypes[fileNode.Path] = fileNode.SubType; |
187 | m_ResourceNames[fileNode.Path] = fileNode.ResourceName; | 187 | m_ResourceNames[fileNode.Path] = fileNode.ResourceName; |
188 | m_PreservePaths[ fileNode.Path ] = fileNode.PreservePath; | 188 | m_PreservePaths[ fileNode.Path ] = fileNode.PreservePath; |
189 | m_Links[ fileNode.Path ] = fileNode.IsLink; | 189 | m_Links[ fileNode.Path ] = fileNode.IsLink; |
190 | m_LinkPaths[ fileNode.Path ] = fileNode.LinkPath; | 190 | m_LinkPaths[ fileNode.Path ] = fileNode.LinkPath; |
191 | m_CopyToOutputs[ fileNode.Path ] = fileNode.CopyToOutput; | 191 | m_CopyToOutputs[ fileNode.Path ] = fileNode.CopyToOutput; |
192 | 192 | ||
193 | } | 193 | } |
194 | } | 194 | } |
195 | } | 195 | } |
196 | else if(dataNode is MatchNode) | 196 | else if(dataNode is MatchNode) |
197 | { | 197 | { |
198 | foreach(string file in ((MatchNode)dataNode).Files) | 198 | foreach(string file in ((MatchNode)dataNode).Files) |
199 | { | 199 | { |
200 | MatchNode matchNode = (MatchNode)dataNode; | 200 | MatchNode matchNode = (MatchNode)dataNode; |
201 | if (!m_Files.Contains(file)) | 201 | if (!m_Files.Contains(file)) |
202 | { | 202 | { |
203 | m_Files.Add(file); | 203 | m_Files.Add(file); |
204 | if (matchNode.BuildAction == null) | 204 | if (matchNode.BuildAction == null) |
205 | m_BuildActions[file] = GetBuildActionByFileName(file); | 205 | m_BuildActions[file] = GetBuildActionByFileName(file); |
206 | else | 206 | else |
207 | m_BuildActions[file] = matchNode.BuildAction.Value; | 207 | m_BuildActions[file] = matchNode.BuildAction.Value; |
208 | 208 | ||
209 | if (matchNode.BuildAction == BuildAction.Copy) | 209 | if (matchNode.BuildAction == BuildAction.Copy) |
@@ -212,27 +212,27 @@ namespace Prebuild.Core.Nodes | |||
212 | m_DestinationPath[file] = matchNode.DestinationPath; | 212 | m_DestinationPath[file] = matchNode.DestinationPath; |
213 | } | 213 | } |
214 | 214 | ||
215 | m_SubTypes[file] = matchNode.SubType == null ? GetSubTypeByFileName(file) : matchNode.SubType.Value; | 215 | m_SubTypes[file] = matchNode.SubType == null ? GetSubTypeByFileName(file) : matchNode.SubType.Value; |
216 | m_ResourceNames[ file ] = matchNode.ResourceName; | 216 | m_ResourceNames[ file ] = matchNode.ResourceName; |
217 | m_PreservePaths[ file ] = matchNode.PreservePath; | 217 | m_PreservePaths[ file ] = matchNode.PreservePath; |
218 | m_Links[ file ] = matchNode.IsLink; | 218 | m_Links[ file ] = matchNode.IsLink; |
219 | m_LinkPaths[ file ] = matchNode.LinkPath; | 219 | m_LinkPaths[ file ] = matchNode.LinkPath; |
220 | m_CopyToOutputs[ file ] = matchNode.CopyToOutput; | 220 | m_CopyToOutputs[ file ] = matchNode.CopyToOutput; |
221 | 221 | ||
222 | } | 222 | } |
223 | } | 223 | } |
224 | } | 224 | } |
225 | } | 225 | } |
226 | } | 226 | } |
227 | 227 | ||
228 | // TODO: Check in to why StringCollection's enumerator doesn't implement | 228 | // TODO: Check in to why StringCollection's enumerator doesn't implement |
229 | // IEnumerator? | 229 | // IEnumerator? |
230 | public IEnumerator<string> GetEnumerator() | 230 | public IEnumerator<string> GetEnumerator() |
231 | { | 231 | { |
232 | return m_Files.GetEnumerator(); | 232 | return m_Files.GetEnumerator(); |
233 | } | 233 | } |
234 | 234 | ||
235 | #endregion | 235 | #endregion |
236 | 236 | ||
237 | } | 237 | } |
238 | } | 238 | } |
diff --git a/Prebuild/src/Core/Nodes/MatchNode.cs b/Prebuild/src/Core/Nodes/MatchNode.cs index 000bde9..fe02277 100644 --- a/Prebuild/src/Core/Nodes/MatchNode.cs +++ b/Prebuild/src/Core/Nodes/MatchNode.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
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 |
@@ -35,51 +35,51 @@ using Prebuild.Core.Utilities; | |||
35 | 35 | ||
36 | namespace Prebuild.Core.Nodes | 36 | namespace Prebuild.Core.Nodes |
37 | { | 37 | { |
38 | /// <summary> | 38 | /// <summary> |
39 | /// | 39 | /// |
40 | /// </summary> | 40 | /// </summary> |
41 | [DataNode("Match")] | 41 | [DataNode("Match")] |
42 | public class MatchNode : DataNode | 42 | public class MatchNode : DataNode |
43 | { | 43 | { |
44 | #region Fields | 44 | #region Fields |
45 | 45 | ||
46 | private readonly List<string> m_Files = new List<string>(); | 46 | private readonly List<string> m_Files = new List<string>(); |
47 | private Regex m_Regex; | 47 | private Regex m_Regex; |
48 | private BuildAction? m_BuildAction; | 48 | private BuildAction? m_BuildAction; |
49 | private SubType? m_SubType; | 49 | private SubType? m_SubType; |
50 | string m_ResourceName = ""; | 50 | string m_ResourceName = ""; |
51 | private CopyToOutput m_CopyToOutput; | 51 | private CopyToOutput m_CopyToOutput; |
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 string m_Destination = ""; |
56 | private readonly List<ExcludeNode> m_Exclusions = new List<ExcludeNode>(); | 56 | private readonly List<ExcludeNode> m_Exclusions = new List<ExcludeNode>(); |
57 | 57 | ||
58 | #endregion | 58 | #endregion |
59 | 59 | ||
60 | #region Properties | 60 | #region Properties |
61 | 61 | ||
62 | /// <summary> | 62 | /// <summary> |
63 | /// | 63 | /// |
64 | /// </summary> | 64 | /// </summary> |
65 | public IEnumerable<string> Files | 65 | public IEnumerable<string> Files |
66 | { | 66 | { |
67 | get | 67 | get |
68 | { | 68 | { |
69 | return m_Files; | 69 | return m_Files; |
70 | } | 70 | } |
71 | } | 71 | } |
72 | 72 | ||
73 | /// <summary> | 73 | /// <summary> |
74 | /// | 74 | /// |
75 | /// </summary> | 75 | /// </summary> |
76 | public BuildAction? BuildAction | 76 | public BuildAction? BuildAction |
77 | { | 77 | { |
78 | get | 78 | get |
79 | { | 79 | { |
80 | return m_BuildAction; | 80 | return m_BuildAction; |
81 | } | 81 | } |
82 | } | 82 | } |
83 | 83 | ||
84 | public string DestinationPath | 84 | public string DestinationPath |
85 | { | 85 | { |
@@ -88,50 +88,50 @@ namespace Prebuild.Core.Nodes | |||
88 | return m_Destination; | 88 | return m_Destination; |
89 | } | 89 | } |
90 | } | 90 | } |
91 | /// <summary> | 91 | /// <summary> |
92 | /// | 92 | /// |
93 | /// </summary> | 93 | /// </summary> |
94 | public SubType? SubType | 94 | public SubType? SubType |
95 | { | 95 | { |
96 | get | 96 | get |
97 | { | 97 | { |
98 | return m_SubType; | 98 | return m_SubType; |
99 | } | 99 | } |
100 | } | 100 | } |
101 | 101 | ||
102 | public CopyToOutput CopyToOutput | 102 | public CopyToOutput CopyToOutput |
103 | { | 103 | { |
104 | get | 104 | get |
105 | { | 105 | { |
106 | return m_CopyToOutput; | 106 | return m_CopyToOutput; |
107 | } | 107 | } |
108 | } | 108 | } |
109 | 109 | ||
110 | public bool IsLink | 110 | public bool IsLink |
111 | { | 111 | { |
112 | get | 112 | get |
113 | { | 113 | { |
114 | return m_Link; | 114 | return m_Link; |
115 | } | 115 | } |
116 | } | 116 | } |
117 | 117 | ||
118 | public string LinkPath | 118 | public string LinkPath |
119 | { | 119 | { |
120 | get | 120 | get |
121 | { | 121 | { |
122 | return m_LinkPath; | 122 | return m_LinkPath; |
123 | } | 123 | } |
124 | } | 124 | } |
125 | /// <summary> | 125 | /// <summary> |
126 | /// | 126 | /// |
127 | /// </summary> | 127 | /// </summary> |
128 | public string ResourceName | 128 | public string ResourceName |
129 | { | 129 | { |
130 | get | 130 | get |
131 | { | 131 | { |
132 | return m_ResourceName; | 132 | return m_ResourceName; |
133 | } | 133 | } |
134 | } | 134 | } |
135 | 135 | ||
136 | public bool PreservePath | 136 | public bool PreservePath |
137 | { | 137 | { |
@@ -141,27 +141,27 @@ namespace Prebuild.Core.Nodes | |||
141 | } | 141 | } |
142 | } | 142 | } |
143 | 143 | ||
144 | #endregion | 144 | #endregion |
145 | 145 | ||
146 | #region Private Methods | 146 | #region Private Methods |
147 | 147 | ||
148 | /// <summary> | 148 | /// <summary> |
149 | /// Recurses the directories. | 149 | /// Recurses the directories. |
150 | /// </summary> | 150 | /// </summary> |
151 | /// <param name="path">The path.</param> | 151 | /// <param name="path">The path.</param> |
152 | /// <param name="pattern">The pattern.</param> | 152 | /// <param name="pattern">The pattern.</param> |
153 | /// <param name="recurse">if set to <c>true</c> [recurse].</param> | 153 | /// <param name="recurse">if set to <c>true</c> [recurse].</param> |
154 | /// <param name="useRegex">if set to <c>true</c> [use regex].</param> | 154 | /// <param name="useRegex">if set to <c>true</c> [use regex].</param> |
155 | private void RecurseDirectories(string path, string pattern, bool recurse, bool useRegex, List<ExcludeNode> exclusions) | 155 | private void RecurseDirectories(string path, string pattern, bool recurse, bool useRegex, List<ExcludeNode> exclusions) |
156 | { | 156 | { |
157 | Match match; | 157 | Match match; |
158 | try | 158 | try |
159 | { | 159 | { |
160 | string[] files; | 160 | string[] files; |
161 | 161 | ||
162 | Boolean excludeFile; | 162 | Boolean excludeFile; |
163 | if(!useRegex) | 163 | if(!useRegex) |
164 | { | 164 | { |
165 | try | 165 | try |
166 | { | 166 | { |
167 | files = Directory.GetFiles(path, pattern); | 167 | files = Directory.GetFiles(path, pattern); |
@@ -169,7 +169,7 @@ namespace Prebuild.Core.Nodes | |||
169 | catch (IOException) | 169 | catch (IOException) |
170 | { | 170 | { |
171 | // swallow weird IOException error when running in a virtual box | 171 | // swallow weird IOException error when running in a virtual box |
172 | // guest OS on a network share when the host OS is not Windows. | 172 | // guest OS on a network share when the host OS is not Windows. |
173 | // This seems to happen on network shares | 173 | // This seems to happen on network shares |
174 | // when no files match, and may be related to this report: | 174 | // when no files match, and may be related to this report: |
175 | // http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=254546 | 175 | // http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=254546 |
@@ -177,20 +177,20 @@ namespace Prebuild.Core.Nodes | |||
177 | files = null; | 177 | files = null; |
178 | } | 178 | } |
179 | 179 | ||
180 | if(files != null) | 180 | if(files != null) |
181 | { | 181 | { |
182 | foreach (string file in files) | 182 | foreach (string file in files) |
183 | { | 183 | { |
184 | excludeFile = false; | 184 | excludeFile = false; |
185 | string fileTemp; | 185 | string fileTemp; |
186 | if (file.Substring(0,2) == "./" || file.Substring(0,2) == ".\\") | 186 | if (file.Substring(0,2) == "./" || file.Substring(0,2) == ".\\") |
187 | { | 187 | { |
188 | fileTemp = file.Substring(2); | 188 | fileTemp = file.Substring(2); |
189 | } | 189 | } |
190 | else | 190 | else |
191 | { | 191 | { |
192 | fileTemp = file; | 192 | fileTemp = file; |
193 | } | 193 | } |
194 | 194 | ||
195 | // Check all excludions and set flag if there are any hits. | 195 | // Check all excludions and set flag if there are any hits. |
196 | foreach ( ExcludeNode exclude in exclusions ) | 196 | foreach ( ExcludeNode exclude in exclusions ) |
@@ -205,18 +205,18 @@ namespace Prebuild.Core.Nodes | |||
205 | m_Files.Add( fileTemp ); | 205 | m_Files.Add( fileTemp ); |
206 | } | 206 | } |
207 | 207 | ||
208 | } | 208 | } |
209 | } | 209 | } |
210 | 210 | ||
211 | // don't call return here, because we may need to recursively search directories below | 211 | // don't call return here, because we may need to recursively search directories below |
212 | // this one, even if no matches were found in this directory. | 212 | // this one, even if no matches were found in this directory. |
213 | } | 213 | } |
214 | else | 214 | else |
215 | { | 215 | { |
216 | try | 216 | try |
217 | { | 217 | { |
218 | files = Directory.GetFiles(path); | 218 | files = Directory.GetFiles(path); |
219 | } | 219 | } |
220 | catch (IOException) | 220 | catch (IOException) |
221 | { | 221 | { |
222 | // swallow weird IOException error when running in a virtual box | 222 | // swallow weird IOException error when running in a virtual box |
@@ -248,12 +248,12 @@ namespace Prebuild.Core.Nodes | |||
248 | } | 248 | } |
249 | } | 249 | } |
250 | } | 250 | } |
251 | } | 251 | } |
252 | 252 | ||
253 | if(recurse) | 253 | if(recurse) |
254 | { | 254 | { |
255 | string[] dirs = Directory.GetDirectories(path); | 255 | string[] dirs = Directory.GetDirectories(path); |
256 | if(dirs != null && dirs.Length > 0) | 256 | if(dirs != null && dirs.Length > 0) |
257 | { | 257 | { |
258 | foreach (string str in dirs) | 258 | foreach (string str in dirs) |
259 | { | 259 | { |
@@ -265,96 +265,96 @@ namespace Prebuild.Core.Nodes | |||
265 | RecurseDirectories(Helper.NormalizePath(str), pattern, recurse, useRegex, exclusions); | 265 | RecurseDirectories(Helper.NormalizePath(str), pattern, recurse, useRegex, exclusions); |
266 | } | 266 | } |
267 | } | 267 | } |
268 | } | 268 | } |
269 | } | 269 | } |
270 | catch(DirectoryNotFoundException) | 270 | catch(DirectoryNotFoundException) |
271 | { | 271 | { |
272 | return; | 272 | return; |
273 | } | 273 | } |
274 | catch(ArgumentException) | 274 | catch(ArgumentException) |
275 | { | 275 | { |
276 | return; | 276 | return; |
277 | } | 277 | } |
278 | } | 278 | } |
279 | 279 | ||
280 | #endregion | 280 | #endregion |
281 | 281 | ||
282 | #region Public Methods | 282 | #region Public Methods |
283 | 283 | ||
284 | /// <summary> | 284 | /// <summary> |
285 | /// | 285 | /// |
286 | /// </summary> | 286 | /// </summary> |
287 | /// <param name="node"></param> | 287 | /// <param name="node"></param> |
288 | public override void Parse(XmlNode node) | 288 | public override void Parse(XmlNode node) |
289 | { | 289 | { |
290 | if( node == null ) | 290 | if( node == null ) |
291 | { | 291 | { |
292 | throw new ArgumentNullException("node"); | 292 | throw new ArgumentNullException("node"); |
293 | } | 293 | } |
294 | string path = Helper.AttributeValue(node, "path", "."); | 294 | string path = Helper.AttributeValue(node, "path", "."); |
295 | string pattern = Helper.AttributeValue(node, "pattern", "*"); | 295 | string pattern = Helper.AttributeValue(node, "pattern", "*"); |
296 | string destination = Helper.AttributeValue(node, "destination", string.Empty); | 296 | string destination = Helper.AttributeValue(node, "destination", string.Empty); |
297 | 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")); |
298 | 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")); |
299 | string buildAction = Helper.AttributeValue(node, "buildAction", String.Empty); | 299 | string buildAction = Helper.AttributeValue(node, "buildAction", String.Empty); |
300 | if (buildAction != string.Empty) | 300 | if (buildAction != string.Empty) |
301 | m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction), buildAction); | 301 | m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction), buildAction); |
302 | 302 | ||
303 | 303 | ||
304 | //TODO: Figure out where the subtype node is being assigned | 304 | //TODO: Figure out where the subtype node is being assigned |
305 | //string subType = Helper.AttributeValue(node, "subType", string.Empty); | 305 | //string subType = Helper.AttributeValue(node, "subType", string.Empty); |
306 | //if (subType != String.Empty) | 306 | //if (subType != String.Empty) |
307 | // m_SubType = (SubType)Enum.Parse(typeof(SubType), subType); | 307 | // m_SubType = (SubType)Enum.Parse(typeof(SubType), subType); |
308 | m_ResourceName = Helper.AttributeValue(node, "resourceName", m_ResourceName); | 308 | m_ResourceName = Helper.AttributeValue(node, "resourceName", m_ResourceName); |
309 | m_CopyToOutput = (CopyToOutput) Enum.Parse(typeof(CopyToOutput), Helper.AttributeValue(node, "copyToOutput", m_CopyToOutput.ToString())); | 309 | m_CopyToOutput = (CopyToOutput) Enum.Parse(typeof(CopyToOutput), Helper.AttributeValue(node, "copyToOutput", m_CopyToOutput.ToString())); |
310 | m_Link = bool.Parse(Helper.AttributeValue(node, "link", bool.FalseString)); | 310 | m_Link = bool.Parse(Helper.AttributeValue(node, "link", bool.FalseString)); |
311 | if ( m_Link ) | 311 | if ( m_Link ) |
312 | { | 312 | { |
313 | m_LinkPath = Helper.AttributeValue( node, "linkPath", string.Empty ); | 313 | m_LinkPath = Helper.AttributeValue( node, "linkPath", string.Empty ); |
314 | } | 314 | } |
315 | m_PreservePath = bool.Parse( Helper.AttributeValue( node, "preservePath", bool.FalseString ) ); | 315 | m_PreservePath = bool.Parse( Helper.AttributeValue( node, "preservePath", bool.FalseString ) ); |
316 | 316 | ||
317 | if ( buildAction == "Copy") | 317 | if ( buildAction == "Copy") |
318 | m_Destination = destination; | 318 | m_Destination = destination; |
319 | 319 | ||
320 | if(path != null && path.Length == 0) | 320 | if(path != null && path.Length == 0) |
321 | path = ".";//use current directory | 321 | path = ".";//use current directory |
322 | 322 | ||
323 | //throw new WarningException("Match must have a 'path' attribute"); | 323 | //throw new WarningException("Match must have a 'path' attribute"); |
324 | 324 | ||
325 | if(pattern == null) | 325 | if(pattern == null) |
326 | { | 326 | { |
327 | throw new WarningException("Match must have a 'pattern' attribute"); | 327 | throw new WarningException("Match must have a 'pattern' attribute"); |
328 | } | 328 | } |
329 | 329 | ||
330 | path = Helper.NormalizePath(path); | 330 | path = Helper.NormalizePath(path); |
331 | if(!Directory.Exists(path)) | 331 | if(!Directory.Exists(path)) |
332 | { | 332 | { |
333 | throw new WarningException("Match path does not exist: {0}", path); | 333 | throw new WarningException("Match path does not exist: {0}", path); |
334 | } | 334 | } |
335 | 335 | ||
336 | try | 336 | try |
337 | { | 337 | { |
338 | if(useRegex) | 338 | if(useRegex) |
339 | { | 339 | { |
340 | m_Regex = new Regex(pattern); | 340 | m_Regex = new Regex(pattern); |
341 | } | 341 | } |
342 | } | 342 | } |
343 | catch(ArgumentException ex) | 343 | catch(ArgumentException ex) |
344 | { | 344 | { |
345 | throw new WarningException("Could not compile regex pattern: {0}", ex.Message); | 345 | throw new WarningException("Could not compile regex pattern: {0}", ex.Message); |
346 | } | 346 | } |
347 | 347 | ||
348 | 348 | ||
349 | foreach(XmlNode child in node.ChildNodes) | 349 | foreach(XmlNode child in node.ChildNodes) |
350 | { | 350 | { |
351 | IDataNode dataNode = Kernel.Instance.ParseNode(child, this); | 351 | IDataNode dataNode = Kernel.Instance.ParseNode(child, this); |
352 | if(dataNode is ExcludeNode) | 352 | if(dataNode is ExcludeNode) |
353 | { | 353 | { |
354 | ExcludeNode excludeNode = (ExcludeNode)dataNode; | 354 | ExcludeNode excludeNode = (ExcludeNode)dataNode; |
355 | m_Exclusions.Add( excludeNode ); | 355 | m_Exclusions.Add( excludeNode ); |
356 | } | 356 | } |
357 | } | 357 | } |
358 | 358 | ||
359 | RecurseDirectories( path, pattern, recurse, useRegex, m_Exclusions ); | 359 | RecurseDirectories( path, pattern, recurse, useRegex, m_Exclusions ); |
360 | 360 | ||
@@ -371,8 +371,8 @@ namespace Prebuild.Core.Nodes | |||
371 | throw new WarningException("Match" + projectName + " returned no files: {0}{1}", Helper.EndPath(path), pattern); | 371 | throw new WarningException("Match" + projectName + " returned no files: {0}{1}", Helper.EndPath(path), pattern); |
372 | } | 372 | } |
373 | m_Regex = null; | 373 | m_Regex = null; |
374 | } | 374 | } |
375 | 375 | ||
376 | #endregion | 376 | #endregion |
377 | } | 377 | } |
378 | } | 378 | } |
diff --git a/Prebuild/src/Core/Nodes/OptionsNode.cs b/Prebuild/src/Core/Nodes/OptionsNode.cs index 577de71..d45bd34 100644 --- a/Prebuild/src/Core/Nodes/OptionsNode.cs +++ b/Prebuild/src/Core/Nodes/OptionsNode.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
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 |
@@ -34,273 +34,273 @@ using Prebuild.Core.Utilities; | |||
34 | 34 | ||
35 | namespace Prebuild.Core.Nodes | 35 | namespace Prebuild.Core.Nodes |
36 | { | 36 | { |
37 | /// <summary> | 37 | /// <summary> |
38 | /// | 38 | /// |
39 | /// </summary> | 39 | /// </summary> |
40 | [DataNode("Options")] | 40 | [DataNode("Options")] |
41 | public class OptionsNode : DataNode | 41 | public class OptionsNode : DataNode |
42 | { | 42 | { |
43 | #region Fields | 43 | #region Fields |
44 | 44 | ||
45 | private static readonly Dictionary<string,FieldInfo> m_OptionFields = new Dictionary<string, FieldInfo>(); | 45 | private static readonly Dictionary<string,FieldInfo> m_OptionFields = new Dictionary<string, FieldInfo>(); |
46 | 46 | ||
47 | [OptionNode("CompilerDefines")] | 47 | [OptionNode("CompilerDefines")] |
48 | private string m_CompilerDefines = ""; | 48 | private string m_CompilerDefines = ""; |
49 | 49 | ||
50 | /// <summary> | 50 | /// <summary> |
51 | /// | 51 | /// |
52 | /// </summary> | 52 | /// </summary> |
53 | public string CompilerDefines | 53 | public string CompilerDefines |
54 | { | 54 | { |
55 | get | 55 | get |
56 | { | 56 | { |
57 | return m_CompilerDefines; | 57 | return m_CompilerDefines; |
58 | } | 58 | } |
59 | set | 59 | set |
60 | { | 60 | { |
61 | m_CompilerDefines = value; | 61 | m_CompilerDefines = value; |
62 | } | 62 | } |
63 | } | 63 | } |
64 | 64 | ||
65 | [OptionNode("OptimizeCode")] | 65 | [OptionNode("OptimizeCode")] |
66 | private bool m_OptimizeCode; | 66 | private bool m_OptimizeCode; |
67 | 67 | ||
68 | /// <summary> | 68 | /// <summary> |
69 | /// | 69 | /// |
70 | /// </summary> | 70 | /// </summary> |
71 | public bool OptimizeCode | 71 | public bool OptimizeCode |
72 | { | 72 | { |
73 | get | 73 | get |
74 | { | 74 | { |
75 | return m_OptimizeCode; | 75 | return m_OptimizeCode; |
76 | } | 76 | } |
77 | set | 77 | set |
78 | { | 78 | { |
79 | m_OptimizeCode = value; | 79 | m_OptimizeCode = value; |
80 | } | 80 | } |
81 | } | 81 | } |
82 | 82 | ||
83 | [OptionNode("CheckUnderflowOverflow")] | 83 | [OptionNode("CheckUnderflowOverflow")] |
84 | private bool m_CheckUnderflowOverflow; | 84 | private bool m_CheckUnderflowOverflow; |
85 | 85 | ||
86 | /// <summary> | 86 | /// <summary> |
87 | /// | 87 | /// |
88 | /// </summary> | 88 | /// </summary> |
89 | public bool CheckUnderflowOverflow | 89 | public bool CheckUnderflowOverflow |
90 | { | 90 | { |
91 | get | 91 | get |
92 | { | 92 | { |
93 | return m_CheckUnderflowOverflow; | 93 | return m_CheckUnderflowOverflow; |
94 | } | 94 | } |
95 | set | 95 | set |
96 | { | 96 | { |
97 | m_CheckUnderflowOverflow = value; | 97 | m_CheckUnderflowOverflow = value; |
98 | } | 98 | } |
99 | } | 99 | } |
100 | 100 | ||
101 | [OptionNode("AllowUnsafe")] | 101 | [OptionNode("AllowUnsafe")] |
102 | private bool m_AllowUnsafe; | 102 | private bool m_AllowUnsafe; |
103 | 103 | ||
104 | /// <summary> | 104 | /// <summary> |
105 | /// | 105 | /// |
106 | /// </summary> | 106 | /// </summary> |
107 | public bool AllowUnsafe | 107 | public bool AllowUnsafe |
108 | { | 108 | { |
109 | get | 109 | get |
110 | { | 110 | { |
111 | return m_AllowUnsafe; | 111 | return m_AllowUnsafe; |
112 | } | 112 | } |
113 | set | 113 | set |
114 | { | 114 | { |
115 | m_AllowUnsafe = value; | 115 | m_AllowUnsafe = value; |
116 | } | 116 | } |
117 | } | 117 | } |
118 | 118 | ||
119 | [OptionNode("PreBuildEvent")] | 119 | [OptionNode("PreBuildEvent")] |
120 | private string m_PreBuildEvent; | 120 | private string m_PreBuildEvent; |
121 | 121 | ||
122 | /// <summary> | 122 | /// <summary> |
123 | /// | 123 | /// |
124 | /// </summary> | 124 | /// </summary> |
125 | public string PreBuildEvent | 125 | public string PreBuildEvent |
126 | { | 126 | { |
127 | get | 127 | get |
128 | { | 128 | { |
129 | return m_PreBuildEvent; | 129 | return m_PreBuildEvent; |
130 | } | 130 | } |
131 | set | 131 | set |
132 | { | 132 | { |
133 | m_PreBuildEvent = value; | 133 | m_PreBuildEvent = value; |
134 | } | 134 | } |
135 | } | 135 | } |
136 | 136 | ||
137 | [OptionNode("PostBuildEvent")] | 137 | [OptionNode("PostBuildEvent")] |
138 | private string m_PostBuildEvent; | 138 | private string m_PostBuildEvent; |
139 | 139 | ||
140 | /// <summary> | 140 | /// <summary> |
141 | /// | 141 | /// |
142 | /// </summary> | 142 | /// </summary> |
143 | public string PostBuildEvent | 143 | public string PostBuildEvent |
144 | { | 144 | { |
145 | get | 145 | get |
146 | { | 146 | { |
147 | return m_PostBuildEvent; | 147 | return m_PostBuildEvent; |
148 | } | 148 | } |
149 | set | 149 | set |
150 | { | 150 | { |
151 | m_PostBuildEvent = value; | 151 | m_PostBuildEvent = value; |
152 | } | 152 | } |
153 | } | 153 | } |
154 | 154 | ||
155 | [OptionNode("PreBuildEventArgs")] | 155 | [OptionNode("PreBuildEventArgs")] |
156 | private string m_PreBuildEventArgs; | 156 | private string m_PreBuildEventArgs; |
157 | 157 | ||
158 | /// <summary> | 158 | /// <summary> |
159 | /// | 159 | /// |
160 | /// </summary> | 160 | /// </summary> |
161 | public string PreBuildEventArgs | 161 | public string PreBuildEventArgs |
162 | { | 162 | { |
163 | get | 163 | get |
164 | { | 164 | { |
165 | return m_PreBuildEventArgs; | 165 | return m_PreBuildEventArgs; |
166 | } | 166 | } |
167 | set | 167 | set |
168 | { | 168 | { |
169 | m_PreBuildEventArgs = value; | 169 | m_PreBuildEventArgs = value; |
170 | } | 170 | } |
171 | } | 171 | } |
172 | 172 | ||
173 | [OptionNode("PostBuildEventArgs")] | 173 | [OptionNode("PostBuildEventArgs")] |
174 | private string m_PostBuildEventArgs; | 174 | private string m_PostBuildEventArgs; |
175 | 175 | ||
176 | /// <summary> | 176 | /// <summary> |
177 | /// | 177 | /// |
178 | /// </summary> | 178 | /// </summary> |
179 | public string PostBuildEventArgs | 179 | public string PostBuildEventArgs |
180 | { | 180 | { |
181 | get | 181 | get |
182 | { | 182 | { |
183 | return m_PostBuildEventArgs; | 183 | return m_PostBuildEventArgs; |
184 | } | 184 | } |
185 | set | 185 | set |
186 | { | 186 | { |
187 | m_PostBuildEventArgs = value; | 187 | m_PostBuildEventArgs = value; |
188 | } | 188 | } |
189 | } | 189 | } |
190 | 190 | ||
191 | [OptionNode("RunPostBuildEvent")] | 191 | [OptionNode("RunPostBuildEvent")] |
192 | private string m_RunPostBuildEvent; | 192 | private string m_RunPostBuildEvent; |
193 | 193 | ||
194 | /// <summary> | 194 | /// <summary> |
195 | /// | 195 | /// |
196 | /// </summary> | 196 | /// </summary> |
197 | public string RunPostBuildEvent | 197 | public string RunPostBuildEvent |
198 | { | 198 | { |
199 | get | 199 | get |
200 | { | 200 | { |
201 | return m_RunPostBuildEvent; | 201 | return m_RunPostBuildEvent; |
202 | } | 202 | } |
203 | set | 203 | set |
204 | { | 204 | { |
205 | m_RunPostBuildEvent = value; | 205 | m_RunPostBuildEvent = value; |
206 | } | 206 | } |
207 | } | 207 | } |
208 | 208 | ||
209 | [OptionNode("RunScript")] | 209 | [OptionNode("RunScript")] |
210 | private string m_RunScript; | 210 | private string m_RunScript; |
211 | 211 | ||
212 | /// <summary> | 212 | /// <summary> |
213 | /// | 213 | /// |
214 | /// </summary> | 214 | /// </summary> |
215 | public string RunScript | 215 | public string RunScript |
216 | { | 216 | { |
217 | get | 217 | get |
218 | { | 218 | { |
219 | return m_RunScript; | 219 | return m_RunScript; |
220 | } | 220 | } |
221 | set | 221 | set |
222 | { | 222 | { |
223 | m_RunScript = value; | 223 | m_RunScript = value; |
224 | } | 224 | } |
225 | } | 225 | } |
226 | 226 | ||
227 | [OptionNode("WarningLevel")] | 227 | [OptionNode("WarningLevel")] |
228 | private int m_WarningLevel = 4; | 228 | private int m_WarningLevel = 4; |
229 | 229 | ||
230 | /// <summary> | 230 | /// <summary> |
231 | /// | 231 | /// |
232 | /// </summary> | 232 | /// </summary> |
233 | public int WarningLevel | 233 | public int WarningLevel |
234 | { | 234 | { |
235 | get | 235 | get |
236 | { | 236 | { |
237 | return m_WarningLevel; | 237 | return m_WarningLevel; |
238 | } | 238 | } |
239 | set | 239 | set |
240 | { | 240 | { |
241 | m_WarningLevel = value; | 241 | m_WarningLevel = value; |
242 | } | 242 | } |
243 | } | 243 | } |
244 | 244 | ||
245 | [OptionNode("WarningsAsErrors")] | 245 | [OptionNode("WarningsAsErrors")] |
246 | private bool m_WarningsAsErrors; | 246 | private bool m_WarningsAsErrors; |
247 | 247 | ||
248 | /// <summary> | 248 | /// <summary> |
249 | /// | 249 | /// |
250 | /// </summary> | 250 | /// </summary> |
251 | public bool WarningsAsErrors | 251 | public bool WarningsAsErrors |
252 | { | 252 | { |
253 | get | 253 | get |
254 | { | 254 | { |
255 | return m_WarningsAsErrors; | 255 | return m_WarningsAsErrors; |
256 | } | 256 | } |
257 | set | 257 | set |
258 | { | 258 | { |
259 | m_WarningsAsErrors = value; | 259 | m_WarningsAsErrors = value; |
260 | } | 260 | } |
261 | } | 261 | } |
262 | 262 | ||
263 | [OptionNode("SuppressWarnings")] | 263 | [OptionNode("SuppressWarnings")] |
264 | private string m_SuppressWarnings = ""; | 264 | private string m_SuppressWarnings = ""; |
265 | 265 | ||
266 | /// <summary> | 266 | /// <summary> |
267 | /// | 267 | /// |
268 | /// </summary> | 268 | /// </summary> |
269 | public string SuppressWarnings | 269 | public string SuppressWarnings |
270 | { | 270 | { |
271 | get | 271 | get |
272 | { | 272 | { |
273 | return m_SuppressWarnings; | 273 | return m_SuppressWarnings; |
274 | } | 274 | } |
275 | set | 275 | set |
276 | { | 276 | { |
277 | m_SuppressWarnings = value; | 277 | m_SuppressWarnings = value; |
278 | } | 278 | } |
279 | } | 279 | } |
280 | 280 | ||
281 | [OptionNode("OutputPath")] | 281 | [OptionNode("OutputPath")] |
282 | private string m_OutputPath = "bin/"; | 282 | private string m_OutputPath = "bin/"; |
283 | 283 | ||
284 | /// <summary> | 284 | /// <summary> |
285 | /// | 285 | /// |
286 | /// </summary> | 286 | /// </summary> |
287 | public string OutputPath | 287 | public string OutputPath |
288 | { | 288 | { |
289 | get | 289 | get |
290 | { | 290 | { |
291 | return m_OutputPath; | 291 | return m_OutputPath; |
292 | } | 292 | } |
293 | set | 293 | set |
294 | { | 294 | { |
295 | m_OutputPath = value; | 295 | m_OutputPath = value; |
296 | } | 296 | } |
297 | } | 297 | } |
298 | 298 | ||
299 | [OptionNode("GenerateDocumentation")] | 299 | [OptionNode("GenerateDocumentation")] |
300 | private bool m_GenerateDocumentation; | 300 | private bool m_GenerateDocumentation; |
301 | 301 | ||
302 | /// <summary> | 302 | /// <summary> |
303 | /// | 303 | /// |
304 | /// </summary> | 304 | /// </summary> |
305 | public bool GenerateDocumentation | 305 | public bool GenerateDocumentation |
306 | { | 306 | { |
@@ -314,321 +314,321 @@ namespace Prebuild.Core.Nodes | |||
314 | } | 314 | } |
315 | } | 315 | } |
316 | 316 | ||
317 | [OptionNode("GenerateXmlDocFile")] | 317 | [OptionNode("GenerateXmlDocFile")] |
318 | private bool m_GenerateXmlDocFile; | 318 | private bool m_GenerateXmlDocFile; |
319 | 319 | ||
320 | /// <summary> | 320 | /// <summary> |
321 | /// | 321 | /// |
322 | /// </summary> | 322 | /// </summary> |
323 | public bool GenerateXmlDocFile | 323 | public bool GenerateXmlDocFile |
324 | { | 324 | { |
325 | get | 325 | get |
326 | { | 326 | { |
327 | return m_GenerateXmlDocFile; | 327 | return m_GenerateXmlDocFile; |
328 | } | 328 | } |
329 | set | 329 | set |
330 | { | 330 | { |
331 | m_GenerateXmlDocFile = value; | 331 | m_GenerateXmlDocFile = value; |
332 | } | 332 | } |
333 | } | 333 | } |
334 | 334 | ||
335 | [OptionNode("XmlDocFile")] | 335 | [OptionNode("XmlDocFile")] |
336 | private string m_XmlDocFile = ""; | 336 | private string m_XmlDocFile = ""; |
337 | 337 | ||
338 | /// <summary> | 338 | /// <summary> |
339 | /// | 339 | /// |
340 | /// </summary> | 340 | /// </summary> |
341 | public string XmlDocFile | 341 | public string XmlDocFile |
342 | { | 342 | { |
343 | get | 343 | get |
344 | { | 344 | { |
345 | return m_XmlDocFile; | 345 | return m_XmlDocFile; |
346 | } | 346 | } |
347 | set | 347 | set |
348 | { | 348 | { |
349 | m_XmlDocFile = value; | 349 | m_XmlDocFile = value; |
350 | } | 350 | } |
351 | } | 351 | } |
352 | 352 | ||
353 | [OptionNode("KeyFile")] | 353 | [OptionNode("KeyFile")] |
354 | private string m_KeyFile = ""; | 354 | private string m_KeyFile = ""; |
355 | 355 | ||
356 | /// <summary> | 356 | /// <summary> |
357 | /// | 357 | /// |
358 | /// </summary> | 358 | /// </summary> |
359 | public string KeyFile | 359 | public string KeyFile |
360 | { | 360 | { |
361 | get | 361 | get |
362 | { | 362 | { |
363 | return m_KeyFile; | 363 | return m_KeyFile; |
364 | } | 364 | } |
365 | set | 365 | set |
366 | { | 366 | { |
367 | m_KeyFile = value; | 367 | m_KeyFile = value; |
368 | } | 368 | } |
369 | } | 369 | } |
370 | 370 | ||
371 | [OptionNode("DebugInformation")] | 371 | [OptionNode("DebugInformation")] |
372 | private bool m_DebugInformation; | 372 | private bool m_DebugInformation; |
373 | 373 | ||
374 | /// <summary> | 374 | /// <summary> |
375 | /// | 375 | /// |
376 | /// </summary> | 376 | /// </summary> |
377 | public bool DebugInformation | 377 | public bool DebugInformation |
378 | { | 378 | { |
379 | get | 379 | get |
380 | { | 380 | { |
381 | return m_DebugInformation; | 381 | return m_DebugInformation; |
382 | } | 382 | } |
383 | set | 383 | set |
384 | { | 384 | { |
385 | m_DebugInformation = value; | 385 | m_DebugInformation = value; |
386 | } | 386 | } |
387 | } | 387 | } |
388 | 388 | ||
389 | [OptionNode("RegisterComInterop")] | 389 | [OptionNode("RegisterComInterop")] |
390 | private bool m_RegisterComInterop; | 390 | private bool m_RegisterComInterop; |
391 | 391 | ||
392 | /// <summary> | 392 | /// <summary> |
393 | /// | 393 | /// |
394 | /// </summary> | 394 | /// </summary> |
395 | public bool RegisterComInterop | 395 | public bool RegisterComInterop |
396 | { | 396 | { |
397 | get | 397 | get |
398 | { | 398 | { |
399 | return m_RegisterComInterop; | 399 | return m_RegisterComInterop; |
400 | } | 400 | } |
401 | set | 401 | set |
402 | { | 402 | { |
403 | m_RegisterComInterop = value; | 403 | m_RegisterComInterop = value; |
404 | } | 404 | } |
405 | } | 405 | } |
406 | 406 | ||
407 | [OptionNode("RemoveIntegerChecks")] | 407 | [OptionNode("RemoveIntegerChecks")] |
408 | private bool m_RemoveIntegerChecks; | 408 | private bool m_RemoveIntegerChecks; |
409 | 409 | ||
410 | /// <summary> | 410 | /// <summary> |
411 | /// | 411 | /// |
412 | /// </summary> | 412 | /// </summary> |
413 | public bool RemoveIntegerChecks | 413 | public bool RemoveIntegerChecks |
414 | { | 414 | { |
415 | get | 415 | get |
416 | { | 416 | { |
417 | return m_RemoveIntegerChecks; | 417 | return m_RemoveIntegerChecks; |
418 | } | 418 | } |
419 | set | 419 | set |
420 | { | 420 | { |
421 | m_RemoveIntegerChecks = value; | 421 | m_RemoveIntegerChecks = value; |
422 | } | 422 | } |
423 | } | 423 | } |
424 | 424 | ||
425 | [OptionNode("IncrementalBuild")] | 425 | [OptionNode("IncrementalBuild")] |
426 | private bool m_IncrementalBuild; | 426 | private bool m_IncrementalBuild; |
427 | 427 | ||
428 | /// <summary> | 428 | /// <summary> |
429 | /// | 429 | /// |
430 | /// </summary> | 430 | /// </summary> |
431 | public bool IncrementalBuild | 431 | public bool IncrementalBuild |
432 | { | 432 | { |
433 | get | 433 | get |
434 | { | 434 | { |
435 | return m_IncrementalBuild; | 435 | return m_IncrementalBuild; |
436 | } | 436 | } |
437 | set | 437 | set |
438 | { | 438 | { |
439 | m_IncrementalBuild = value; | 439 | m_IncrementalBuild = value; |
440 | } | 440 | } |
441 | } | 441 | } |
442 | 442 | ||
443 | [OptionNode("BaseAddress")] | 443 | [OptionNode("BaseAddress")] |
444 | private string m_BaseAddress = "285212672"; | 444 | private string m_BaseAddress = "285212672"; |
445 | 445 | ||
446 | /// <summary> | 446 | /// <summary> |
447 | /// | 447 | /// |
448 | /// </summary> | 448 | /// </summary> |
449 | public string BaseAddress | 449 | public string BaseAddress |
450 | { | 450 | { |
451 | get | 451 | get |
452 | { | 452 | { |
453 | return m_BaseAddress; | 453 | return m_BaseAddress; |
454 | } | 454 | } |
455 | set | 455 | set |
456 | { | 456 | { |
457 | m_BaseAddress = value; | 457 | m_BaseAddress = value; |
458 | } | 458 | } |
459 | } | 459 | } |
460 | 460 | ||
461 | [OptionNode("FileAlignment")] | 461 | [OptionNode("FileAlignment")] |
462 | private int m_FileAlignment = 4096; | 462 | private int m_FileAlignment = 4096; |
463 | 463 | ||
464 | /// <summary> | 464 | /// <summary> |
465 | /// | 465 | /// |
466 | /// </summary> | 466 | /// </summary> |
467 | public int FileAlignment | 467 | public int FileAlignment |
468 | { | 468 | { |
469 | get | 469 | get |
470 | { | 470 | { |
471 | return m_FileAlignment; | 471 | return m_FileAlignment; |
472 | } | 472 | } |
473 | set | 473 | set |
474 | { | 474 | { |
475 | m_FileAlignment = value; | 475 | m_FileAlignment = value; |
476 | } | 476 | } |
477 | } | 477 | } |
478 | 478 | ||
479 | [OptionNode("NoStdLib")] | 479 | [OptionNode("NoStdLib")] |
480 | private bool m_NoStdLib; | 480 | private bool m_NoStdLib; |
481 | 481 | ||
482 | /// <summary> | 482 | /// <summary> |
483 | /// | 483 | /// |
484 | /// </summary> | 484 | /// </summary> |
485 | public bool NoStdLib | 485 | public bool NoStdLib |
486 | { | 486 | { |
487 | get | 487 | get |
488 | { | 488 | { |
489 | return m_NoStdLib; | 489 | return m_NoStdLib; |
490 | } | 490 | } |
491 | set | 491 | set |
492 | { | 492 | { |
493 | m_NoStdLib = value; | 493 | m_NoStdLib = value; |
494 | } | 494 | } |
495 | } | 495 | } |
496 | 496 | ||
497 | private readonly List<string> m_FieldsDefined = new List<string>(); | 497 | private readonly List<string> m_FieldsDefined = new List<string>(); |
498 | 498 | ||
499 | #endregion | 499 | #endregion |
500 | 500 | ||
501 | #region Constructors | 501 | #region Constructors |
502 | 502 | ||
503 | /// <summary> | 503 | /// <summary> |
504 | /// Initializes the <see cref="OptionsNode"/> class. | 504 | /// Initializes the <see cref="OptionsNode"/> class. |
505 | /// </summary> | 505 | /// </summary> |
506 | static OptionsNode() | 506 | static OptionsNode() |
507 | { | 507 | { |
508 | Type t = typeof(OptionsNode); | 508 | Type t = typeof(OptionsNode); |
509 | 509 | ||
510 | foreach(FieldInfo f in t.GetFields(BindingFlags.NonPublic | BindingFlags.Instance)) | 510 | foreach(FieldInfo f in t.GetFields(BindingFlags.NonPublic | BindingFlags.Instance)) |
511 | { | 511 | { |
512 | object[] attrs = f.GetCustomAttributes(typeof(OptionNodeAttribute), false); | 512 | object[] attrs = f.GetCustomAttributes(typeof(OptionNodeAttribute), false); |
513 | if(attrs == null || attrs.Length < 1) | 513 | if(attrs == null || attrs.Length < 1) |
514 | { | 514 | { |
515 | continue; | 515 | continue; |
516 | } | 516 | } |
517 | 517 | ||
518 | OptionNodeAttribute ona = (OptionNodeAttribute)attrs[0]; | 518 | OptionNodeAttribute ona = (OptionNodeAttribute)attrs[0]; |
519 | m_OptionFields[ona.NodeName] = f; | 519 | m_OptionFields[ona.NodeName] = f; |
520 | } | 520 | } |
521 | } | 521 | } |
522 | 522 | ||
523 | #endregion | 523 | #endregion |
524 | 524 | ||
525 | #region Properties | 525 | #region Properties |
526 | 526 | ||
527 | /// <summary> | 527 | /// <summary> |
528 | /// Gets the <see cref="Object"/> at the specified index. | 528 | /// Gets the <see cref="Object"/> at the specified index. |
529 | /// </summary> | 529 | /// </summary> |
530 | /// <value></value> | 530 | /// <value></value> |
531 | public object this[string index] | 531 | public object this[string index] |
532 | { | 532 | { |
533 | get | 533 | get |
534 | { | 534 | { |
535 | if(!m_OptionFields.ContainsKey(index)) | 535 | if(!m_OptionFields.ContainsKey(index)) |
536 | { | 536 | { |
537 | return null; | 537 | return null; |
538 | } | 538 | } |
539 | 539 | ||
540 | FieldInfo f = m_OptionFields[index]; | 540 | FieldInfo f = m_OptionFields[index]; |
541 | return f.GetValue(this); | 541 | return f.GetValue(this); |
542 | } | 542 | } |
543 | } | 543 | } |
544 | 544 | ||
545 | /// <summary> | 545 | /// <summary> |
546 | /// Gets the <see cref="Object"/> at the specified index. | 546 | /// Gets the <see cref="Object"/> at the specified index. |
547 | /// </summary> | 547 | /// </summary> |
548 | /// <value></value> | 548 | /// <value></value> |
549 | public object this[string index, object defaultValue] | 549 | public object this[string index, object defaultValue] |
550 | { | 550 | { |
551 | get | 551 | get |
552 | { | 552 | { |
553 | object valueObject = this[index]; | 553 | object valueObject = this[index]; |
554 | if(valueObject != null && valueObject is string && ((string)valueObject).Length == 0) | 554 | if(valueObject != null && valueObject is string && ((string)valueObject).Length == 0) |
555 | { | 555 | { |
556 | return defaultValue; | 556 | return defaultValue; |
557 | } | 557 | } |
558 | return valueObject; | 558 | return valueObject; |
559 | } | 559 | } |
560 | } | 560 | } |
561 | 561 | ||
562 | 562 | ||
563 | #endregion | 563 | #endregion |
564 | 564 | ||
565 | #region Private Methods | 565 | #region Private Methods |
566 | 566 | ||
567 | private void FlagDefined(string name) | 567 | private void FlagDefined(string name) |
568 | { | 568 | { |
569 | if(!m_FieldsDefined.Contains(name)) | 569 | if(!m_FieldsDefined.Contains(name)) |
570 | { | 570 | { |
571 | m_FieldsDefined.Add(name); | 571 | m_FieldsDefined.Add(name); |
572 | } | 572 | } |
573 | } | 573 | } |
574 | 574 | ||
575 | private void SetOption(string nodeName, string val) | 575 | private void SetOption(string nodeName, string val) |
576 | { | 576 | { |
577 | lock(m_OptionFields) | 577 | lock(m_OptionFields) |
578 | { | 578 | { |
579 | if(!m_OptionFields.ContainsKey(nodeName)) | 579 | if(!m_OptionFields.ContainsKey(nodeName)) |
580 | { | 580 | { |
581 | return; | 581 | return; |
582 | } | 582 | } |
583 | 583 | ||
584 | FieldInfo f = m_OptionFields[nodeName]; | 584 | FieldInfo f = m_OptionFields[nodeName]; |
585 | f.SetValue(this, Helper.TranslateValue(f.FieldType, val)); | 585 | f.SetValue(this, Helper.TranslateValue(f.FieldType, val)); |
586 | FlagDefined(f.Name); | 586 | FlagDefined(f.Name); |
587 | } | 587 | } |
588 | } | 588 | } |
589 | 589 | ||
590 | #endregion | 590 | #endregion |
591 | 591 | ||
592 | #region Public Methods | 592 | #region Public Methods |
593 | 593 | ||
594 | /// <summary> | 594 | /// <summary> |
595 | /// Parses the specified node. | 595 | /// Parses the specified node. |
596 | /// </summary> | 596 | /// </summary> |
597 | /// <param name="node">The node.</param> | 597 | /// <param name="node">The node.</param> |
598 | public override void Parse(XmlNode node) | 598 | public override void Parse(XmlNode node) |
599 | { | 599 | { |
600 | if( node == null ) | 600 | if( node == null ) |
601 | { | 601 | { |
602 | throw new ArgumentNullException("node"); | 602 | throw new ArgumentNullException("node"); |
603 | } | 603 | } |
604 | 604 | ||
605 | foreach(XmlNode child in node.ChildNodes) | 605 | foreach(XmlNode child in node.ChildNodes) |
606 | { | 606 | { |
607 | SetOption(child.Name, Helper.InterpolateForEnvironmentVariables(child.InnerText)); | 607 | SetOption(child.Name, Helper.InterpolateForEnvironmentVariables(child.InnerText)); |
608 | } | 608 | } |
609 | } | 609 | } |
610 | 610 | ||
611 | /// <summary> | 611 | /// <summary> |
612 | /// Copies to. | 612 | /// Copies to. |
613 | /// </summary> | 613 | /// </summary> |
614 | /// <param name="opt">The opt.</param> | 614 | /// <param name="opt">The opt.</param> |
615 | public void CopyTo(OptionsNode opt) | 615 | public void CopyTo(OptionsNode opt) |
616 | { | 616 | { |
617 | if(opt == null) | 617 | if(opt == null) |
618 | { | 618 | { |
619 | return; | 619 | return; |
620 | } | 620 | } |
621 | 621 | ||
622 | foreach(FieldInfo f in m_OptionFields.Values) | 622 | foreach(FieldInfo f in m_OptionFields.Values) |
623 | { | 623 | { |
624 | if(m_FieldsDefined.Contains(f.Name)) | 624 | if(m_FieldsDefined.Contains(f.Name)) |
625 | { | 625 | { |
626 | f.SetValue(opt, f.GetValue(this)); | 626 | f.SetValue(opt, f.GetValue(this)); |
627 | opt.m_FieldsDefined.Add(f.Name); | 627 | opt.m_FieldsDefined.Add(f.Name); |
628 | } | 628 | } |
629 | } | 629 | } |
630 | } | 630 | } |
631 | 631 | ||
632 | #endregion | 632 | #endregion |
633 | } | 633 | } |
634 | } | 634 | } |
diff --git a/Prebuild/src/Core/Nodes/ProcessNode.cs b/Prebuild/src/Core/Nodes/ProcessNode.cs index 8ca8e49..b05ffc6 100644 --- a/Prebuild/src/Core/Nodes/ProcessNode.cs +++ b/Prebuild/src/Core/Nodes/ProcessNode.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
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 |
@@ -32,77 +32,77 @@ using Prebuild.Core.Utilities; | |||
32 | 32 | ||
33 | namespace Prebuild.Core.Nodes | 33 | namespace Prebuild.Core.Nodes |
34 | { | 34 | { |
35 | /// <summary> | 35 | /// <summary> |
36 | /// | 36 | /// |
37 | /// </summary> | 37 | /// </summary> |
38 | [DataNode("Process")] | 38 | [DataNode("Process")] |
39 | public class ProcessNode : DataNode | 39 | public class ProcessNode : DataNode |
40 | { | 40 | { |
41 | #region Fields | 41 | #region Fields |
42 | 42 | ||
43 | private string m_Path; | 43 | private string m_Path; |
44 | private bool m_IsValid = true; | 44 | private bool m_IsValid = true; |
45 | 45 | ||
46 | #endregion | 46 | #endregion |
47 | 47 | ||
48 | #region Properties | 48 | #region Properties |
49 | 49 | ||
50 | /// <summary> | 50 | /// <summary> |
51 | /// Gets the path. | 51 | /// Gets the path. |
52 | /// </summary> | 52 | /// </summary> |
53 | /// <value>The path.</value> | 53 | /// <value>The path.</value> |
54 | public string Path | 54 | public string Path |
55 | { | 55 | { |
56 | get | 56 | get |
57 | { | 57 | { |
58 | return m_Path; | 58 | return m_Path; |
59 | } | 59 | } |
60 | } | 60 | } |
61 | 61 | ||
62 | /// <summary> | 62 | /// <summary> |
63 | /// Gets a value indicating whether this instance is valid. | 63 | /// Gets a value indicating whether this instance is valid. |
64 | /// </summary> | 64 | /// </summary> |
65 | /// <value><c>true</c> if this instance is valid; otherwise, <c>false</c>.</value> | 65 | /// <value><c>true</c> if this instance is valid; otherwise, <c>false</c>.</value> |
66 | public bool IsValid | 66 | public bool IsValid |
67 | { | 67 | { |
68 | get | 68 | get |
69 | { | 69 | { |
70 | return m_IsValid; | 70 | return m_IsValid; |
71 | } | 71 | } |
72 | } | 72 | } |
73 | 73 | ||
74 | #endregion | 74 | #endregion |
75 | 75 | ||
76 | #region Public Methods | 76 | #region Public Methods |
77 | 77 | ||
78 | /// <summary> | 78 | /// <summary> |
79 | /// Parses the specified node. | 79 | /// Parses the specified node. |
80 | /// </summary> | 80 | /// </summary> |
81 | /// <param name="node">The node.</param> | 81 | /// <param name="node">The node.</param> |
82 | public override void Parse(XmlNode node) | 82 | public override void Parse(XmlNode node) |
83 | { | 83 | { |
84 | if( node == null ) | 84 | if( node == null ) |
85 | { | 85 | { |
86 | throw new ArgumentNullException("node"); | 86 | throw new ArgumentNullException("node"); |
87 | } | 87 | } |
88 | 88 | ||
89 | m_Path = Helper.InterpolateForEnvironmentVariables(node.InnerText); | 89 | m_Path = Helper.InterpolateForEnvironmentVariables(node.InnerText); |
90 | if(m_Path == null) | 90 | if(m_Path == null) |
91 | { | 91 | { |
92 | m_Path = ""; | 92 | m_Path = ""; |
93 | } | 93 | } |
94 | 94 | ||
95 | try | 95 | try |
96 | { | 96 | { |
97 | m_Path = Helper.ResolvePath(m_Path); | 97 | m_Path = Helper.ResolvePath(m_Path); |
98 | } | 98 | } |
99 | catch(ArgumentException) | 99 | catch(ArgumentException) |
100 | { | 100 | { |
101 | Kernel.Instance.Log.Write(LogType.Warning, "Could not find prebuild file for processing: {0}", m_Path); | 101 | Kernel.Instance.Log.Write(LogType.Warning, "Could not find prebuild file for processing: {0}", m_Path); |
102 | m_IsValid = false; | 102 | m_IsValid = false; |
103 | } | 103 | } |
104 | } | 104 | } |
105 | 105 | ||
106 | #endregion | 106 | #endregion |
107 | } | 107 | } |
108 | } | 108 | } |
diff --git a/Prebuild/src/Core/Nodes/ProjectNode.cs b/Prebuild/src/Core/Nodes/ProjectNode.cs index a822704..e02b11b 100644 --- a/Prebuild/src/Core/Nodes/ProjectNode.cs +++ b/Prebuild/src/Core/Nodes/ProjectNode.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
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 |
@@ -34,65 +34,65 @@ using Prebuild.Core.Utilities; | |||
34 | 34 | ||
35 | namespace Prebuild.Core.Nodes | 35 | namespace Prebuild.Core.Nodes |
36 | { | 36 | { |
37 | /// <summary> | 37 | /// <summary> |
38 | /// A set of values that the Project's type can be | 38 | /// A set of values that the Project's type can be |
39 | /// </summary> | 39 | /// </summary> |
40 | public enum ProjectType | 40 | public enum ProjectType |
41 | { | 41 | { |
42 | /// <summary> | 42 | /// <summary> |
43 | /// The project is a console executable | 43 | /// The project is a console executable |
44 | /// </summary> | 44 | /// </summary> |
45 | Exe, | 45 | Exe, |
46 | /// <summary> | 46 | /// <summary> |
47 | /// The project is a windows executable | 47 | /// The project is a windows executable |
48 | /// </summary> | 48 | /// </summary> |
49 | WinExe, | 49 | WinExe, |
50 | /// <summary> | 50 | /// <summary> |
51 | /// The project is a library | 51 | /// The project is a library |
52 | /// </summary> | 52 | /// </summary> |
53 | Library, | 53 | Library, |
54 | /// <summary> | 54 | /// <summary> |
55 | /// The project is a website | 55 | /// The project is a website |
56 | /// </summary> | 56 | /// </summary> |
57 | Web, | 57 | Web, |
58 | } | 58 | } |
59 | 59 | ||
60 | /// <summary> | 60 | /// <summary> |
61 | /// | 61 | /// |
62 | /// </summary> | 62 | /// </summary> |
63 | public enum ClrRuntime | 63 | public enum ClrRuntime |
64 | { | 64 | { |
65 | /// <summary> | 65 | /// <summary> |
66 | /// | 66 | /// |
67 | /// </summary> | 67 | /// </summary> |
68 | Microsoft, | 68 | Microsoft, |
69 | /// <summary> | 69 | /// <summary> |
70 | /// | 70 | /// |
71 | /// </summary> | 71 | /// </summary> |
72 | Mono | 72 | Mono |
73 | } | 73 | } |
74 | /// <summary> | 74 | /// <summary> |
75 | /// The version of the .NET framework to use (Required for VS2008) | 75 | /// The version of the .NET framework to use (Required for VS2008) |
76 | /// <remarks>We don't need .NET 1.1 in here, it'll default when using vs2003.</remarks> | 76 | /// <remarks>We don't need .NET 1.1 in here, it'll default when using vs2003.</remarks> |
77 | /// </summary> | 77 | /// </summary> |
78 | public enum FrameworkVersion | 78 | public enum FrameworkVersion |
79 | { | 79 | { |
80 | /// <summary> | 80 | /// <summary> |
81 | /// .NET 2.0 | 81 | /// .NET 2.0 |
82 | /// </summary> | 82 | /// </summary> |
83 | v2_0, | 83 | v2_0, |
84 | /// <summary> | 84 | /// <summary> |
85 | /// .NET 3.0 | 85 | /// .NET 3.0 |
86 | /// </summary> | 86 | /// </summary> |
87 | v3_0, | 87 | v3_0, |
88 | /// <summary> | 88 | /// <summary> |
89 | /// .NET 3.5 | 89 | /// .NET 3.5 |
90 | /// </summary> | 90 | /// </summary> |
91 | v3_5, | 91 | v3_5, |
92 | /// <summary> | 92 | /// <summary> |
93 | /// .NET 4.0 | 93 | /// .NET 4.0 |
94 | /// </summary> | 94 | /// </summary> |
95 | v4_0, | 95 | v4_0, |
96 | /// <summary> | 96 | /// <summary> |
97 | /// .NET 4.5 | 97 | /// .NET 4.5 |
98 | /// </summary> | 98 | /// </summary> |
@@ -102,477 +102,477 @@ namespace Prebuild.Core.Nodes | |||
102 | /// </summary> | 102 | /// </summary> |
103 | v4_5_1 | 103 | v4_5_1 |
104 | } | 104 | } |
105 | /// <summary> | 105 | /// <summary> |
106 | /// The Node object representing /Prebuild/Solution/Project elements | 106 | /// The Node object representing /Prebuild/Solution/Project elements |
107 | /// </summary> | 107 | /// </summary> |
108 | [DataNode("Project")] | 108 | [DataNode("Project")] |
109 | public class ProjectNode : DataNode, IComparable | 109 | public class ProjectNode : DataNode, IComparable |
110 | { | 110 | { |
111 | #region Fields | 111 | #region Fields |
112 | 112 | ||
113 | private string m_Name = "unknown"; | 113 | private string m_Name = "unknown"; |
114 | private string m_Path = ""; | 114 | private string m_Path = ""; |
115 | private string m_FullPath = ""; | 115 | private string m_FullPath = ""; |
116 | private string m_AssemblyName; | 116 | private string m_AssemblyName; |
117 | private string m_AppIcon = ""; | 117 | private string m_AppIcon = ""; |
118 | private string m_ConfigFile = ""; | 118 | private string m_ConfigFile = ""; |
119 | private string m_DesignerFolder = ""; | 119 | private string m_DesignerFolder = ""; |
120 | private string m_Language = "C#"; | 120 | private string m_Language = "C#"; |
121 | private ProjectType m_Type = ProjectType.Exe; | 121 | private ProjectType m_Type = ProjectType.Exe; |
122 | private ClrRuntime m_Runtime = ClrRuntime.Microsoft; | 122 | private ClrRuntime m_Runtime = ClrRuntime.Microsoft; |
123 | private FrameworkVersion m_Framework = FrameworkVersion.v2_0; | 123 | private FrameworkVersion m_Framework = FrameworkVersion.v2_0; |
124 | private string m_StartupObject = ""; | 124 | private string m_StartupObject = ""; |
125 | private string m_RootNamespace; | 125 | private string m_RootNamespace; |
126 | private string m_FilterGroups = ""; | 126 | private string m_FilterGroups = ""; |
127 | private string m_Version = ""; | 127 | private string m_Version = ""; |
128 | private Guid m_Guid; | 128 | private Guid m_Guid; |
129 | private string m_DebugStartParameters; | 129 | private string m_DebugStartParameters; |
130 | 130 | ||
131 | private readonly Dictionary<string, ConfigurationNode> m_Configurations = new Dictionary<string, ConfigurationNode>(); | 131 | private readonly Dictionary<string, ConfigurationNode> m_Configurations = new Dictionary<string, ConfigurationNode>(); |
132 | private readonly List<ReferencePathNode> m_ReferencePaths = new List<ReferencePathNode>(); | 132 | private readonly List<ReferencePathNode> m_ReferencePaths = new List<ReferencePathNode>(); |
133 | private readonly List<ReferenceNode> m_References = new List<ReferenceNode>(); | 133 | private readonly List<ReferenceNode> m_References = new List<ReferenceNode>(); |
134 | private readonly List<AuthorNode> m_Authors = new List<AuthorNode>(); | 134 | private readonly List<AuthorNode> m_Authors = new List<AuthorNode>(); |
135 | private FilesNode m_Files; | 135 | private FilesNode m_Files; |
136 | 136 | ||
137 | #endregion | 137 | #endregion |
138 | 138 | ||
139 | #region Properties | 139 | #region Properties |
140 | 140 | ||
141 | /// <summary> | 141 | /// <summary> |
142 | /// Gets the name. | 142 | /// Gets the name. |
143 | /// </summary> | 143 | /// </summary> |
144 | /// <value>The name.</value> | 144 | /// <value>The name.</value> |
145 | public string Name | 145 | public string Name |
146 | { | 146 | { |
147 | get | 147 | get |
148 | { | 148 | { |
149 | return m_Name; | 149 | return m_Name; |
150 | } | 150 | } |
151 | } | 151 | } |
152 | /// <summary> | 152 | /// <summary> |
153 | /// The version of the .NET Framework to compile under | 153 | /// The version of the .NET Framework to compile under |
154 | /// </summary> | 154 | /// </summary> |
155 | public FrameworkVersion FrameworkVersion | 155 | public FrameworkVersion FrameworkVersion |
156 | { | 156 | { |
157 | get | 157 | get |
158 | { | 158 | { |
159 | return m_Framework; | 159 | return m_Framework; |
160 | } | 160 | } |
161 | } | 161 | } |
162 | /// <summary> | 162 | /// <summary> |
163 | /// Gets the path. | 163 | /// Gets the path. |
164 | /// </summary> | 164 | /// </summary> |
165 | /// <value>The path.</value> | 165 | /// <value>The path.</value> |
166 | public string Path | 166 | public string Path |
167 | { | 167 | { |
168 | get | 168 | get |
169 | { | 169 | { |
170 | return m_Path; | 170 | return m_Path; |
171 | } | 171 | } |
172 | } | 172 | } |
173 | 173 | ||
174 | /// <summary> | 174 | /// <summary> |
175 | /// Gets the filter groups. | 175 | /// Gets the filter groups. |
176 | /// </summary> | 176 | /// </summary> |
177 | /// <value>The filter groups.</value> | 177 | /// <value>The filter groups.</value> |
178 | public string FilterGroups | 178 | public string FilterGroups |
179 | { | 179 | { |
180 | get | 180 | get |
181 | { | 181 | { |
182 | return m_FilterGroups; | 182 | return m_FilterGroups; |
183 | } | 183 | } |
184 | } | 184 | } |
185 | 185 | ||
186 | /// <summary> | 186 | /// <summary> |
187 | /// Gets the project's version | 187 | /// Gets the project's version |
188 | /// </summary> | 188 | /// </summary> |
189 | /// <value>The project's version.</value> | 189 | /// <value>The project's version.</value> |
190 | public string Version | 190 | public string Version |
191 | { | 191 | { |
192 | get | 192 | get |
193 | { | 193 | { |
194 | return m_Version; | 194 | return m_Version; |
195 | } | 195 | } |
196 | } | 196 | } |
197 | 197 | ||
198 | /// <summary> | 198 | /// <summary> |
199 | /// Gets the full path. | 199 | /// Gets the full path. |
200 | /// </summary> | 200 | /// </summary> |
201 | /// <value>The full path.</value> | 201 | /// <value>The full path.</value> |
202 | public string FullPath | 202 | public string FullPath |
203 | { | 203 | { |
204 | get | 204 | get |
205 | { | 205 | { |
206 | return m_FullPath; | 206 | return m_FullPath; |
207 | } | 207 | } |
208 | } | 208 | } |
209 | 209 | ||
210 | /// <summary> | 210 | /// <summary> |
211 | /// Gets the name of the assembly. | 211 | /// Gets the name of the assembly. |
212 | /// </summary> | 212 | /// </summary> |
213 | /// <value>The name of the assembly.</value> | 213 | /// <value>The name of the assembly.</value> |
214 | public string AssemblyName | 214 | public string AssemblyName |
215 | { | 215 | { |
216 | get | 216 | get |
217 | { | 217 | { |
218 | return m_AssemblyName; | 218 | return m_AssemblyName; |
219 | } | 219 | } |
220 | } | 220 | } |
221 | 221 | ||
222 | /// <summary> | 222 | /// <summary> |
223 | /// Gets the app icon. | 223 | /// Gets the app icon. |
224 | /// </summary> | 224 | /// </summary> |
225 | /// <value>The app icon.</value> | 225 | /// <value>The app icon.</value> |
226 | public string AppIcon | 226 | public string AppIcon |
227 | { | 227 | { |
228 | get | 228 | get |
229 | { | 229 | { |
230 | return m_AppIcon; | 230 | return m_AppIcon; |
231 | } | 231 | } |
232 | } | 232 | } |
233 | 233 | ||
234 | /// <summary> | 234 | /// <summary> |
235 | /// Gets the app icon. | 235 | /// Gets the app icon. |
236 | /// </summary> | 236 | /// </summary> |
237 | /// <value>The app icon.</value> | 237 | /// <value>The app icon.</value> |
238 | public string ConfigFile | 238 | public string ConfigFile |
239 | { | 239 | { |
240 | get | 240 | get |
241 | { | 241 | { |
242 | return m_ConfigFile; | 242 | return m_ConfigFile; |
243 | } | 243 | } |
244 | } | 244 | } |
245 | 245 | ||
246 | /// <summary> | 246 | /// <summary> |
247 | /// | 247 | /// |
248 | /// </summary> | 248 | /// </summary> |
249 | public string DesignerFolder | 249 | public string DesignerFolder |
250 | { | 250 | { |
251 | get | 251 | get |
252 | { | 252 | { |
253 | return m_DesignerFolder; | 253 | return m_DesignerFolder; |
254 | } | 254 | } |
255 | } | 255 | } |
256 | 256 | ||
257 | /// <summary> | 257 | /// <summary> |
258 | /// Gets the language. | 258 | /// Gets the language. |
259 | /// </summary> | 259 | /// </summary> |
260 | /// <value>The language.</value> | 260 | /// <value>The language.</value> |
261 | public string Language | 261 | public string Language |
262 | { | 262 | { |
263 | get | 263 | get |
264 | { | 264 | { |
265 | return m_Language; | 265 | return m_Language; |
266 | } | 266 | } |
267 | } | 267 | } |
268 | 268 | ||
269 | /// <summary> | 269 | /// <summary> |
270 | /// Gets the type. | 270 | /// Gets the type. |
271 | /// </summary> | 271 | /// </summary> |
272 | /// <value>The type.</value> | 272 | /// <value>The type.</value> |
273 | public ProjectType Type | 273 | public ProjectType Type |
274 | { | 274 | { |
275 | get | 275 | get |
276 | { | 276 | { |
277 | return m_Type; | 277 | return m_Type; |
278 | } | 278 | } |
279 | } | 279 | } |
280 | 280 | ||
281 | /// <summary> | 281 | /// <summary> |
282 | /// Gets the runtime. | 282 | /// Gets the runtime. |
283 | /// </summary> | 283 | /// </summary> |
284 | /// <value>The runtime.</value> | 284 | /// <value>The runtime.</value> |
285 | public ClrRuntime Runtime | 285 | public ClrRuntime Runtime |
286 | { | 286 | { |
287 | get | 287 | get |
288 | { | 288 | { |
289 | return m_Runtime; | 289 | return m_Runtime; |
290 | } | 290 | } |
291 | } | 291 | } |
292 | 292 | ||
293 | private bool m_GenerateAssemblyInfoFile; | 293 | private bool m_GenerateAssemblyInfoFile; |
294 | 294 | ||
295 | /// <summary> | 295 | /// <summary> |
296 | /// | 296 | /// |
297 | /// </summary> | 297 | /// </summary> |
298 | public bool GenerateAssemblyInfoFile | 298 | public bool GenerateAssemblyInfoFile |
299 | { | 299 | { |
300 | get | 300 | get |
301 | { | 301 | { |
302 | return m_GenerateAssemblyInfoFile; | 302 | return m_GenerateAssemblyInfoFile; |
303 | } | 303 | } |
304 | set | 304 | set |
305 | { | 305 | { |
306 | m_GenerateAssemblyInfoFile = value; | 306 | m_GenerateAssemblyInfoFile = value; |
307 | } | 307 | } |
308 | } | 308 | } |
309 | 309 | ||
310 | /// <summary> | 310 | /// <summary> |
311 | /// Gets the startup object. | 311 | /// Gets the startup object. |
312 | /// </summary> | 312 | /// </summary> |
313 | /// <value>The startup object.</value> | 313 | /// <value>The startup object.</value> |
314 | public string StartupObject | 314 | public string StartupObject |
315 | { | 315 | { |
316 | get | 316 | get |
317 | { | 317 | { |
318 | return m_StartupObject; | 318 | return m_StartupObject; |
319 | } | 319 | } |
320 | } | 320 | } |
321 | 321 | ||
322 | /// <summary> | 322 | /// <summary> |
323 | /// Gets the root namespace. | 323 | /// Gets the root namespace. |
324 | /// </summary> | 324 | /// </summary> |
325 | /// <value>The root namespace.</value> | 325 | /// <value>The root namespace.</value> |
326 | public string RootNamespace | 326 | public string RootNamespace |
327 | { | 327 | { |
328 | get | 328 | get |
329 | { | 329 | { |
330 | return m_RootNamespace; | 330 | return m_RootNamespace; |
331 | } | 331 | } |
332 | } | 332 | } |
333 | 333 | ||
334 | /// <summary> | 334 | /// <summary> |
335 | /// Gets the configurations. | 335 | /// Gets the configurations. |
336 | /// </summary> | 336 | /// </summary> |
337 | /// <value>The configurations.</value> | 337 | /// <value>The configurations.</value> |
338 | public List<ConfigurationNode> Configurations | 338 | public List<ConfigurationNode> Configurations |
339 | { | 339 | { |
340 | get | 340 | get |
341 | { | 341 | { |
342 | List<ConfigurationNode> tmp = new List<ConfigurationNode>(ConfigurationsTable.Values); | 342 | List<ConfigurationNode> tmp = new List<ConfigurationNode>(ConfigurationsTable.Values); |
343 | tmp.Sort(); | 343 | tmp.Sort(); |
344 | return tmp; | 344 | return tmp; |
345 | } | 345 | } |
346 | } | 346 | } |
347 | 347 | ||
348 | /// <summary> | 348 | /// <summary> |
349 | /// Gets the configurations table. | 349 | /// Gets the configurations table. |
350 | /// </summary> | 350 | /// </summary> |
351 | /// <value>The configurations table.</value> | 351 | /// <value>The configurations table.</value> |
352 | public Dictionary<string, ConfigurationNode> ConfigurationsTable | 352 | public Dictionary<string, ConfigurationNode> ConfigurationsTable |
353 | { | 353 | { |
354 | get | 354 | get |
355 | { | 355 | { |
356 | return m_Configurations; | 356 | return m_Configurations; |
357 | } | 357 | } |
358 | } | 358 | } |
359 | 359 | ||
360 | /// <summary> | 360 | /// <summary> |
361 | /// Gets the reference paths. | 361 | /// Gets the reference paths. |
362 | /// </summary> | 362 | /// </summary> |
363 | /// <value>The reference paths.</value> | 363 | /// <value>The reference paths.</value> |
364 | public List<ReferencePathNode> ReferencePaths | 364 | public List<ReferencePathNode> ReferencePaths |
365 | { | 365 | { |
366 | get | 366 | get |
367 | { | 367 | { |
368 | List<ReferencePathNode> tmp = new List<ReferencePathNode>(m_ReferencePaths); | 368 | List<ReferencePathNode> tmp = new List<ReferencePathNode>(m_ReferencePaths); |
369 | tmp.Sort(); | 369 | tmp.Sort(); |
370 | return tmp; | 370 | return tmp; |
371 | } | 371 | } |
372 | } | 372 | } |
373 | 373 | ||
374 | /// <summary> | 374 | /// <summary> |
375 | /// Gets the references. | 375 | /// Gets the references. |
376 | /// </summary> | 376 | /// </summary> |
377 | /// <value>The references.</value> | 377 | /// <value>The references.</value> |
378 | public List<ReferenceNode> References | 378 | public List<ReferenceNode> References |
379 | { | 379 | { |
380 | get | 380 | get |
381 | { | 381 | { |
382 | List<ReferenceNode> tmp = new List<ReferenceNode>(m_References); | 382 | List<ReferenceNode> tmp = new List<ReferenceNode>(m_References); |
383 | tmp.Sort(); | 383 | tmp.Sort(); |
384 | return tmp; | 384 | return tmp; |
385 | } | 385 | } |
386 | } | 386 | } |
387 | 387 | ||
388 | /// <summary> | 388 | /// <summary> |
389 | /// Gets the Authors list. | 389 | /// Gets the Authors list. |
390 | /// </summary> | 390 | /// </summary> |
391 | /// <value>The list of the project's authors.</value> | 391 | /// <value>The list of the project's authors.</value> |
392 | public List<AuthorNode> Authors | 392 | public List<AuthorNode> Authors |
393 | { | 393 | { |
394 | get | 394 | get |
395 | { | 395 | { |
396 | return m_Authors; | 396 | return m_Authors; |
397 | } | 397 | } |
398 | } | 398 | } |
399 | 399 | ||
400 | /// <summary> | 400 | /// <summary> |
401 | /// Gets the files. | 401 | /// Gets the files. |
402 | /// </summary> | 402 | /// </summary> |
403 | /// <value>The files.</value> | 403 | /// <value>The files.</value> |
404 | public FilesNode Files | 404 | public FilesNode Files |
405 | { | 405 | { |
406 | get | 406 | get |
407 | { | 407 | { |
408 | return m_Files; | 408 | return m_Files; |
409 | } | 409 | } |
410 | } | 410 | } |
411 | 411 | ||
412 | /// <summary> | 412 | /// <summary> |
413 | /// Gets or sets the parent. | 413 | /// Gets or sets the parent. |
414 | /// </summary> | 414 | /// </summary> |
415 | /// <value>The parent.</value> | 415 | /// <value>The parent.</value> |
416 | public override IDataNode Parent | 416 | public override IDataNode Parent |
417 | { | 417 | { |
418 | get | 418 | get |
419 | { | 419 | { |
420 | return base.Parent; | 420 | return base.Parent; |
421 | } | 421 | } |
422 | set | 422 | set |
423 | { | 423 | { |
424 | base.Parent = value; | 424 | base.Parent = value; |
425 | if(base.Parent is SolutionNode && m_Configurations.Count < 1) | 425 | if(base.Parent is SolutionNode && m_Configurations.Count < 1) |
426 | { | 426 | { |
427 | SolutionNode parent = (SolutionNode)base.Parent; | 427 | SolutionNode parent = (SolutionNode)base.Parent; |
428 | foreach(ConfigurationNode conf in parent.Configurations) | 428 | foreach(ConfigurationNode conf in parent.Configurations) |
429 | { | 429 | { |
430 | m_Configurations[conf.NameAndPlatform] = (ConfigurationNode) conf.Clone(); | 430 | m_Configurations[conf.NameAndPlatform] = (ConfigurationNode) conf.Clone(); |
431 | } | 431 | } |
432 | } | 432 | } |
433 | } | 433 | } |
434 | } | 434 | } |
435 | 435 | ||
436 | /// <summary> | 436 | /// <summary> |
437 | /// Gets the GUID. | 437 | /// Gets the GUID. |
438 | /// </summary> | 438 | /// </summary> |
439 | /// <value>The GUID.</value> | 439 | /// <value>The GUID.</value> |
440 | public Guid Guid | 440 | public Guid Guid |
441 | { | 441 | { |
442 | get | 442 | get |
443 | { | 443 | { |
444 | return m_Guid; | 444 | return m_Guid; |
445 | } | 445 | } |
446 | } | 446 | } |
447 | 447 | ||
448 | public string DebugStartParameters | 448 | public string DebugStartParameters |
449 | { | 449 | { |
450 | get | 450 | get |
451 | { | 451 | { |
452 | return m_DebugStartParameters; | 452 | return m_DebugStartParameters; |
453 | } | 453 | } |
454 | } | 454 | } |
455 | 455 | ||
456 | #endregion | 456 | #endregion |
457 | 457 | ||
458 | #region Private Methods | 458 | #region Private Methods |
459 | 459 | ||
460 | private void HandleConfiguration(ConfigurationNode conf) | 460 | private void HandleConfiguration(ConfigurationNode conf) |
461 | { | 461 | { |
462 | if(String.Compare(conf.Name, "all", true) == 0) //apply changes to all, this may not always be applied first, | 462 | if(String.Compare(conf.Name, "all", true) == 0) //apply changes to all, this may not always be applied first, |
463 | //so it *may* override changes to the same properties for configurations defines at the project level | 463 | //so it *may* override changes to the same properties for configurations defines at the project level |
464 | { | 464 | { |
465 | foreach(ConfigurationNode confNode in m_Configurations.Values) | 465 | foreach(ConfigurationNode confNode in m_Configurations.Values) |
466 | { | 466 | { |
467 | conf.CopyTo(confNode);//update the config templates defines at the project level with the overrides | 467 | conf.CopyTo(confNode);//update the config templates defines at the project level with the overrides |
468 | } | 468 | } |
469 | } | 469 | } |
470 | if(m_Configurations.ContainsKey(conf.NameAndPlatform)) | 470 | if(m_Configurations.ContainsKey(conf.NameAndPlatform)) |
471 | { | 471 | { |
472 | ConfigurationNode parentConf = m_Configurations[conf.NameAndPlatform]; | 472 | ConfigurationNode parentConf = m_Configurations[conf.NameAndPlatform]; |
473 | conf.CopyTo(parentConf);//update the config templates defines at the project level with the overrides | 473 | conf.CopyTo(parentConf);//update the config templates defines at the project level with the overrides |
474 | } | 474 | } |
475 | else | 475 | else |
476 | { | 476 | { |
477 | m_Configurations[conf.NameAndPlatform] = conf; | 477 | m_Configurations[conf.NameAndPlatform] = conf; |
478 | } | 478 | } |
479 | } | 479 | } |
480 | 480 | ||
481 | #endregion | 481 | #endregion |
482 | 482 | ||
483 | #region Public Methods | 483 | #region Public Methods |
484 | 484 | ||
485 | /// <summary> | 485 | /// <summary> |
486 | /// Parses the specified node. | 486 | /// Parses the specified node. |
487 | /// </summary> | 487 | /// </summary> |
488 | /// <param name="node">The node.</param> | 488 | /// <param name="node">The node.</param> |
489 | public override void Parse(XmlNode node) | 489 | public override void Parse(XmlNode node) |
490 | { | 490 | { |
491 | m_Name = Helper.AttributeValue(node, "name", m_Name); | 491 | m_Name = Helper.AttributeValue(node, "name", m_Name); |
492 | m_Path = Helper.AttributeValue(node, "path", m_Path); | 492 | m_Path = Helper.AttributeValue(node, "path", m_Path); |
493 | m_FilterGroups = Helper.AttributeValue(node, "filterGroups", m_FilterGroups); | 493 | m_FilterGroups = Helper.AttributeValue(node, "filterGroups", m_FilterGroups); |
494 | m_Version = Helper.AttributeValue(node, "version", m_Version); | 494 | m_Version = Helper.AttributeValue(node, "version", m_Version); |
495 | m_AppIcon = Helper.AttributeValue(node, "icon", m_AppIcon); | 495 | m_AppIcon = Helper.AttributeValue(node, "icon", m_AppIcon); |
496 | m_ConfigFile = Helper.AttributeValue(node, "configFile", m_ConfigFile); | 496 | m_ConfigFile = Helper.AttributeValue(node, "configFile", m_ConfigFile); |
497 | m_DesignerFolder = Helper.AttributeValue(node, "designerFolder", m_DesignerFolder); | 497 | m_DesignerFolder = Helper.AttributeValue(node, "designerFolder", m_DesignerFolder); |
498 | m_AssemblyName = Helper.AttributeValue(node, "assemblyName", m_AssemblyName); | 498 | m_AssemblyName = Helper.AttributeValue(node, "assemblyName", m_AssemblyName); |
499 | m_Language = Helper.AttributeValue(node, "language", m_Language); | 499 | m_Language = Helper.AttributeValue(node, "language", m_Language); |
500 | m_Type = (ProjectType)Helper.EnumAttributeValue(node, "type", typeof(ProjectType), m_Type); | 500 | m_Type = (ProjectType)Helper.EnumAttributeValue(node, "type", typeof(ProjectType), m_Type); |
501 | m_Runtime = (ClrRuntime)Helper.EnumAttributeValue(node, "runtime", typeof(ClrRuntime), m_Runtime); | 501 | m_Runtime = (ClrRuntime)Helper.EnumAttributeValue(node, "runtime", typeof(ClrRuntime), m_Runtime); |
502 | m_Framework = (FrameworkVersion)Helper.EnumAttributeValue(node, "frameworkVersion", typeof(FrameworkVersion), m_Framework); | 502 | m_Framework = (FrameworkVersion)Helper.EnumAttributeValue(node, "frameworkVersion", typeof(FrameworkVersion), m_Framework); |
503 | m_StartupObject = Helper.AttributeValue(node, "startupObject", m_StartupObject); | 503 | m_StartupObject = Helper.AttributeValue(node, "startupObject", m_StartupObject); |
504 | m_RootNamespace = Helper.AttributeValue(node, "rootNamespace", m_RootNamespace); | 504 | m_RootNamespace = Helper.AttributeValue(node, "rootNamespace", m_RootNamespace); |
505 | 505 | ||
506 | int hash = m_Name.GetHashCode(); | 506 | int hash = m_Name.GetHashCode(); |
507 | Guid guidByHash = new Guid(hash, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); | 507 | Guid guidByHash = new Guid(hash, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); |
508 | string guid = Helper.AttributeValue(node, "guid", guidByHash.ToString()); | 508 | string guid = Helper.AttributeValue(node, "guid", guidByHash.ToString()); |
509 | m_Guid = new Guid(guid); | 509 | m_Guid = new Guid(guid); |
510 | 510 | ||
511 | m_GenerateAssemblyInfoFile = Helper.ParseBoolean(node, "generateAssemblyInfoFile", false); | 511 | m_GenerateAssemblyInfoFile = Helper.ParseBoolean(node, "generateAssemblyInfoFile", false); |
512 | m_DebugStartParameters = Helper.AttributeValue(node, "debugStartParameters", string.Empty); | 512 | m_DebugStartParameters = Helper.AttributeValue(node, "debugStartParameters", string.Empty); |
513 | 513 | ||
514 | if(string.IsNullOrEmpty(m_AssemblyName)) | 514 | if(string.IsNullOrEmpty(m_AssemblyName)) |
515 | { | 515 | { |
516 | m_AssemblyName = m_Name; | 516 | m_AssemblyName = m_Name; |
517 | } | 517 | } |
518 | 518 | ||
519 | if(string.IsNullOrEmpty(m_RootNamespace)) | 519 | if(string.IsNullOrEmpty(m_RootNamespace)) |
520 | { | 520 | { |
521 | m_RootNamespace = m_Name; | 521 | m_RootNamespace = m_Name; |
522 | } | 522 | } |
523 | 523 | ||
524 | m_FullPath = m_Path; | 524 | m_FullPath = m_Path; |
525 | try | 525 | try |
526 | { | 526 | { |
527 | m_FullPath = Helper.ResolvePath(m_FullPath); | 527 | m_FullPath = Helper.ResolvePath(m_FullPath); |
528 | } | 528 | } |
529 | catch | 529 | catch |
530 | { | 530 | { |
531 | throw new WarningException("Could not resolve Solution path: {0}", m_Path); | 531 | throw new WarningException("Could not resolve Solution path: {0}", m_Path); |
532 | } | 532 | } |
533 | 533 | ||
534 | Kernel.Instance.CurrentWorkingDirectory.Push(); | 534 | Kernel.Instance.CurrentWorkingDirectory.Push(); |
535 | try | 535 | try |
536 | { | 536 | { |
537 | Helper.SetCurrentDir(m_FullPath); | 537 | Helper.SetCurrentDir(m_FullPath); |
538 | 538 | ||
539 | if( node == null ) | 539 | if( node == null ) |
540 | { | 540 | { |
541 | throw new ArgumentNullException("node"); | 541 | throw new ArgumentNullException("node"); |
542 | } | 542 | } |
543 | 543 | ||
544 | foreach(XmlNode child in node.ChildNodes) | 544 | foreach(XmlNode child in node.ChildNodes) |
545 | { | 545 | { |
546 | IDataNode dataNode = Kernel.Instance.ParseNode(child, this); | 546 | IDataNode dataNode = Kernel.Instance.ParseNode(child, this); |
547 | if(dataNode is ConfigurationNode) | 547 | if(dataNode is ConfigurationNode) |
548 | { | 548 | { |
549 | HandleConfiguration((ConfigurationNode)dataNode); | 549 | HandleConfiguration((ConfigurationNode)dataNode); |
550 | } | 550 | } |
551 | else if(dataNode is ReferencePathNode) | 551 | else if(dataNode is ReferencePathNode) |
552 | { | 552 | { |
553 | m_ReferencePaths.Add((ReferencePathNode)dataNode); | 553 | m_ReferencePaths.Add((ReferencePathNode)dataNode); |
554 | } | 554 | } |
555 | else if(dataNode is ReferenceNode) | 555 | else if(dataNode is ReferenceNode) |
556 | { | 556 | { |
557 | m_References.Add((ReferenceNode)dataNode); | 557 | m_References.Add((ReferenceNode)dataNode); |
558 | } | 558 | } |
559 | else if(dataNode is AuthorNode) | 559 | else if(dataNode is AuthorNode) |
560 | { | 560 | { |
561 | m_Authors.Add((AuthorNode)dataNode); | 561 | m_Authors.Add((AuthorNode)dataNode); |
562 | } | 562 | } |
563 | else if(dataNode is FilesNode) | 563 | else if(dataNode is FilesNode) |
564 | { | 564 | { |
565 | m_Files = (FilesNode)dataNode; | 565 | m_Files = (FilesNode)dataNode; |
566 | } | 566 | } |
567 | } | 567 | } |
568 | } | 568 | } |
569 | finally | 569 | finally |
570 | { | 570 | { |
571 | Kernel.Instance.CurrentWorkingDirectory.Pop(); | 571 | Kernel.Instance.CurrentWorkingDirectory.Pop(); |
572 | } | 572 | } |
573 | } | 573 | } |
574 | 574 | ||
575 | #endregion | 575 | #endregion |
576 | 576 | ||
577 | #region IComparable Members | 577 | #region IComparable Members |
578 | 578 | ||
@@ -582,6 +582,6 @@ namespace Prebuild.Core.Nodes | |||
582 | return m_Name.CompareTo(that.m_Name); | 582 | return m_Name.CompareTo(that.m_Name); |
583 | } | 583 | } |
584 | 584 | ||
585 | #endregion | 585 | #endregion |
586 | } | 586 | } |
587 | } | 587 | } |
diff --git a/Prebuild/src/Core/Nodes/ReferenceNode.cs b/Prebuild/src/Core/Nodes/ReferenceNode.cs index 9c5d1a3..9afb512 100644 --- a/Prebuild/src/Core/Nodes/ReferenceNode.cs +++ b/Prebuild/src/Core/Nodes/ReferenceNode.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
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 |
@@ -32,104 +32,104 @@ using Prebuild.Core.Utilities; | |||
32 | 32 | ||
33 | namespace Prebuild.Core.Nodes | 33 | namespace Prebuild.Core.Nodes |
34 | { | 34 | { |
35 | /// <summary> | 35 | /// <summary> |
36 | /// | 36 | /// |
37 | /// </summary> | 37 | /// </summary> |
38 | [DataNode("Reference")] | 38 | [DataNode("Reference")] |
39 | public class ReferenceNode : DataNode, IComparable | 39 | public class ReferenceNode : DataNode, IComparable |
40 | { | 40 | { |
41 | #region Fields | 41 | #region Fields |
42 | 42 | ||
43 | private string m_Name = "unknown"; | 43 | private string m_Name = "unknown"; |
44 | private string m_Path; | 44 | private string m_Path; |
45 | private string m_LocalCopy; | 45 | private string m_LocalCopy; |
46 | private string m_Version; | 46 | private string m_Version; |
47 | 47 | ||
48 | #endregion | 48 | #endregion |
49 | 49 | ||
50 | #region Properties | 50 | #region Properties |
51 | 51 | ||
52 | /// <summary> | 52 | /// <summary> |
53 | /// Gets the name. | 53 | /// Gets the name. |
54 | /// </summary> | 54 | /// </summary> |
55 | /// <value>The name.</value> | 55 | /// <value>The name.</value> |
56 | public string Name | 56 | public string Name |
57 | { | 57 | { |
58 | get | 58 | get |
59 | { | 59 | { |
60 | return m_Name; | 60 | return m_Name; |
61 | } | 61 | } |
62 | } | 62 | } |
63 | 63 | ||
64 | /// <summary> | 64 | /// <summary> |
65 | /// Gets the path. | 65 | /// Gets the path. |
66 | /// </summary> | 66 | /// </summary> |
67 | /// <value>The path.</value> | 67 | /// <value>The path.</value> |
68 | public string Path | 68 | public string Path |
69 | { | 69 | { |
70 | get | 70 | get |
71 | { | 71 | { |
72 | return m_Path; | 72 | return m_Path; |
73 | } | 73 | } |
74 | } | 74 | } |
75 | 75 | ||
76 | /// <summary> | 76 | /// <summary> |
77 | /// Gets a value indicating whether [local copy specified]. | 77 | /// Gets a value indicating whether [local copy specified]. |
78 | /// </summary> | 78 | /// </summary> |
79 | /// <value><c>true</c> if [local copy specified]; otherwise, <c>false</c>.</value> | 79 | /// <value><c>true</c> if [local copy specified]; otherwise, <c>false</c>.</value> |
80 | public bool LocalCopySpecified | 80 | public bool LocalCopySpecified |
81 | { | 81 | { |
82 | get | 82 | get |
83 | { | 83 | { |
84 | return ( m_LocalCopy != null && m_LocalCopy.Length == 0); | 84 | return ( m_LocalCopy != null && m_LocalCopy.Length == 0); |
85 | } | 85 | } |
86 | } | 86 | } |
87 | 87 | ||
88 | /// <summary> | 88 | /// <summary> |
89 | /// Gets a value indicating whether [local copy]. | 89 | /// Gets a value indicating whether [local copy]. |
90 | /// </summary> | 90 | /// </summary> |
91 | /// <value><c>true</c> if [local copy]; otherwise, <c>false</c>.</value> | 91 | /// <value><c>true</c> if [local copy]; otherwise, <c>false</c>.</value> |
92 | public bool LocalCopy | 92 | public bool LocalCopy |
93 | { | 93 | { |
94 | get | 94 | get |
95 | { | 95 | { |
96 | if( m_LocalCopy == null) | 96 | if( m_LocalCopy == null) |
97 | { | 97 | { |
98 | return false; | 98 | return false; |
99 | } | 99 | } |
100 | return bool.Parse(m_LocalCopy); | 100 | return bool.Parse(m_LocalCopy); |
101 | } | 101 | } |
102 | } | 102 | } |
103 | 103 | ||
104 | /// <summary> | 104 | /// <summary> |
105 | /// Gets the version. | 105 | /// Gets the version. |
106 | /// </summary> | 106 | /// </summary> |
107 | /// <value>The version.</value> | 107 | /// <value>The version.</value> |
108 | public string Version | 108 | public string Version |
109 | { | 109 | { |
110 | get | 110 | get |
111 | { | 111 | { |
112 | return m_Version; | 112 | return m_Version; |
113 | } | 113 | } |
114 | } | 114 | } |
115 | 115 | ||
116 | #endregion | 116 | #endregion |
117 | 117 | ||
118 | #region Public Methods | 118 | #region Public Methods |
119 | 119 | ||
120 | /// <summary> | 120 | /// <summary> |
121 | /// Parses the specified node. | 121 | /// Parses the specified node. |
122 | /// </summary> | 122 | /// </summary> |
123 | /// <param name="node">The node.</param> | 123 | /// <param name="node">The node.</param> |
124 | public override void Parse(XmlNode node) | 124 | public override void Parse(XmlNode node) |
125 | { | 125 | { |
126 | m_Name = Helper.AttributeValue(node, "name", m_Name); | 126 | m_Name = Helper.AttributeValue(node, "name", m_Name); |
127 | m_Path = Helper.AttributeValue(node, "path", m_Path); | 127 | m_Path = Helper.AttributeValue(node, "path", m_Path); |
128 | m_LocalCopy = Helper.AttributeValue(node, "localCopy", m_LocalCopy); | 128 | m_LocalCopy = Helper.AttributeValue(node, "localCopy", m_LocalCopy); |
129 | m_Version = Helper.AttributeValue(node, "version", m_Version); | 129 | m_Version = Helper.AttributeValue(node, "version", m_Version); |
130 | } | 130 | } |
131 | 131 | ||
132 | #endregion | 132 | #endregion |
133 | 133 | ||
134 | #region IComparable Members | 134 | #region IComparable Members |
135 | 135 | ||
@@ -140,5 +140,5 @@ namespace Prebuild.Core.Nodes | |||
140 | } | 140 | } |
141 | 141 | ||
142 | #endregion | 142 | #endregion |
143 | } | 143 | } |
144 | } | 144 | } |
diff --git a/Prebuild/src/Core/Nodes/ReferencePathNode.cs b/Prebuild/src/Core/Nodes/ReferencePathNode.cs index 7331cd7..29c63c5 100644 --- a/Prebuild/src/Core/Nodes/ReferencePathNode.cs +++ b/Prebuild/src/Core/Nodes/ReferencePathNode.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
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 |
@@ -32,57 +32,57 @@ using Prebuild.Core.Utilities; | |||
32 | 32 | ||
33 | namespace Prebuild.Core.Nodes | 33 | namespace Prebuild.Core.Nodes |
34 | { | 34 | { |
35 | /// <summary> | 35 | /// <summary> |
36 | /// | 36 | /// |
37 | /// </summary> | 37 | /// </summary> |
38 | [DataNode("ReferencePath")] | 38 | [DataNode("ReferencePath")] |
39 | public class ReferencePathNode : DataNode, IComparable | 39 | public class ReferencePathNode : DataNode, IComparable |
40 | { | 40 | { |
41 | #region Fields | 41 | #region Fields |
42 | 42 | ||
43 | private string m_Path; | 43 | private string m_Path; |
44 | 44 | ||
45 | #endregion | 45 | #endregion |
46 | 46 | ||
47 | #region Properties | 47 | #region Properties |
48 | 48 | ||
49 | /// <summary> | 49 | /// <summary> |
50 | /// Gets the path. | 50 | /// Gets the path. |
51 | /// </summary> | 51 | /// </summary> |
52 | /// <value>The path.</value> | 52 | /// <value>The path.</value> |
53 | public string Path | 53 | public string Path |
54 | { | 54 | { |
55 | get | 55 | get |
56 | { | 56 | { |
57 | return m_Path; | 57 | return m_Path; |
58 | } | 58 | } |
59 | } | 59 | } |
60 | 60 | ||
61 | #endregion | 61 | #endregion |
62 | 62 | ||
63 | #region Public Methods | 63 | #region Public Methods |
64 | 64 | ||
65 | /// <summary> | 65 | /// <summary> |
66 | /// Parses the specified node. | 66 | /// Parses the specified node. |
67 | /// </summary> | 67 | /// </summary> |
68 | /// <param name="node">The node.</param> | 68 | /// <param name="node">The node.</param> |
69 | public override void Parse(XmlNode node) | 69 | public override void Parse(XmlNode node) |
70 | { | 70 | { |
71 | if( node == null ) | 71 | if( node == null ) |
72 | { | 72 | { |
73 | throw new ArgumentNullException("node"); | 73 | throw new ArgumentNullException("node"); |
74 | } | 74 | } |
75 | 75 | ||
76 | m_Path = Helper.InterpolateForEnvironmentVariables(node.InnerText); | 76 | m_Path = Helper.InterpolateForEnvironmentVariables(node.InnerText); |
77 | if(m_Path == null) | 77 | if(m_Path == null) |
78 | { | 78 | { |
79 | m_Path = ""; | 79 | m_Path = ""; |
80 | } | 80 | } |
81 | 81 | ||
82 | m_Path = m_Path.Trim(); | 82 | m_Path = m_Path.Trim(); |
83 | } | 83 | } |
84 | 84 | ||
85 | #endregion | 85 | #endregion |
86 | 86 | ||
87 | #region IComparable Members | 87 | #region IComparable Members |
88 | 88 | ||
@@ -93,5 +93,5 @@ namespace Prebuild.Core.Nodes | |||
93 | } | 93 | } |
94 | 94 | ||
95 | #endregion | 95 | #endregion |
96 | } | 96 | } |
97 | } | 97 | } |
diff --git a/Prebuild/src/Core/Nodes/SolutionNode.cs b/Prebuild/src/Core/Nodes/SolutionNode.cs index 10c0223..e1d5b3b 100644 --- a/Prebuild/src/Core/Nodes/SolutionNode.cs +++ b/Prebuild/src/Core/Nodes/SolutionNode.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
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 |
@@ -34,35 +34,35 @@ using Prebuild.Core.Utilities; | |||
34 | 34 | ||
35 | namespace Prebuild.Core.Nodes | 35 | namespace Prebuild.Core.Nodes |
36 | { | 36 | { |
37 | /// <summary> | 37 | /// <summary> |
38 | /// | 38 | /// |
39 | /// </summary> | 39 | /// </summary> |
40 | [DataNode("Solution")] | 40 | [DataNode("Solution")] |
41 | [DataNode("EmbeddedSolution")] | 41 | [DataNode("EmbeddedSolution")] |
42 | [DebuggerDisplay("{Name}")] | 42 | [DebuggerDisplay("{Name}")] |
43 | public class SolutionNode : DataNode | 43 | public class SolutionNode : DataNode |
44 | { | 44 | { |
45 | #region Fields | 45 | #region Fields |
46 | 46 | ||
47 | private Guid m_Guid = Guid.NewGuid(); | 47 | private Guid m_Guid = Guid.NewGuid(); |
48 | private string m_Name = "unknown"; | 48 | private string m_Name = "unknown"; |
49 | private string m_Path = ""; | 49 | private string m_Path = ""; |
50 | private string m_FullPath = ""; | 50 | private string m_FullPath = ""; |
51 | private string m_ActiveConfig; | 51 | private string m_ActiveConfig; |
52 | private string m_Version = "1.0.0"; | 52 | private string m_Version = "1.0.0"; |
53 | 53 | ||
54 | private OptionsNode m_Options; | 54 | private OptionsNode m_Options; |
55 | private FilesNode m_Files; | 55 | private FilesNode m_Files; |
56 | private readonly ConfigurationNodeCollection m_Configurations = new ConfigurationNodeCollection(); | 56 | private readonly ConfigurationNodeCollection m_Configurations = new ConfigurationNodeCollection(); |
57 | private readonly Dictionary<string, ProjectNode> m_Projects = new Dictionary<string, ProjectNode>(); | 57 | private readonly Dictionary<string, ProjectNode> m_Projects = new Dictionary<string, ProjectNode>(); |
58 | private readonly Dictionary<string, DatabaseProjectNode> m_DatabaseProjects = new Dictionary<string, DatabaseProjectNode>(); | 58 | private readonly Dictionary<string, DatabaseProjectNode> m_DatabaseProjects = new Dictionary<string, DatabaseProjectNode>(); |
59 | private readonly List<ProjectNode> m_ProjectsOrder = new List<ProjectNode>(); | 59 | private readonly List<ProjectNode> m_ProjectsOrder = new List<ProjectNode>(); |
60 | private readonly Dictionary<string, SolutionNode> m_Solutions = new Dictionary<string, SolutionNode>(); | 60 | private readonly Dictionary<string, SolutionNode> m_Solutions = new Dictionary<string, SolutionNode>(); |
61 | private CleanupNode m_Cleanup; | 61 | private CleanupNode m_Cleanup; |
62 | 62 | ||
63 | #endregion | 63 | #endregion |
64 | 64 | ||
65 | #region Properties | 65 | #region Properties |
66 | public override IDataNode Parent | 66 | public override IDataNode Parent |
67 | { | 67 | { |
68 | get | 68 | get |
@@ -84,142 +84,142 @@ namespace Prebuild.Core.Nodes | |||
84 | } | 84 | } |
85 | } | 85 | } |
86 | 86 | ||
87 | public CleanupNode Cleanup | 87 | public CleanupNode Cleanup |
88 | { | 88 | { |
89 | get | 89 | get |
90 | { | 90 | { |
91 | return m_Cleanup; | 91 | return m_Cleanup; |
92 | } | 92 | } |
93 | set | 93 | set |
94 | { | 94 | { |
95 | m_Cleanup = value; | 95 | m_Cleanup = value; |
96 | } | 96 | } |
97 | } | 97 | } |
98 | 98 | ||
99 | public Guid Guid | 99 | public Guid Guid |
100 | { | 100 | { |
101 | get | 101 | get |
102 | { | 102 | { |
103 | return m_Guid; | 103 | return m_Guid; |
104 | } | 104 | } |
105 | set | 105 | set |
106 | { | 106 | { |
107 | m_Guid = value; | 107 | m_Guid = value; |
108 | } | ||
109 | } | ||
110 | /// <summary> | ||
111 | /// Gets or sets the active config. | ||
112 | /// </summary> | ||
113 | /// <value>The active config.</value> | ||
114 | public string ActiveConfig | ||
115 | { | ||
116 | get | ||
117 | { | ||
118 | return m_ActiveConfig; | ||
119 | } | ||
120 | set | ||
121 | { | ||
122 | m_ActiveConfig = value; | ||
123 | } | ||
124 | } | ||
125 | |||
126 | /// <summary> | ||
127 | /// Gets the name. | ||
128 | /// </summary> | ||
129 | /// <value>The name.</value> | ||
130 | public string Name | ||
131 | { | ||
132 | get | ||
133 | { | ||
134 | return m_Name; | ||
135 | } | ||
136 | } | ||
137 | |||
138 | /// <summary> | ||
139 | /// Gets the path. | ||
140 | /// </summary> | ||
141 | /// <value>The path.</value> | ||
142 | public string Path | ||
143 | { | ||
144 | get | ||
145 | { | ||
146 | return m_Path; | ||
147 | } | ||
148 | } | ||
149 | |||
150 | /// <summary> | ||
151 | /// Gets the full path. | ||
152 | /// </summary> | ||
153 | /// <value>The full path.</value> | ||
154 | public string FullPath | ||
155 | { | ||
156 | get | ||
157 | { | ||
158 | return m_FullPath; | ||
159 | } | ||
160 | } | ||
161 | |||
162 | /// <summary> | ||
163 | /// Gets the version. | ||
164 | /// </summary> | ||
165 | /// <value>The version.</value> | ||
166 | public string Version | ||
167 | { | ||
168 | get | ||
169 | { | ||
170 | return m_Version; | ||
171 | } | ||
172 | } | ||
173 | |||
174 | /// <summary> | ||
175 | /// Gets the options. | ||
176 | /// </summary> | ||
177 | /// <value>The options.</value> | ||
178 | public OptionsNode Options | ||
179 | { | ||
180 | get | ||
181 | { | ||
182 | return m_Options; | ||
183 | } | ||
184 | } | ||
185 | |||
186 | /// <summary> | ||
187 | /// Gets the files. | ||
188 | /// </summary> | ||
189 | /// <value>The files.</value> | ||
190 | public FilesNode Files | ||
191 | { | ||
192 | get | ||
193 | { | ||
194 | return m_Files; | ||
195 | } | ||
196 | } | ||
197 | |||
198 | /// <summary> | ||
199 | /// Gets the configurations. | ||
200 | /// </summary> | ||
201 | /// <value>The configurations.</value> | ||
202 | public ConfigurationNodeCollection Configurations | ||
203 | { | ||
204 | get | ||
205 | { | ||
206 | ConfigurationNodeCollection tmp = new ConfigurationNodeCollection(); | ||
207 | tmp.AddRange(ConfigurationsTable); | ||
208 | return tmp; | ||
209 | } | ||
210 | } | ||
211 | |||
212 | /// <summary> | ||
213 | /// Gets the configurations table. | ||
214 | /// </summary> | ||
215 | /// <value>The configurations table.</value> | ||
216 | public ConfigurationNodeCollection ConfigurationsTable | ||
217 | { | ||
218 | get | ||
219 | { | ||
220 | return m_Configurations; | ||
108 | } | 221 | } |
109 | } | 222 | } |
110 | /// <summary> | ||
111 | /// Gets or sets the active config. | ||
112 | /// </summary> | ||
113 | /// <value>The active config.</value> | ||
114 | public string ActiveConfig | ||
115 | { | ||
116 | get | ||
117 | { | ||
118 | return m_ActiveConfig; | ||
119 | } | ||
120 | set | ||
121 | { | ||
122 | m_ActiveConfig = value; | ||
123 | } | ||
124 | } | ||
125 | |||
126 | /// <summary> | ||
127 | /// Gets the name. | ||
128 | /// </summary> | ||
129 | /// <value>The name.</value> | ||
130 | public string Name | ||
131 | { | ||
132 | get | ||
133 | { | ||
134 | return m_Name; | ||
135 | } | ||
136 | } | ||
137 | |||
138 | /// <summary> | ||
139 | /// Gets the path. | ||
140 | /// </summary> | ||
141 | /// <value>The path.</value> | ||
142 | public string Path | ||
143 | { | ||
144 | get | ||
145 | { | ||
146 | return m_Path; | ||
147 | } | ||
148 | } | ||
149 | |||
150 | /// <summary> | ||
151 | /// Gets the full path. | ||
152 | /// </summary> | ||
153 | /// <value>The full path.</value> | ||
154 | public string FullPath | ||
155 | { | ||
156 | get | ||
157 | { | ||
158 | return m_FullPath; | ||
159 | } | ||
160 | } | ||
161 | |||
162 | /// <summary> | ||
163 | /// Gets the version. | ||
164 | /// </summary> | ||
165 | /// <value>The version.</value> | ||
166 | public string Version | ||
167 | { | ||
168 | get | ||
169 | { | ||
170 | return m_Version; | ||
171 | } | ||
172 | } | ||
173 | |||
174 | /// <summary> | ||
175 | /// Gets the options. | ||
176 | /// </summary> | ||
177 | /// <value>The options.</value> | ||
178 | public OptionsNode Options | ||
179 | { | ||
180 | get | ||
181 | { | ||
182 | return m_Options; | ||
183 | } | ||
184 | } | ||
185 | |||
186 | /// <summary> | ||
187 | /// Gets the files. | ||
188 | /// </summary> | ||
189 | /// <value>The files.</value> | ||
190 | public FilesNode Files | ||
191 | { | ||
192 | get | ||
193 | { | ||
194 | return m_Files; | ||
195 | } | ||
196 | } | ||
197 | |||
198 | /// <summary> | ||
199 | /// Gets the configurations. | ||
200 | /// </summary> | ||
201 | /// <value>The configurations.</value> | ||
202 | public ConfigurationNodeCollection Configurations | ||
203 | { | ||
204 | get | ||
205 | { | ||
206 | ConfigurationNodeCollection tmp = new ConfigurationNodeCollection(); | ||
207 | tmp.AddRange(ConfigurationsTable); | ||
208 | return tmp; | ||
209 | } | ||
210 | } | ||
211 | |||
212 | /// <summary> | ||
213 | /// Gets the configurations table. | ||
214 | /// </summary> | ||
215 | /// <value>The configurations table.</value> | ||
216 | public ConfigurationNodeCollection ConfigurationsTable | ||
217 | { | ||
218 | get | ||
219 | { | ||
220 | return m_Configurations; | ||
221 | } | ||
222 | } | ||
223 | /// <summary> | 223 | /// <summary> |
224 | /// Gets the database projects. | 224 | /// Gets the database projects. |
225 | /// </summary> | 225 | /// </summary> |
@@ -250,106 +250,106 @@ namespace Prebuild.Core.Nodes | |||
250 | return m_Solutions; | 250 | return m_Solutions; |
251 | } | 251 | } |
252 | } | 252 | } |
253 | /// <summary> | 253 | /// <summary> |
254 | /// Gets the projects. | 254 | /// Gets the projects. |
255 | /// </summary> | 255 | /// </summary> |
256 | /// <value>The projects.</value> | 256 | /// <value>The projects.</value> |
257 | public ICollection<ProjectNode> Projects | 257 | public ICollection<ProjectNode> Projects |
258 | { | 258 | { |
259 | get | 259 | get |
260 | { | 260 | { |
261 | List<ProjectNode> tmp = new List<ProjectNode>(m_Projects.Values); | 261 | List<ProjectNode> tmp = new List<ProjectNode>(m_Projects.Values); |
262 | tmp.Sort(); | 262 | tmp.Sort(); |
263 | return tmp; | 263 | return tmp; |
264 | } | 264 | } |
265 | } | 265 | } |
266 | 266 | ||
267 | /// <summary> | 267 | /// <summary> |
268 | /// Gets the projects table. | 268 | /// Gets the projects table. |
269 | /// </summary> | 269 | /// </summary> |
270 | /// <value>The projects table.</value> | 270 | /// <value>The projects table.</value> |
271 | public Dictionary<string, ProjectNode> ProjectsTable | 271 | public Dictionary<string, ProjectNode> ProjectsTable |
272 | { | 272 | { |
273 | get | 273 | get |
274 | { | 274 | { |
275 | return m_Projects; | 275 | return m_Projects; |
276 | } | 276 | } |
277 | } | 277 | } |
278 | 278 | ||
279 | /// <summary> | 279 | /// <summary> |
280 | /// Gets the projects table. | 280 | /// Gets the projects table. |
281 | /// </summary> | 281 | /// </summary> |
282 | /// <value>The projects table.</value> | 282 | /// <value>The projects table.</value> |
283 | public List<ProjectNode> ProjectsTableOrder | 283 | public List<ProjectNode> ProjectsTableOrder |
284 | { | 284 | { |
285 | get | 285 | get |
286 | { | 286 | { |
287 | return m_ProjectsOrder; | 287 | return m_ProjectsOrder; |
288 | } | 288 | } |
289 | } | 289 | } |
290 | 290 | ||
291 | #endregion | 291 | #endregion |
292 | 292 | ||
293 | #region Public Methods | 293 | #region Public Methods |
294 | 294 | ||
295 | /// <summary> | 295 | /// <summary> |
296 | /// Parses the specified node. | 296 | /// Parses the specified node. |
297 | /// </summary> | 297 | /// </summary> |
298 | /// <param name="node">The node.</param> | 298 | /// <param name="node">The node.</param> |
299 | public override void Parse(XmlNode node) | 299 | public override void Parse(XmlNode node) |
300 | { | 300 | { |
301 | m_Name = Helper.AttributeValue(node, "name", m_Name); | 301 | m_Name = Helper.AttributeValue(node, "name", m_Name); |
302 | m_ActiveConfig = Helper.AttributeValue(node, "activeConfig", m_ActiveConfig); | 302 | m_ActiveConfig = Helper.AttributeValue(node, "activeConfig", m_ActiveConfig); |
303 | m_Path = Helper.AttributeValue(node, "path", m_Path); | 303 | m_Path = Helper.AttributeValue(node, "path", m_Path); |
304 | m_Version = Helper.AttributeValue(node, "version", m_Version); | 304 | m_Version = Helper.AttributeValue(node, "version", m_Version); |
305 | 305 | ||
306 | m_FullPath = m_Path; | 306 | m_FullPath = m_Path; |
307 | try | 307 | try |
308 | { | 308 | { |
309 | m_FullPath = Helper.ResolvePath(m_FullPath); | 309 | m_FullPath = Helper.ResolvePath(m_FullPath); |
310 | } | 310 | } |
311 | catch | 311 | catch |
312 | { | 312 | { |
313 | throw new WarningException("Could not resolve solution path: {0}", m_Path); | 313 | throw new WarningException("Could not resolve solution path: {0}", m_Path); |
314 | } | 314 | } |
315 | 315 | ||
316 | Kernel.Instance.CurrentWorkingDirectory.Push(); | 316 | Kernel.Instance.CurrentWorkingDirectory.Push(); |
317 | try | 317 | try |
318 | { | 318 | { |
319 | Helper.SetCurrentDir(m_FullPath); | 319 | Helper.SetCurrentDir(m_FullPath); |
320 | 320 | ||
321 | if( node == null ) | 321 | if( node == null ) |
322 | { | 322 | { |
323 | throw new ArgumentNullException("node"); | 323 | throw new ArgumentNullException("node"); |
324 | } | 324 | } |
325 | 325 | ||
326 | foreach(XmlNode child in node.ChildNodes) | 326 | foreach(XmlNode child in node.ChildNodes) |
327 | { | 327 | { |
328 | IDataNode dataNode = Kernel.Instance.ParseNode(child, this); | 328 | IDataNode dataNode = Kernel.Instance.ParseNode(child, this); |
329 | if(dataNode is OptionsNode) | 329 | if(dataNode is OptionsNode) |
330 | { | 330 | { |
331 | m_Options = (OptionsNode)dataNode; | 331 | m_Options = (OptionsNode)dataNode; |
332 | } | 332 | } |
333 | else if(dataNode is FilesNode) | 333 | else if(dataNode is FilesNode) |
334 | { | 334 | { |
335 | m_Files = (FilesNode)dataNode; | 335 | m_Files = (FilesNode)dataNode; |
336 | } | 336 | } |
337 | else if(dataNode is ConfigurationNode) | 337 | else if(dataNode is ConfigurationNode) |
338 | { | 338 | { |
339 | ConfigurationNode configurationNode = (ConfigurationNode) dataNode; | 339 | ConfigurationNode configurationNode = (ConfigurationNode) dataNode; |
340 | m_Configurations[configurationNode.NameAndPlatform] = configurationNode; | 340 | m_Configurations[configurationNode.NameAndPlatform] = configurationNode; |
341 | 341 | ||
342 | // If the active configuration is null, then we populate it. | 342 | // If the active configuration is null, then we populate it. |
343 | if (ActiveConfig == null) | 343 | if (ActiveConfig == null) |
344 | { | 344 | { |
345 | ActiveConfig = configurationNode.Name; | 345 | ActiveConfig = configurationNode.Name; |
346 | } | 346 | } |
347 | } | 347 | } |
348 | else if(dataNode is ProjectNode) | 348 | else if(dataNode is ProjectNode) |
349 | { | 349 | { |
350 | m_Projects[((ProjectNode)dataNode).Name] = (ProjectNode) dataNode; | 350 | m_Projects[((ProjectNode)dataNode).Name] = (ProjectNode) dataNode; |
351 | m_ProjectsOrder.Add((ProjectNode)dataNode); | 351 | m_ProjectsOrder.Add((ProjectNode)dataNode); |
352 | } | 352 | } |
353 | else if(dataNode is SolutionNode) | 353 | else if(dataNode is SolutionNode) |
354 | { | 354 | { |
355 | m_Solutions[((SolutionNode)dataNode).Name] = (SolutionNode) dataNode; | 355 | m_Solutions[((SolutionNode)dataNode).Name] = (SolutionNode) dataNode; |
@@ -369,14 +369,14 @@ namespace Prebuild.Core.Nodes | |||
369 | throw new WarningException("There can only be one Cleanup node."); | 369 | throw new WarningException("There can only be one Cleanup node."); |
370 | m_Cleanup = (CleanupNode)dataNode; | 370 | m_Cleanup = (CleanupNode)dataNode; |
371 | } | 371 | } |
372 | } | 372 | } |
373 | } | 373 | } |
374 | finally | 374 | finally |
375 | { | 375 | { |
376 | Kernel.Instance.CurrentWorkingDirectory.Pop(); | 376 | Kernel.Instance.CurrentWorkingDirectory.Pop(); |
377 | } | 377 | } |
378 | } | 378 | } |
379 | 379 | ||
380 | #endregion | 380 | #endregion |
381 | } | 381 | } |
382 | } | 382 | } |