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 | 1196 | ||||
-rw-r--r-- | Prebuild/src/Core/Nodes/ProcessNode.cs | 166 | ||||
-rw-r--r-- | Prebuild/src/Core/Nodes/ProjectNode.cs | 1006 | ||||
-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, 2765 insertions, 2717 deletions
diff --git a/Prebuild/src/Core/Nodes/AuthorNode.cs b/Prebuild/src/Core/Nodes/AuthorNode.cs index e4b024f..4c415bb 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 bd564d5..71405f9 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 f334ea3..b8131b0 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 a101799..cd2f740 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 eba6550..1c38d9e 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 4f20588..318b13c 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 974b74e..845db24 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 713b47c..d1293a0 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 addbdb4..7f04cba 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 c66f123..b313ffa 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, | ||
42 | /// <summary> | 66 | /// <summary> |
43 | /// | 67 | /// |
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, | ||
77 | /// <summary> | 85 | /// <summary> |
78 | /// | 86 | /// |
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 | } | ||
181 | 221 | ||
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> | 222 | /// <summary> |
198 | /// | 223 | /// |
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 58b54fb..16658f3 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 fe02277..000bde9 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 d45bd34..490fd6f 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,291 @@ 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("Prefer32Bit")] |
282 | private string m_OutputPath = "bin/"; | 282 | private bool m_Prefer32Bit; |
283 | 283 | ||
284 | /// <summary> | 284 | /// <summary> |
285 | /// | 285 | /// |
286 | /// </summary> | 286 | /// </summary> |
287 | public string OutputPath | 287 | public bool Prefer32Bit |
288 | { | 288 | { |
289 | get | 289 | get |
290 | { | 290 | { |
291 | return m_OutputPath; | 291 | return m_Prefer32Bit; |
292 | } | 292 | } |
293 | set | 293 | set |
294 | { | 294 | { |
295 | m_OutputPath = value; | 295 | m_Prefer32Bit = value; |
296 | } | 296 | } |
297 | } | 297 | } |
298 | |||
299 | [OptionNode("OutputPath")] | ||
300 | private string m_OutputPath = "bin/"; | ||
301 | |||
302 | /// <summary> | ||
303 | /// | ||
304 | /// </summary> | ||
305 | public string OutputPath | ||
306 | { | ||
307 | get | ||
308 | { | ||
309 | return m_OutputPath; | ||
310 | } | ||
311 | set | ||
312 | { | ||
313 | m_OutputPath = value; | ||
314 | } | ||
315 | } | ||
298 | 316 | ||
299 | [OptionNode("GenerateDocumentation")] | 317 | [OptionNode("GenerateDocumentation")] |
300 | private bool m_GenerateDocumentation; | 318 | private bool m_GenerateDocumentation; |
301 | 319 | ||
302 | /// <summary> | 320 | /// <summary> |
303 | /// | 321 | /// |
304 | /// </summary> | 322 | /// </summary> |
305 | public bool GenerateDocumentation | 323 | public bool GenerateDocumentation |
306 | { | 324 | { |
@@ -314,321 +332,321 @@ namespace Prebuild.Core.Nodes | |||
314 | } | 332 | } |
315 | } | 333 | } |
316 | 334 | ||
317 | [OptionNode("GenerateXmlDocFile")] | 335 | [OptionNode("GenerateXmlDocFile")] |
318 | private bool m_GenerateXmlDocFile; | 336 | private bool m_GenerateXmlDocFile; |
319 | 337 | ||
320 | /// <summary> | 338 | /// <summary> |
321 | /// | 339 | /// |
322 | /// </summary> | 340 | /// </summary> |
323 | public bool GenerateXmlDocFile | 341 | public bool GenerateXmlDocFile |
324 | { | 342 | { |
325 | get | 343 | get |
326 | { | 344 | { |
327 | return m_GenerateXmlDocFile; | 345 | return m_GenerateXmlDocFile; |
328 | } | 346 | } |
329 | set | 347 | set |
330 | { | 348 | { |
331 | m_GenerateXmlDocFile = value; | 349 | m_GenerateXmlDocFile = value; |
332 | } | 350 | } |
333 | } | 351 | } |
334 | 352 | ||
335 | [OptionNode("XmlDocFile")] | 353 | [OptionNode("XmlDocFile")] |
336 | private string m_XmlDocFile = ""; | 354 | private string m_XmlDocFile = ""; |
337 | 355 | ||
338 | /// <summary> | 356 | /// <summary> |
339 | /// | 357 | /// |
340 | /// </summary> | 358 | /// </summary> |
341 | public string XmlDocFile | 359 | public string XmlDocFile |
342 | { | 360 | { |
343 | get | 361 | get |
344 | { | 362 | { |
345 | return m_XmlDocFile; | 363 | return m_XmlDocFile; |
346 | } | 364 | } |
347 | set | 365 | set |
348 | { | 366 | { |
349 | m_XmlDocFile = value; | 367 | m_XmlDocFile = value; |
350 | } | 368 | } |
351 | } | 369 | } |
352 | 370 | ||
353 | [OptionNode("KeyFile")] | 371 | [OptionNode("KeyFile")] |
354 | private string m_KeyFile = ""; | 372 | private string m_KeyFile = ""; |
355 | 373 | ||
356 | /// <summary> | 374 | /// <summary> |
357 | /// | 375 | /// |
358 | /// </summary> | 376 | /// </summary> |
359 | public string KeyFile | 377 | public string KeyFile |
360 | { | 378 | { |
361 | get | 379 | get |
362 | { | 380 | { |
363 | return m_KeyFile; | 381 | return m_KeyFile; |
364 | } | 382 | } |
365 | set | 383 | set |
366 | { | 384 | { |
367 | m_KeyFile = value; | 385 | m_KeyFile = value; |
368 | } | 386 | } |
369 | } | 387 | } |
370 | 388 | ||
371 | [OptionNode("DebugInformation")] | 389 | [OptionNode("DebugInformation")] |
372 | private bool m_DebugInformation; | 390 | private bool m_DebugInformation; |
373 | 391 | ||
374 | /// <summary> | 392 | /// <summary> |
375 | /// | 393 | /// |
376 | /// </summary> | 394 | /// </summary> |
377 | public bool DebugInformation | 395 | public bool DebugInformation |
378 | { | 396 | { |
379 | get | 397 | get |
380 | { | 398 | { |
381 | return m_DebugInformation; | 399 | return m_DebugInformation; |
382 | } | 400 | } |
383 | set | 401 | set |
384 | { | 402 | { |
385 | m_DebugInformation = value; | 403 | m_DebugInformation = value; |
386 | } | 404 | } |
387 | } | 405 | } |
388 | 406 | ||
389 | [OptionNode("RegisterComInterop")] | 407 | [OptionNode("RegisterComInterop")] |
390 | private bool m_RegisterComInterop; | 408 | private bool m_RegisterComInterop; |
391 | 409 | ||
392 | /// <summary> | 410 | /// <summary> |
393 | /// | 411 | /// |
394 | /// </summary> | 412 | /// </summary> |
395 | public bool RegisterComInterop | 413 | public bool RegisterComInterop |
396 | { | 414 | { |
397 | get | 415 | get |
398 | { | 416 | { |
399 | return m_RegisterComInterop; | 417 | return m_RegisterComInterop; |
400 | } | 418 | } |
401 | set | 419 | set |
402 | { | 420 | { |
403 | m_RegisterComInterop = value; | 421 | m_RegisterComInterop = value; |
404 | } | 422 | } |
405 | } | 423 | } |
406 | 424 | ||
407 | [OptionNode("RemoveIntegerChecks")] | 425 | [OptionNode("RemoveIntegerChecks")] |
408 | private bool m_RemoveIntegerChecks; | 426 | private bool m_RemoveIntegerChecks; |
409 | 427 | ||
410 | /// <summary> | 428 | /// <summary> |
411 | /// | 429 | /// |
412 | /// </summary> | 430 | /// </summary> |
413 | public bool RemoveIntegerChecks | 431 | public bool RemoveIntegerChecks |
414 | { | 432 | { |
415 | get | 433 | get |
416 | { | 434 | { |
417 | return m_RemoveIntegerChecks; | 435 | return m_RemoveIntegerChecks; |
418 | } | 436 | } |
419 | set | 437 | set |
420 | { | 438 | { |
421 | m_RemoveIntegerChecks = value; | 439 | m_RemoveIntegerChecks = value; |
422 | } | 440 | } |
423 | } | 441 | } |
424 | 442 | ||
425 | [OptionNode("IncrementalBuild")] | 443 | [OptionNode("IncrementalBuild")] |
426 | private bool m_IncrementalBuild; | 444 | private bool m_IncrementalBuild; |
427 | 445 | ||
428 | /// <summary> | 446 | /// <summary> |
429 | /// | 447 | /// |
430 | /// </summary> | 448 | /// </summary> |
431 | public bool IncrementalBuild | 449 | public bool IncrementalBuild |
432 | { | 450 | { |
433 | get | 451 | get |
434 | { | 452 | { |
435 | return m_IncrementalBuild; | 453 | return m_IncrementalBuild; |
436 | } | 454 | } |
437 | set | 455 | set |
438 | { | 456 | { |
439 | m_IncrementalBuild = value; | 457 | m_IncrementalBuild = value; |
440 | } | 458 | } |
441 | } | 459 | } |
442 | 460 | ||
443 | [OptionNode("BaseAddress")] | 461 | [OptionNode("BaseAddress")] |
444 | private string m_BaseAddress = "285212672"; | 462 | private string m_BaseAddress = "285212672"; |
445 | 463 | ||
446 | /// <summary> | 464 | /// <summary> |
447 | /// | 465 | /// |
448 | /// </summary> | 466 | /// </summary> |
449 | public string BaseAddress | 467 | public string BaseAddress |
450 | { | 468 | { |
451 | get | 469 | get |
452 | { | 470 | { |
453 | return m_BaseAddress; | 471 | return m_BaseAddress; |
454 | } | 472 | } |
455 | set | 473 | set |
456 | { | 474 | { |
457 | m_BaseAddress = value; | 475 | m_BaseAddress = value; |
458 | } | 476 | } |
459 | } | 477 | } |
460 | 478 | ||
461 | [OptionNode("FileAlignment")] | 479 | [OptionNode("FileAlignment")] |
462 | private int m_FileAlignment = 4096; | 480 | private int m_FileAlignment = 4096; |
463 | 481 | ||
464 | /// <summary> | 482 | /// <summary> |
465 | /// | 483 | /// |
466 | /// </summary> | 484 | /// </summary> |
467 | public int FileAlignment | 485 | public int FileAlignment |
468 | { | 486 | { |
469 | get | 487 | get |
470 | { | 488 | { |
471 | return m_FileAlignment; | 489 | return m_FileAlignment; |
472 | } | 490 | } |
473 | set | 491 | set |
474 | { | 492 | { |
475 | m_FileAlignment = value; | 493 | m_FileAlignment = value; |
476 | } | 494 | } |
477 | } | 495 | } |
478 | 496 | ||
479 | [OptionNode("NoStdLib")] | 497 | [OptionNode("NoStdLib")] |
480 | private bool m_NoStdLib; | 498 | private bool m_NoStdLib; |
481 | 499 | ||
482 | /// <summary> | 500 | /// <summary> |
483 | /// | 501 | /// |
484 | /// </summary> | 502 | /// </summary> |
485 | public bool NoStdLib | 503 | public bool NoStdLib |
486 | { | 504 | { |
487 | get | 505 | get |
488 | { | 506 | { |
489 | return m_NoStdLib; | 507 | return m_NoStdLib; |
490 | } | 508 | } |
491 | set | 509 | set |
492 | { | 510 | { |
493 | m_NoStdLib = value; | 511 | m_NoStdLib = value; |
494 | } | 512 | } |
495 | } | 513 | } |
496 | 514 | ||
497 | private readonly List<string> m_FieldsDefined = new List<string>(); | 515 | private readonly List<string> m_FieldsDefined = new List<string>(); |
498 | 516 | ||
499 | #endregion | 517 | #endregion |
500 | 518 | ||
501 | #region Constructors | 519 | #region Constructors |
502 | 520 | ||
503 | /// <summary> | 521 | /// <summary> |
504 | /// Initializes the <see cref="OptionsNode"/> class. | 522 | /// Initializes the <see cref="OptionsNode"/> class. |
505 | /// </summary> | 523 | /// </summary> |
506 | static OptionsNode() | 524 | static OptionsNode() |
507 | { | 525 | { |
508 | Type t = typeof(OptionsNode); | 526 | Type t = typeof(OptionsNode); |
509 | 527 | ||
510 | foreach(FieldInfo f in t.GetFields(BindingFlags.NonPublic | BindingFlags.Instance)) | 528 | foreach(FieldInfo f in t.GetFields(BindingFlags.NonPublic | BindingFlags.Instance)) |
511 | { | 529 | { |
512 | object[] attrs = f.GetCustomAttributes(typeof(OptionNodeAttribute), false); | 530 | object[] attrs = f.GetCustomAttributes(typeof(OptionNodeAttribute), false); |
513 | if(attrs == null || attrs.Length < 1) | 531 | if(attrs == null || attrs.Length < 1) |
514 | { | 532 | { |
515 | continue; | 533 | continue; |
516 | } | 534 | } |
517 | 535 | ||
518 | OptionNodeAttribute ona = (OptionNodeAttribute)attrs[0]; | 536 | OptionNodeAttribute ona = (OptionNodeAttribute)attrs[0]; |
519 | m_OptionFields[ona.NodeName] = f; | 537 | m_OptionFields[ona.NodeName] = f; |
520 | } | 538 | } |
521 | } | 539 | } |
522 | 540 | ||
523 | #endregion | 541 | #endregion |
524 | 542 | ||
525 | #region Properties | 543 | #region Properties |
526 | 544 | ||
527 | /// <summary> | 545 | /// <summary> |
528 | /// Gets the <see cref="Object"/> at the specified index. | 546 | /// Gets the <see cref="Object"/> at the specified index. |
529 | /// </summary> | 547 | /// </summary> |
530 | /// <value></value> | 548 | /// <value></value> |
531 | public object this[string index] | 549 | public object this[string index] |
532 | { | 550 | { |
533 | get | 551 | get |
534 | { | 552 | { |
535 | if(!m_OptionFields.ContainsKey(index)) | 553 | if(!m_OptionFields.ContainsKey(index)) |
536 | { | 554 | { |
537 | return null; | 555 | return null; |
538 | } | 556 | } |
539 | 557 | ||
540 | FieldInfo f = m_OptionFields[index]; | 558 | FieldInfo f = m_OptionFields[index]; |
541 | return f.GetValue(this); | 559 | return f.GetValue(this); |
542 | } | 560 | } |
543 | } | 561 | } |
544 | 562 | ||
545 | /// <summary> | 563 | /// <summary> |
546 | /// Gets the <see cref="Object"/> at the specified index. | 564 | /// Gets the <see cref="Object"/> at the specified index. |
547 | /// </summary> | 565 | /// </summary> |
548 | /// <value></value> | 566 | /// <value></value> |
549 | public object this[string index, object defaultValue] | 567 | public object this[string index, object defaultValue] |
550 | { | 568 | { |
551 | get | 569 | get |
552 | { | 570 | { |
553 | object valueObject = this[index]; | 571 | object valueObject = this[index]; |
554 | if(valueObject != null && valueObject is string && ((string)valueObject).Length == 0) | 572 | if(valueObject != null && valueObject is string && ((string)valueObject).Length == 0) |
555 | { | 573 | { |
556 | return defaultValue; | 574 | return defaultValue; |
557 | } | 575 | } |
558 | return valueObject; | 576 | return valueObject; |
559 | } | 577 | } |
560 | } | 578 | } |
561 | 579 | ||
562 | 580 | ||
563 | #endregion | 581 | #endregion |
564 | 582 | ||
565 | #region Private Methods | 583 | #region Private Methods |
566 | 584 | ||
567 | private void FlagDefined(string name) | 585 | private void FlagDefined(string name) |
568 | { | 586 | { |
569 | if(!m_FieldsDefined.Contains(name)) | 587 | if(!m_FieldsDefined.Contains(name)) |
570 | { | 588 | { |
571 | m_FieldsDefined.Add(name); | 589 | m_FieldsDefined.Add(name); |
572 | } | 590 | } |
573 | } | 591 | } |
574 | 592 | ||
575 | private void SetOption(string nodeName, string val) | 593 | private void SetOption(string nodeName, string val) |
576 | { | 594 | { |
577 | lock(m_OptionFields) | 595 | lock(m_OptionFields) |
578 | { | 596 | { |
579 | if(!m_OptionFields.ContainsKey(nodeName)) | 597 | if(!m_OptionFields.ContainsKey(nodeName)) |
580 | { | 598 | { |
581 | return; | 599 | return; |
582 | } | 600 | } |
583 | 601 | ||
584 | FieldInfo f = m_OptionFields[nodeName]; | 602 | FieldInfo f = m_OptionFields[nodeName]; |
585 | f.SetValue(this, Helper.TranslateValue(f.FieldType, val)); | 603 | f.SetValue(this, Helper.TranslateValue(f.FieldType, val)); |
586 | FlagDefined(f.Name); | 604 | FlagDefined(f.Name); |
587 | } | 605 | } |
588 | } | 606 | } |
589 | 607 | ||
590 | #endregion | 608 | #endregion |
591 | 609 | ||
592 | #region Public Methods | 610 | #region Public Methods |
593 | 611 | ||
594 | /// <summary> | 612 | /// <summary> |
595 | /// Parses the specified node. | 613 | /// Parses the specified node. |
596 | /// </summary> | 614 | /// </summary> |
597 | /// <param name="node">The node.</param> | 615 | /// <param name="node">The node.</param> |
598 | public override void Parse(XmlNode node) | 616 | public override void Parse(XmlNode node) |
599 | { | 617 | { |
600 | if( node == null ) | 618 | if( node == null ) |
601 | { | 619 | { |
602 | throw new ArgumentNullException("node"); | 620 | throw new ArgumentNullException("node"); |
603 | } | 621 | } |
604 | 622 | ||
605 | foreach(XmlNode child in node.ChildNodes) | 623 | foreach(XmlNode child in node.ChildNodes) |
606 | { | 624 | { |
607 | SetOption(child.Name, Helper.InterpolateForEnvironmentVariables(child.InnerText)); | 625 | SetOption(child.Name, Helper.InterpolateForEnvironmentVariables(child.InnerText)); |
608 | } | 626 | } |
609 | } | 627 | } |
610 | 628 | ||
611 | /// <summary> | 629 | /// <summary> |
612 | /// Copies to. | 630 | /// Copies to. |
613 | /// </summary> | 631 | /// </summary> |
614 | /// <param name="opt">The opt.</param> | 632 | /// <param name="opt">The opt.</param> |
615 | public void CopyTo(OptionsNode opt) | 633 | public void CopyTo(OptionsNode opt) |
616 | { | 634 | { |
617 | if(opt == null) | 635 | if(opt == null) |
618 | { | 636 | { |
619 | return; | 637 | return; |
620 | } | 638 | } |
621 | 639 | ||
622 | foreach(FieldInfo f in m_OptionFields.Values) | 640 | foreach(FieldInfo f in m_OptionFields.Values) |
623 | { | 641 | { |
624 | if(m_FieldsDefined.Contains(f.Name)) | 642 | if(m_FieldsDefined.Contains(f.Name)) |
625 | { | 643 | { |
626 | f.SetValue(opt, f.GetValue(this)); | 644 | f.SetValue(opt, f.GetValue(this)); |
627 | opt.m_FieldsDefined.Add(f.Name); | 645 | opt.m_FieldsDefined.Add(f.Name); |
628 | } | 646 | } |
629 | } | 647 | } |
630 | } | 648 | } |
631 | 649 | ||
632 | #endregion | 650 | #endregion |
633 | } | 651 | } |
634 | } | 652 | } |
diff --git a/Prebuild/src/Core/Nodes/ProcessNode.cs b/Prebuild/src/Core/Nodes/ProcessNode.cs index b05ffc6..8ca8e49 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 e02b11b..9622d89 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,190 +34,205 @@ 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> | ||
43 | /// The project is a console executable | ||
44 | /// </summary> | ||
45 | Exe, | ||
46 | /// <summary> | ||
47 | /// The project is a windows executable | ||
48 | /// </summary> | ||
49 | WinExe, | ||
50 | /// <summary> | ||
51 | /// The project is a library | ||
52 | /// </summary> | ||
53 | Library, | ||
54 | /// <summary> | ||
55 | /// The project is a website | ||
56 | /// </summary> | ||
57 | Web, | ||
58 | } | ||
59 | |||
60 | /// <summary> | ||
61 | /// | ||
62 | /// </summary> | ||
63 | public enum ClrRuntime | ||
64 | { | ||
65 | /// <summary> | ||
66 | /// | ||
67 | /// </summary> | ||
68 | Microsoft, | ||
69 | /// <summary> | ||
70 | /// | ||
71 | /// </summary> | ||
72 | Mono | ||
73 | } | ||
74 | /// <summary> | ||
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> | ||
77 | /// </summary> | ||
78 | public enum FrameworkVersion | ||
79 | { | ||
80 | /// <summary> | ||
81 | /// .NET 2.0 | ||
82 | /// </summary> | ||
83 | v2_0, | ||
84 | /// <summary> | ||
85 | /// .NET 3.0 | ||
86 | /// </summary> | ||
87 | v3_0, | ||
88 | /// <summary> | ||
89 | /// .NET 3.5 | ||
90 | /// </summary> | ||
91 | v3_5, | ||
92 | /// <summary> | ||
93 | /// .NET 4.0 | ||
94 | /// </summary> | ||
95 | v4_0, | ||
42 | /// <summary> | 96 | /// <summary> |
43 | /// The project is a console executable | 97 | /// .NET 4.5 |
44 | /// </summary> | ||
45 | Exe, | ||
46 | /// <summary> | ||
47 | /// The project is a windows executable | ||
48 | /// </summary> | ||
49 | WinExe, | ||
50 | /// <summary> | ||
51 | /// The project is a library | ||
52 | /// </summary> | ||
53 | Library, | ||
54 | /// <summary> | ||
55 | /// The project is a website | ||
56 | /// </summary> | ||
57 | Web, | ||
58 | } | ||
59 | |||
60 | /// <summary> | ||
61 | /// | ||
62 | /// </summary> | ||
63 | public enum ClrRuntime | ||
64 | { | ||
65 | /// <summary> | ||
66 | /// | ||
67 | /// </summary> | ||
68 | Microsoft, | ||
69 | /// <summary> | ||
70 | /// | ||
71 | /// </summary> | ||
72 | Mono | ||
73 | } | ||
74 | /// <summary> | ||
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> | ||
77 | /// </summary> | ||
78 | public enum FrameworkVersion | ||
79 | { | ||
80 | /// <summary> | ||
81 | /// .NET 2.0 | ||
82 | /// </summary> | ||
83 | v2_0, | ||
84 | /// <summary> | ||
85 | /// .NET 3.0 | ||
86 | /// </summary> | 98 | /// </summary> |
87 | v3_0, | 99 | v4_5, |
88 | /// <summary> | 100 | /// <summary> |
89 | /// .NET 3.5 | 101 | /// .NET 4.5.1 |
90 | /// </summary> | 102 | /// </summary> |
91 | v3_5, | 103 | v4_5_1, |
92 | /// <summary> | 104 | /// <summary> |
93 | /// .NET 4.0 | 105 | /// .NET 4.6 |
94 | /// </summary> | 106 | /// </summary> |
95 | v4_0, | 107 | v4_6, |
96 | /// <summary> | 108 | /// <summary> |
97 | /// .NET 4.5 | 109 | /// .NET 4.6.1 |
98 | /// </summary> | 110 | /// </summary> |
99 | v4_5, | 111 | v4_6_1 |
100 | /// <summary> | ||
101 | /// .NET 4.5.1 | ||
102 | /// </summary> | ||
103 | v4_5_1 | ||
104 | } | 112 | } |
105 | /// <summary> | 113 | /// <summary> |
106 | /// The Node object representing /Prebuild/Solution/Project elements | 114 | /// The Node object representing /Prebuild/Solution/Project elements |
107 | /// </summary> | 115 | /// </summary> |
108 | [DataNode("Project")] | 116 | [DataNode("Project")] |
109 | public class ProjectNode : DataNode, IComparable | 117 | public class ProjectNode : DataNode, IComparable |
110 | { | 118 | { |
111 | #region Fields | 119 | #region Fields |
112 | 120 | ||
113 | private string m_Name = "unknown"; | 121 | private string m_Name = "unknown"; |
114 | private string m_Path = ""; | 122 | private string m_Path = ""; |
115 | private string m_FullPath = ""; | 123 | private string m_FullPath = ""; |
116 | private string m_AssemblyName; | 124 | private string m_AssemblyName; |
117 | private string m_AppIcon = ""; | 125 | private string m_AppIcon = ""; |
126 | private string m_ApplicationManifest = ""; | ||
118 | private string m_ConfigFile = ""; | 127 | private string m_ConfigFile = ""; |
119 | private string m_DesignerFolder = ""; | 128 | private string m_DesignerFolder = ""; |
120 | private string m_Language = "C#"; | 129 | private string m_Language = "C#"; |
121 | private ProjectType m_Type = ProjectType.Exe; | 130 | private ProjectType m_Type = ProjectType.Exe; |
122 | private ClrRuntime m_Runtime = ClrRuntime.Microsoft; | 131 | private ClrRuntime m_Runtime = ClrRuntime.Microsoft; |
123 | private FrameworkVersion m_Framework = FrameworkVersion.v2_0; | 132 | private FrameworkVersion m_Framework = FrameworkVersion.v2_0; |
124 | private string m_StartupObject = ""; | 133 | private bool m_useFramework = true; |
125 | private string m_RootNamespace; | 134 | private string m_StartupObject = ""; |
126 | private string m_FilterGroups = ""; | 135 | private string m_RootNamespace; |
127 | private string m_Version = ""; | 136 | private string m_FilterGroups = ""; |
128 | private Guid m_Guid; | 137 | private string m_Version = ""; |
138 | private Guid m_Guid; | ||
129 | private string m_DebugStartParameters; | 139 | private string m_DebugStartParameters; |
130 | 140 | ||
131 | private readonly Dictionary<string, ConfigurationNode> m_Configurations = new Dictionary<string, ConfigurationNode>(); | 141 | private readonly Dictionary<string, ConfigurationNode> m_Configurations = new Dictionary<string, ConfigurationNode>(); |
132 | private readonly List<ReferencePathNode> m_ReferencePaths = new List<ReferencePathNode>(); | 142 | private readonly List<ReferencePathNode> m_ReferencePaths = new List<ReferencePathNode>(); |
133 | private readonly List<ReferenceNode> m_References = new List<ReferenceNode>(); | 143 | private readonly List<ReferenceNode> m_References = new List<ReferenceNode>(); |
134 | private readonly List<AuthorNode> m_Authors = new List<AuthorNode>(); | 144 | private readonly List<AuthorNode> m_Authors = new List<AuthorNode>(); |
135 | private FilesNode m_Files; | 145 | private FilesNode m_Files; |
136 | 146 | ||
137 | #endregion | 147 | #endregion |
138 | 148 | ||
139 | #region Properties | 149 | #region Properties |
140 | 150 | ||
141 | /// <summary> | 151 | /// <summary> |
142 | /// Gets the name. | 152 | /// Gets the name. |
143 | /// </summary> | 153 | /// </summary> |
144 | /// <value>The name.</value> | 154 | /// <value>The name.</value> |
145 | public string Name | 155 | public string Name |
146 | { | 156 | { |
147 | get | 157 | get |
148 | { | 158 | { |
149 | return m_Name; | 159 | return m_Name; |
150 | } | 160 | } |
151 | } | 161 | } |
152 | /// <summary> | 162 | /// <summary> |
153 | /// The version of the .NET Framework to compile under | 163 | /// The version of the .NET Framework to compile under |
154 | /// </summary> | 164 | /// </summary> |
155 | public FrameworkVersion FrameworkVersion | 165 | public FrameworkVersion FrameworkVersion |
156 | { | 166 | { |
157 | get | 167 | get |
158 | { | 168 | { |
159 | return m_Framework; | 169 | return m_Framework; |
160 | } | 170 | } |
161 | } | 171 | set |
162 | /// <summary> | ||
163 | /// Gets the path. | ||
164 | /// </summary> | ||
165 | /// <value>The path.</value> | ||
166 | public string Path | ||
167 | { | ||
168 | get | ||
169 | { | ||
170 | return m_Path; | ||
171 | } | ||
172 | } | ||
173 | |||
174 | /// <summary> | ||
175 | /// Gets the filter groups. | ||
176 | /// </summary> | ||
177 | /// <value>The filter groups.</value> | ||
178 | public string FilterGroups | ||
179 | { | ||
180 | get | ||
181 | { | ||
182 | return m_FilterGroups; | ||
183 | } | ||
184 | } | ||
185 | |||
186 | /// <summary> | ||
187 | /// Gets the project's version | ||
188 | /// </summary> | ||
189 | /// <value>The project's version.</value> | ||
190 | public string Version | ||
191 | { | ||
192 | get | ||
193 | { | ||
194 | return m_Version; | ||
195 | } | ||
196 | } | ||
197 | |||
198 | /// <summary> | ||
199 | /// Gets the full path. | ||
200 | /// </summary> | ||
201 | /// <value>The full path.</value> | ||
202 | public string FullPath | ||
203 | { | ||
204 | get | ||
205 | { | ||
206 | return m_FullPath; | ||
207 | } | ||
208 | } | ||
209 | |||
210 | /// <summary> | ||
211 | /// Gets the name of the assembly. | ||
212 | /// </summary> | ||
213 | /// <value>The name of the assembly.</value> | ||
214 | public string AssemblyName | ||
215 | { | ||
216 | get | ||
217 | { | 172 | { |
218 | return m_AssemblyName; | 173 | m_Framework = value; |
219 | } | 174 | m_useFramework = false; |
220 | } | 175 | } |
176 | } | ||
177 | /// <summary> | ||
178 | /// Gets the path. | ||
179 | /// </summary> | ||
180 | /// <value>The path.</value> | ||
181 | public string Path | ||
182 | { | ||
183 | get | ||
184 | { | ||
185 | return m_Path; | ||
186 | } | ||
187 | } | ||
188 | |||
189 | /// <summary> | ||
190 | /// Gets the filter groups. | ||
191 | /// </summary> | ||
192 | /// <value>The filter groups.</value> | ||
193 | public string FilterGroups | ||
194 | { | ||
195 | get | ||
196 | { | ||
197 | return m_FilterGroups; | ||
198 | } | ||
199 | } | ||
200 | |||
201 | /// <summary> | ||
202 | /// Gets the project's version | ||
203 | /// </summary> | ||
204 | /// <value>The project's version.</value> | ||
205 | public string Version | ||
206 | { | ||
207 | get | ||
208 | { | ||
209 | return m_Version; | ||
210 | } | ||
211 | } | ||
212 | |||
213 | /// <summary> | ||
214 | /// Gets the full path. | ||
215 | /// </summary> | ||
216 | /// <value>The full path.</value> | ||
217 | public string FullPath | ||
218 | { | ||
219 | get | ||
220 | { | ||
221 | return m_FullPath; | ||
222 | } | ||
223 | } | ||
224 | |||
225 | /// <summary> | ||
226 | /// Gets the name of the assembly. | ||
227 | /// </summary> | ||
228 | /// <value>The name of the assembly.</value> | ||
229 | public string AssemblyName | ||
230 | { | ||
231 | get | ||
232 | { | ||
233 | return m_AssemblyName; | ||
234 | } | ||
235 | } | ||
221 | 236 | ||
222 | /// <summary> | 237 | /// <summary> |
223 | /// Gets the app icon. | 238 | /// Gets the app icon. |
@@ -232,347 +247,362 @@ namespace Prebuild.Core.Nodes | |||
232 | } | 247 | } |
233 | 248 | ||
234 | /// <summary> | 249 | /// <summary> |
235 | /// Gets the app icon. | 250 | /// Gets the Application Manifest. |
236 | /// </summary> | ||
237 | /// <value>The app icon.</value> | ||
238 | public string ConfigFile | ||
239 | { | ||
240 | get | ||
241 | { | ||
242 | return m_ConfigFile; | ||
243 | } | ||
244 | } | ||
245 | |||
246 | /// <summary> | ||
247 | /// | ||
248 | /// </summary> | ||
249 | public string DesignerFolder | ||
250 | { | ||
251 | get | ||
252 | { | ||
253 | return m_DesignerFolder; | ||
254 | } | ||
255 | } | ||
256 | |||
257 | /// <summary> | ||
258 | /// Gets the language. | ||
259 | /// </summary> | ||
260 | /// <value>The language.</value> | ||
261 | public string Language | ||
262 | { | ||
263 | get | ||
264 | { | ||
265 | return m_Language; | ||
266 | } | ||
267 | } | ||
268 | |||
269 | /// <summary> | ||
270 | /// Gets the type. | ||
271 | /// </summary> | ||
272 | /// <value>The type.</value> | ||
273 | public ProjectType Type | ||
274 | { | ||
275 | get | ||
276 | { | ||
277 | return m_Type; | ||
278 | } | ||
279 | } | ||
280 | |||
281 | /// <summary> | ||
282 | /// Gets the runtime. | ||
283 | /// </summary> | ||
284 | /// <value>The runtime.</value> | ||
285 | public ClrRuntime Runtime | ||
286 | { | ||
287 | get | ||
288 | { | ||
289 | return m_Runtime; | ||
290 | } | ||
291 | } | ||
292 | |||
293 | private bool m_GenerateAssemblyInfoFile; | ||
294 | |||
295 | /// <summary> | ||
296 | /// | ||
297 | /// </summary> | ||
298 | public bool GenerateAssemblyInfoFile | ||
299 | { | ||
300 | get | ||
301 | { | ||
302 | return m_GenerateAssemblyInfoFile; | ||
303 | } | ||
304 | set | ||
305 | { | ||
306 | m_GenerateAssemblyInfoFile = value; | ||
307 | } | ||
308 | } | ||
309 | |||
310 | /// <summary> | ||
311 | /// Gets the startup object. | ||
312 | /// </summary> | 251 | /// </summary> |
313 | /// <value>The startup object.</value> | 252 | /// <value>The Application Manifest.</value> |
314 | public string StartupObject | 253 | public string ApplicationManifest |
315 | { | 254 | { |
316 | get | 255 | get |
317 | { | 256 | { |
318 | return m_StartupObject; | 257 | return m_ApplicationManifest; |
319 | } | 258 | } |
320 | } | 259 | } |
321 | 260 | ||
322 | /// <summary> | 261 | /// <summary> |
323 | /// Gets the root namespace. | 262 | /// Gets the app icon. |
324 | /// </summary> | 263 | /// </summary> |
325 | /// <value>The root namespace.</value> | 264 | /// <value>The app icon.</value> |
326 | public string RootNamespace | 265 | public string ConfigFile |
327 | { | 266 | { |
328 | get | 267 | get |
329 | { | 268 | { |
330 | return m_RootNamespace; | 269 | return m_ConfigFile; |
331 | } | 270 | } |
332 | } | 271 | } |
333 | 272 | ||
334 | /// <summary> | 273 | /// <summary> |
335 | /// Gets the configurations. | 274 | /// |
336 | /// </summary> | 275 | /// </summary> |
337 | /// <value>The configurations.</value> | 276 | public string DesignerFolder |
277 | { | ||
278 | get | ||
279 | { | ||
280 | return m_DesignerFolder; | ||
281 | } | ||
282 | } | ||
283 | |||
284 | /// <summary> | ||
285 | /// Gets the language. | ||
286 | /// </summary> | ||
287 | /// <value>The language.</value> | ||
288 | public string Language | ||
289 | { | ||
290 | get | ||
291 | { | ||
292 | return m_Language; | ||
293 | } | ||
294 | } | ||
295 | |||
296 | /// <summary> | ||
297 | /// Gets the type. | ||
298 | /// </summary> | ||
299 | /// <value>The type.</value> | ||
300 | public ProjectType Type | ||
301 | { | ||
302 | get | ||
303 | { | ||
304 | return m_Type; | ||
305 | } | ||
306 | } | ||
307 | |||
308 | /// <summary> | ||
309 | /// Gets the runtime. | ||
310 | /// </summary> | ||
311 | /// <value>The runtime.</value> | ||
312 | public ClrRuntime Runtime | ||
313 | { | ||
314 | get | ||
315 | { | ||
316 | return m_Runtime; | ||
317 | } | ||
318 | } | ||
319 | |||
320 | private bool m_GenerateAssemblyInfoFile; | ||
321 | |||
322 | /// <summary> | ||
323 | /// | ||
324 | /// </summary> | ||
325 | public bool GenerateAssemblyInfoFile | ||
326 | { | ||
327 | get | ||
328 | { | ||
329 | return m_GenerateAssemblyInfoFile; | ||
330 | } | ||
331 | set | ||
332 | { | ||
333 | m_GenerateAssemblyInfoFile = value; | ||
334 | } | ||
335 | } | ||
336 | |||
337 | /// <summary> | ||
338 | /// Gets the startup object. | ||
339 | /// </summary> | ||
340 | /// <value>The startup object.</value> | ||
341 | public string StartupObject | ||
342 | { | ||
343 | get | ||
344 | { | ||
345 | return m_StartupObject; | ||
346 | } | ||
347 | } | ||
348 | |||
349 | /// <summary> | ||
350 | /// Gets the root namespace. | ||
351 | /// </summary> | ||
352 | /// <value>The root namespace.</value> | ||
353 | public string RootNamespace | ||
354 | { | ||
355 | get | ||
356 | { | ||
357 | return m_RootNamespace; | ||
358 | } | ||
359 | } | ||
360 | |||
361 | /// <summary> | ||
362 | /// Gets the configurations. | ||
363 | /// </summary> | ||
364 | /// <value>The configurations.</value> | ||
338 | public List<ConfigurationNode> Configurations | 365 | public List<ConfigurationNode> Configurations |
339 | { | 366 | { |
340 | get | 367 | get |
341 | { | 368 | { |
342 | List<ConfigurationNode> tmp = new List<ConfigurationNode>(ConfigurationsTable.Values); | 369 | List<ConfigurationNode> tmp = new List<ConfigurationNode>(ConfigurationsTable.Values); |
343 | tmp.Sort(); | 370 | tmp.Sort(); |
344 | return tmp; | 371 | return tmp; |
345 | } | 372 | } |
346 | } | 373 | } |
347 | 374 | ||
348 | /// <summary> | 375 | /// <summary> |
349 | /// Gets the configurations table. | 376 | /// Gets the configurations table. |
350 | /// </summary> | 377 | /// </summary> |
351 | /// <value>The configurations table.</value> | 378 | /// <value>The configurations table.</value> |
352 | public Dictionary<string, ConfigurationNode> ConfigurationsTable | 379 | public Dictionary<string, ConfigurationNode> ConfigurationsTable |
353 | { | 380 | { |
354 | get | 381 | get |
355 | { | 382 | { |
356 | return m_Configurations; | 383 | return m_Configurations; |
357 | } | 384 | } |
358 | } | 385 | } |
359 | 386 | ||
360 | /// <summary> | 387 | /// <summary> |
361 | /// Gets the reference paths. | 388 | /// Gets the reference paths. |
362 | /// </summary> | 389 | /// </summary> |
363 | /// <value>The reference paths.</value> | 390 | /// <value>The reference paths.</value> |
364 | public List<ReferencePathNode> ReferencePaths | 391 | public List<ReferencePathNode> ReferencePaths |
365 | { | 392 | { |
366 | get | 393 | get |
367 | { | 394 | { |
368 | List<ReferencePathNode> tmp = new List<ReferencePathNode>(m_ReferencePaths); | 395 | List<ReferencePathNode> tmp = new List<ReferencePathNode>(m_ReferencePaths); |
369 | tmp.Sort(); | 396 | tmp.Sort(); |
370 | return tmp; | 397 | return tmp; |
371 | } | 398 | } |
372 | } | 399 | } |
373 | 400 | ||
374 | /// <summary> | 401 | /// <summary> |
375 | /// Gets the references. | 402 | /// Gets the references. |
376 | /// </summary> | 403 | /// </summary> |
377 | /// <value>The references.</value> | 404 | /// <value>The references.</value> |
378 | public List<ReferenceNode> References | 405 | public List<ReferenceNode> References |
379 | { | 406 | { |
380 | get | 407 | get |
381 | { | 408 | { |
382 | List<ReferenceNode> tmp = new List<ReferenceNode>(m_References); | 409 | List<ReferenceNode> tmp = new List<ReferenceNode>(m_References); |
383 | tmp.Sort(); | 410 | tmp.Sort(); |
384 | return tmp; | 411 | return tmp; |
385 | } | 412 | } |
386 | } | 413 | } |
387 | 414 | ||
388 | /// <summary> | 415 | /// <summary> |
389 | /// Gets the Authors list. | 416 | /// Gets the Authors list. |
390 | /// </summary> | 417 | /// </summary> |
391 | /// <value>The list of the project's authors.</value> | 418 | /// <value>The list of the project's authors.</value> |
392 | public List<AuthorNode> Authors | 419 | public List<AuthorNode> Authors |
393 | { | 420 | { |
394 | get | 421 | get |
395 | { | 422 | { |
396 | return m_Authors; | 423 | return m_Authors; |
397 | } | 424 | } |
398 | } | 425 | } |
399 | 426 | ||
400 | /// <summary> | 427 | /// <summary> |
401 | /// Gets the files. | 428 | /// Gets the files. |
402 | /// </summary> | 429 | /// </summary> |
403 | /// <value>The files.</value> | 430 | /// <value>The files.</value> |
404 | public FilesNode Files | 431 | public FilesNode Files |
405 | { | 432 | { |
406 | get | 433 | get |
407 | { | 434 | { |
408 | return m_Files; | 435 | return m_Files; |
409 | } | 436 | } |
410 | } | 437 | } |
411 | 438 | ||
412 | /// <summary> | 439 | /// <summary> |
413 | /// Gets or sets the parent. | 440 | /// Gets or sets the parent. |
414 | /// </summary> | 441 | /// </summary> |
415 | /// <value>The parent.</value> | 442 | /// <value>The parent.</value> |
416 | public override IDataNode Parent | 443 | public override IDataNode Parent |
417 | { | 444 | { |
418 | get | 445 | get |
419 | { | 446 | { |
420 | return base.Parent; | 447 | return base.Parent; |
421 | } | 448 | } |
422 | set | 449 | set |
423 | { | 450 | { |
424 | base.Parent = value; | 451 | base.Parent = value; |
425 | if(base.Parent is SolutionNode && m_Configurations.Count < 1) | 452 | if(base.Parent is SolutionNode && m_Configurations.Count < 1) |
426 | { | 453 | { |
427 | SolutionNode parent = (SolutionNode)base.Parent; | 454 | SolutionNode parent = (SolutionNode)base.Parent; |
428 | foreach(ConfigurationNode conf in parent.Configurations) | 455 | foreach(ConfigurationNode conf in parent.Configurations) |
429 | { | 456 | { |
430 | m_Configurations[conf.NameAndPlatform] = (ConfigurationNode) conf.Clone(); | 457 | m_Configurations[conf.NameAndPlatform] = (ConfigurationNode) conf.Clone(); |
431 | } | 458 | } |
432 | } | 459 | } |
433 | } | 460 | } |
434 | } | 461 | } |
435 | 462 | ||
436 | /// <summary> | 463 | /// <summary> |
437 | /// Gets the GUID. | 464 | /// Gets the GUID. |
438 | /// </summary> | 465 | /// </summary> |
439 | /// <value>The GUID.</value> | 466 | /// <value>The GUID.</value> |
440 | public Guid Guid | 467 | public Guid Guid |
441 | { | 468 | { |
442 | get | 469 | get |
443 | { | 470 | { |
444 | return m_Guid; | 471 | return m_Guid; |
445 | } | 472 | } |
446 | } | 473 | } |
447 | 474 | ||
448 | public string DebugStartParameters | 475 | public string DebugStartParameters |
449 | { | 476 | { |
450 | get | 477 | get |
451 | { | 478 | { |
452 | return m_DebugStartParameters; | 479 | return m_DebugStartParameters; |
453 | } | 480 | } |
454 | } | 481 | } |
455 | 482 | ||
456 | #endregion | 483 | #endregion |
457 | 484 | ||
458 | #region Private Methods | 485 | #region Private Methods |
459 | 486 | ||
460 | private void HandleConfiguration(ConfigurationNode conf) | 487 | private void HandleConfiguration(ConfigurationNode conf) |
461 | { | 488 | { |
462 | if(String.Compare(conf.Name, "all", true) == 0) //apply changes to all, this may not always be applied first, | 489 | 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 | 490 | //so it *may* override changes to the same properties for configurations defines at the project level |
464 | { | 491 | { |
465 | foreach(ConfigurationNode confNode in m_Configurations.Values) | 492 | foreach(ConfigurationNode confNode in m_Configurations.Values) |
466 | { | 493 | { |
467 | conf.CopyTo(confNode);//update the config templates defines at the project level with the overrides | 494 | conf.CopyTo(confNode);//update the config templates defines at the project level with the overrides |
468 | } | 495 | } |
469 | } | 496 | } |
470 | if(m_Configurations.ContainsKey(conf.NameAndPlatform)) | 497 | if(m_Configurations.ContainsKey(conf.NameAndPlatform)) |
471 | { | 498 | { |
472 | ConfigurationNode parentConf = m_Configurations[conf.NameAndPlatform]; | 499 | ConfigurationNode parentConf = m_Configurations[conf.NameAndPlatform]; |
473 | conf.CopyTo(parentConf);//update the config templates defines at the project level with the overrides | 500 | conf.CopyTo(parentConf);//update the config templates defines at the project level with the overrides |
474 | } | 501 | } |
475 | else | 502 | else |
476 | { | 503 | { |
477 | m_Configurations[conf.NameAndPlatform] = conf; | 504 | m_Configurations[conf.NameAndPlatform] = conf; |
478 | } | 505 | } |
479 | } | 506 | } |
480 | 507 | ||
481 | #endregion | 508 | #endregion |
482 | 509 | ||
483 | #region Public Methods | 510 | #region Public Methods |
484 | 511 | ||
485 | /// <summary> | 512 | /// <summary> |
486 | /// Parses the specified node. | 513 | /// Parses the specified node. |
487 | /// </summary> | 514 | /// </summary> |
488 | /// <param name="node">The node.</param> | 515 | /// <param name="node">The node.</param> |
489 | public override void Parse(XmlNode node) | 516 | public override void Parse(XmlNode node) |
490 | { | 517 | { |
491 | m_Name = Helper.AttributeValue(node, "name", m_Name); | 518 | m_Name = Helper.AttributeValue(node, "name", m_Name); |
492 | m_Path = Helper.AttributeValue(node, "path", m_Path); | 519 | m_Path = Helper.AttributeValue(node, "path", m_Path); |
493 | m_FilterGroups = Helper.AttributeValue(node, "filterGroups", m_FilterGroups); | 520 | m_FilterGroups = Helper.AttributeValue(node, "filterGroups", m_FilterGroups); |
494 | m_Version = Helper.AttributeValue(node, "version", m_Version); | 521 | m_Version = Helper.AttributeValue(node, "version", m_Version); |
495 | m_AppIcon = Helper.AttributeValue(node, "icon", m_AppIcon); | 522 | m_AppIcon = Helper.AttributeValue(node, "icon", m_AppIcon); |
523 | m_ApplicationManifest = Helper.AttributeValue(node, "appmanifest", m_ApplicationManifest); | ||
496 | m_ConfigFile = Helper.AttributeValue(node, "configFile", m_ConfigFile); | 524 | m_ConfigFile = Helper.AttributeValue(node, "configFile", m_ConfigFile); |
497 | m_DesignerFolder = Helper.AttributeValue(node, "designerFolder", m_DesignerFolder); | 525 | m_DesignerFolder = Helper.AttributeValue(node, "designerFolder", m_DesignerFolder); |
498 | m_AssemblyName = Helper.AttributeValue(node, "assemblyName", m_AssemblyName); | 526 | m_AssemblyName = Helper.AttributeValue(node, "assemblyName", m_AssemblyName); |
499 | m_Language = Helper.AttributeValue(node, "language", m_Language); | 527 | m_Language = Helper.AttributeValue(node, "language", m_Language); |
500 | m_Type = (ProjectType)Helper.EnumAttributeValue(node, "type", typeof(ProjectType), m_Type); | 528 | m_Type = (ProjectType)Helper.EnumAttributeValue(node, "type", typeof(ProjectType), m_Type); |
501 | m_Runtime = (ClrRuntime)Helper.EnumAttributeValue(node, "runtime", typeof(ClrRuntime), m_Runtime); | 529 | m_Runtime = (ClrRuntime)Helper.EnumAttributeValue(node, "runtime", typeof(ClrRuntime), m_Runtime); |
502 | m_Framework = (FrameworkVersion)Helper.EnumAttributeValue(node, "frameworkVersion", typeof(FrameworkVersion), m_Framework); | 530 | if(m_useFramework) |
531 | m_Framework = (FrameworkVersion)Helper.EnumAttributeValue(node, "frameworkVersion", typeof(FrameworkVersion), m_Framework); | ||
532 | |||
503 | m_StartupObject = Helper.AttributeValue(node, "startupObject", m_StartupObject); | 533 | m_StartupObject = Helper.AttributeValue(node, "startupObject", m_StartupObject); |
504 | m_RootNamespace = Helper.AttributeValue(node, "rootNamespace", m_RootNamespace); | 534 | m_RootNamespace = Helper.AttributeValue(node, "rootNamespace", m_RootNamespace); |
505 | 535 | ||
506 | int hash = m_Name.GetHashCode(); | 536 | int hash = m_Name.GetHashCode(); |
507 | Guid guidByHash = new Guid(hash, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); | 537 | Guid guidByHash = new Guid(hash, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); |
508 | string guid = Helper.AttributeValue(node, "guid", guidByHash.ToString()); | 538 | string guid = Helper.AttributeValue(node, "guid", guidByHash.ToString()); |
509 | m_Guid = new Guid(guid); | 539 | m_Guid = new Guid(guid); |
510 | 540 | ||
511 | m_GenerateAssemblyInfoFile = Helper.ParseBoolean(node, "generateAssemblyInfoFile", false); | 541 | m_GenerateAssemblyInfoFile = Helper.ParseBoolean(node, "generateAssemblyInfoFile", false); |
512 | m_DebugStartParameters = Helper.AttributeValue(node, "debugStartParameters", string.Empty); | 542 | m_DebugStartParameters = Helper.AttributeValue(node, "debugStartParameters", string.Empty); |
513 | 543 | ||
514 | if(string.IsNullOrEmpty(m_AssemblyName)) | 544 | if(string.IsNullOrEmpty(m_AssemblyName)) |
515 | { | 545 | { |
516 | m_AssemblyName = m_Name; | 546 | m_AssemblyName = m_Name; |
517 | } | 547 | } |
518 | 548 | ||
519 | if(string.IsNullOrEmpty(m_RootNamespace)) | 549 | if(string.IsNullOrEmpty(m_RootNamespace)) |
520 | { | 550 | { |
521 | m_RootNamespace = m_Name; | 551 | m_RootNamespace = m_Name; |
522 | } | 552 | } |
523 | 553 | ||
524 | m_FullPath = m_Path; | 554 | m_FullPath = m_Path; |
525 | try | 555 | try |
526 | { | 556 | { |
527 | m_FullPath = Helper.ResolvePath(m_FullPath); | 557 | m_FullPath = Helper.ResolvePath(m_FullPath); |
528 | } | 558 | } |
529 | catch | 559 | catch |
530 | { | 560 | { |
531 | throw new WarningException("Could not resolve Solution path: {0}", m_Path); | 561 | throw new WarningException("Could not resolve Solution path: {0}", m_Path); |
532 | } | 562 | } |
533 | 563 | ||
534 | Kernel.Instance.CurrentWorkingDirectory.Push(); | 564 | Kernel.Instance.CurrentWorkingDirectory.Push(); |
535 | try | 565 | try |
536 | { | 566 | { |
537 | Helper.SetCurrentDir(m_FullPath); | 567 | Helper.SetCurrentDir(m_FullPath); |
538 | 568 | ||
539 | if( node == null ) | 569 | if( node == null ) |
540 | { | 570 | { |
541 | throw new ArgumentNullException("node"); | 571 | throw new ArgumentNullException("node"); |
542 | } | 572 | } |
543 | 573 | ||
544 | foreach(XmlNode child in node.ChildNodes) | 574 | foreach(XmlNode child in node.ChildNodes) |
545 | { | 575 | { |
546 | IDataNode dataNode = Kernel.Instance.ParseNode(child, this); | 576 | IDataNode dataNode = Kernel.Instance.ParseNode(child, this); |
547 | if(dataNode is ConfigurationNode) | 577 | if(dataNode is ConfigurationNode) |
548 | { | 578 | { |
549 | HandleConfiguration((ConfigurationNode)dataNode); | 579 | HandleConfiguration((ConfigurationNode)dataNode); |
550 | } | 580 | } |
551 | else if(dataNode is ReferencePathNode) | 581 | else if(dataNode is ReferencePathNode) |
552 | { | 582 | { |
553 | m_ReferencePaths.Add((ReferencePathNode)dataNode); | 583 | m_ReferencePaths.Add((ReferencePathNode)dataNode); |
554 | } | 584 | } |
555 | else if(dataNode is ReferenceNode) | 585 | else if(dataNode is ReferenceNode) |
556 | { | 586 | { |
557 | m_References.Add((ReferenceNode)dataNode); | 587 | m_References.Add((ReferenceNode)dataNode); |
558 | } | 588 | } |
559 | else if(dataNode is AuthorNode) | 589 | else if(dataNode is AuthorNode) |
560 | { | 590 | { |
561 | m_Authors.Add((AuthorNode)dataNode); | 591 | m_Authors.Add((AuthorNode)dataNode); |
562 | } | 592 | } |
563 | else if(dataNode is FilesNode) | 593 | else if(dataNode is FilesNode) |
564 | { | 594 | { |
565 | m_Files = (FilesNode)dataNode; | 595 | m_Files = (FilesNode)dataNode; |
566 | } | 596 | } |
567 | } | 597 | } |
568 | } | 598 | } |
569 | finally | 599 | finally |
570 | { | 600 | { |
571 | Kernel.Instance.CurrentWorkingDirectory.Pop(); | 601 | Kernel.Instance.CurrentWorkingDirectory.Pop(); |
572 | } | 602 | } |
573 | } | 603 | } |
574 | 604 | ||
575 | #endregion | 605 | #endregion |
576 | 606 | ||
577 | #region IComparable Members | 607 | #region IComparable Members |
578 | 608 | ||
@@ -582,6 +612,6 @@ namespace Prebuild.Core.Nodes | |||
582 | return m_Name.CompareTo(that.m_Name); | 612 | return m_Name.CompareTo(that.m_Name); |
583 | } | 613 | } |
584 | 614 | ||
585 | #endregion | 615 | #endregion |
586 | } | 616 | } |
587 | } | 617 | } |
diff --git a/Prebuild/src/Core/Nodes/ReferenceNode.cs b/Prebuild/src/Core/Nodes/ReferenceNode.cs index 9afb512..9c5d1a3 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 29c63c5..7331cd7 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 e1d5b3b..10c0223 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; | ||
221 | } | 108 | } |
222 | } | 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; | ||
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 | } |