diff options
Diffstat (limited to 'Prebuild/src/Core/Nodes/ProjectNode.cs')
-rw-r--r-- | Prebuild/src/Core/Nodes/ProjectNode.cs | 1020 |
1 files changed, 510 insertions, 510 deletions
diff --git a/Prebuild/src/Core/Nodes/ProjectNode.cs b/Prebuild/src/Core/Nodes/ProjectNode.cs index c56dacc..bddaace 100644 --- a/Prebuild/src/Core/Nodes/ProjectNode.cs +++ b/Prebuild/src/Core/Nodes/ProjectNode.cs | |||
@@ -1,510 +1,510 @@ | |||
1 | #region BSD License | 1 | #region BSD License |
2 | /* | 2 | /* |
3 | Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com) | 3 | Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com) |
4 | 4 | ||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided that the following conditions are met: |
7 | 7 | ||
8 | * Redistributions of source code must retain the above copyright notice, this list of conditions | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions |
9 | and the following disclaimer. | 9 | and the following disclaimer. |
10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions |
11 | and the following disclaimer in the documentation and/or other materials provided with the | 11 | and the following disclaimer in the documentation and/or other materials provided with the |
12 | distribution. | 12 | distribution. |
13 | * The name of the author may not be used to endorse or promote products derived from this software | 13 | * The name of the author may not be used to endorse or promote products derived from this software |
14 | without specific prior written permission. | 14 | without specific prior written permission. |
15 | 15 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
21 | OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | 21 | OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
22 | IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 22 | IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
23 | */ | 23 | */ |
24 | #endregion | 24 | #endregion |
25 | 25 | ||
26 | #region CVS Information | 26 | #region CVS Information |
27 | /* | 27 | /* |
28 | * $Source$ | 28 | * $Source$ |
29 | * $Author: jendave $ | 29 | * $Author: jendave $ |
30 | * $Date: 2006-11-11 05:43:20 +0100 (lö, 11 nov 2006) $ | 30 | * $Date: 2006-11-11 05:43:20 +0100 (lö, 11 nov 2006) $ |
31 | * $Revision: 192 $ | 31 | * $Revision: 192 $ |
32 | */ | 32 | */ |
33 | #endregion | 33 | #endregion |
34 | 34 | ||
35 | using System; | 35 | using System; |
36 | using System.Collections; | 36 | using System.Collections; |
37 | using System.IO; | 37 | using System.IO; |
38 | using System.Xml; | 38 | using System.Xml; |
39 | 39 | ||
40 | using Prebuild.Core.Attributes; | 40 | using Prebuild.Core.Attributes; |
41 | using Prebuild.Core.Interfaces; | 41 | using Prebuild.Core.Interfaces; |
42 | using Prebuild.Core.Utilities; | 42 | using Prebuild.Core.Utilities; |
43 | 43 | ||
44 | namespace Prebuild.Core.Nodes | 44 | namespace Prebuild.Core.Nodes |
45 | { | 45 | { |
46 | /// <summary> | 46 | /// <summary> |
47 | /// | 47 | /// |
48 | /// </summary> | 48 | /// </summary> |
49 | public enum ProjectType | 49 | public enum ProjectType |
50 | { | 50 | { |
51 | /// <summary> | 51 | /// <summary> |
52 | /// | 52 | /// |
53 | /// </summary> | 53 | /// </summary> |
54 | Exe, | 54 | Exe, |
55 | /// <summary> | 55 | /// <summary> |
56 | /// | 56 | /// |
57 | /// </summary> | 57 | /// </summary> |
58 | WinExe, | 58 | WinExe, |
59 | /// <summary> | 59 | /// <summary> |
60 | /// | 60 | /// |
61 | /// </summary> | 61 | /// </summary> |
62 | Library | 62 | Library |
63 | } | 63 | } |
64 | 64 | ||
65 | /// <summary> | 65 | /// <summary> |
66 | /// | 66 | /// |
67 | /// </summary> | 67 | /// </summary> |
68 | public enum ClrRuntime | 68 | public enum ClrRuntime |
69 | { | 69 | { |
70 | /// <summary> | 70 | /// <summary> |
71 | /// | 71 | /// |
72 | /// </summary> | 72 | /// </summary> |
73 | Microsoft, | 73 | Microsoft, |
74 | /// <summary> | 74 | /// <summary> |
75 | /// | 75 | /// |
76 | /// </summary> | 76 | /// </summary> |
77 | Mono | 77 | Mono |
78 | } | 78 | } |
79 | 79 | ||
80 | /// <summary> | 80 | /// <summary> |
81 | /// | 81 | /// |
82 | /// </summary> | 82 | /// </summary> |
83 | [DataNode("Project")] | 83 | [DataNode("Project")] |
84 | public class ProjectNode : DataNode, IComparable | 84 | public class ProjectNode : DataNode, IComparable |
85 | { | 85 | { |
86 | #region Fields | 86 | #region Fields |
87 | 87 | ||
88 | private string m_Name = "unknown"; | 88 | private string m_Name = "unknown"; |
89 | private string m_Path = ""; | 89 | private string m_Path = ""; |
90 | private string m_FullPath = ""; | 90 | private string m_FullPath = ""; |
91 | private string m_AssemblyName; | 91 | private string m_AssemblyName; |
92 | private string m_AppIcon = ""; | 92 | private string m_AppIcon = ""; |
93 | private string m_DesignerFolder = ""; | 93 | private string m_DesignerFolder = ""; |
94 | private string m_Language = "C#"; | 94 | private string m_Language = "C#"; |
95 | private ProjectType m_Type = ProjectType.Exe; | 95 | private ProjectType m_Type = ProjectType.Exe; |
96 | private ClrRuntime m_Runtime = ClrRuntime.Microsoft; | 96 | private ClrRuntime m_Runtime = ClrRuntime.Microsoft; |
97 | private string m_StartupObject = ""; | 97 | private string m_StartupObject = ""; |
98 | private string m_RootNamespace; | 98 | private string m_RootNamespace; |
99 | private string m_FilterGroups = ""; | 99 | private string m_FilterGroups = ""; |
100 | private Guid m_Guid; | 100 | private Guid m_Guid; |
101 | 101 | ||
102 | private Hashtable m_Configurations; | 102 | private Hashtable m_Configurations; |
103 | private ArrayList m_ReferencePaths; | 103 | private ArrayList m_ReferencePaths; |
104 | private ArrayList m_References; | 104 | private ArrayList m_References; |
105 | private FilesNode m_Files; | 105 | private FilesNode m_Files; |
106 | 106 | ||
107 | #endregion | 107 | #endregion |
108 | 108 | ||
109 | #region Constructors | 109 | #region Constructors |
110 | 110 | ||
111 | /// <summary> | 111 | /// <summary> |
112 | /// Initializes a new instance of the <see cref="ProjectNode"/> class. | 112 | /// Initializes a new instance of the <see cref="ProjectNode"/> class. |
113 | /// </summary> | 113 | /// </summary> |
114 | public ProjectNode() | 114 | public ProjectNode() |
115 | { | 115 | { |
116 | m_Configurations = new Hashtable(); | 116 | m_Configurations = new Hashtable(); |
117 | m_ReferencePaths = new ArrayList(); | 117 | m_ReferencePaths = new ArrayList(); |
118 | m_References = new ArrayList(); | 118 | m_References = new ArrayList(); |
119 | } | 119 | } |
120 | 120 | ||
121 | #endregion | 121 | #endregion |
122 | 122 | ||
123 | #region Properties | 123 | #region Properties |
124 | 124 | ||
125 | /// <summary> | 125 | /// <summary> |
126 | /// Gets the name. | 126 | /// Gets the name. |
127 | /// </summary> | 127 | /// </summary> |
128 | /// <value>The name.</value> | 128 | /// <value>The name.</value> |
129 | public string Name | 129 | public string Name |
130 | { | 130 | { |
131 | get | 131 | get |
132 | { | 132 | { |
133 | return m_Name; | 133 | return m_Name; |
134 | } | 134 | } |
135 | } | 135 | } |
136 | 136 | ||
137 | /// <summary> | 137 | /// <summary> |
138 | /// Gets the path. | 138 | /// Gets the path. |
139 | /// </summary> | 139 | /// </summary> |
140 | /// <value>The path.</value> | 140 | /// <value>The path.</value> |
141 | public string Path | 141 | public string Path |
142 | { | 142 | { |
143 | get | 143 | get |
144 | { | 144 | { |
145 | return m_Path; | 145 | return m_Path; |
146 | } | 146 | } |
147 | } | 147 | } |
148 | 148 | ||
149 | /// <summary> | 149 | /// <summary> |
150 | /// Gets the filter groups. | 150 | /// Gets the filter groups. |
151 | /// </summary> | 151 | /// </summary> |
152 | /// <value>The filter groups.</value> | 152 | /// <value>The filter groups.</value> |
153 | public string FilterGroups | 153 | public string FilterGroups |
154 | { | 154 | { |
155 | get | 155 | get |
156 | { | 156 | { |
157 | return m_FilterGroups; | 157 | return m_FilterGroups; |
158 | } | 158 | } |
159 | } | 159 | } |
160 | 160 | ||
161 | /// <summary> | 161 | /// <summary> |
162 | /// Gets the full path. | 162 | /// Gets the full path. |
163 | /// </summary> | 163 | /// </summary> |
164 | /// <value>The full path.</value> | 164 | /// <value>The full path.</value> |
165 | public string FullPath | 165 | public string FullPath |
166 | { | 166 | { |
167 | get | 167 | get |
168 | { | 168 | { |
169 | return m_FullPath; | 169 | return m_FullPath; |
170 | } | 170 | } |
171 | } | 171 | } |
172 | 172 | ||
173 | /// <summary> | 173 | /// <summary> |
174 | /// Gets the name of the assembly. | 174 | /// Gets the name of the assembly. |
175 | /// </summary> | 175 | /// </summary> |
176 | /// <value>The name of the assembly.</value> | 176 | /// <value>The name of the assembly.</value> |
177 | public string AssemblyName | 177 | public string AssemblyName |
178 | { | 178 | { |
179 | get | 179 | get |
180 | { | 180 | { |
181 | return m_AssemblyName; | 181 | return m_AssemblyName; |
182 | } | 182 | } |
183 | } | 183 | } |
184 | 184 | ||
185 | /// <summary> | 185 | /// <summary> |
186 | /// Gets the app icon. | 186 | /// Gets the app icon. |
187 | /// </summary> | 187 | /// </summary> |
188 | /// <value>The app icon.</value> | 188 | /// <value>The app icon.</value> |
189 | public string AppIcon | 189 | public string AppIcon |
190 | { | 190 | { |
191 | get | 191 | get |
192 | { | 192 | { |
193 | return m_AppIcon; | 193 | return m_AppIcon; |
194 | } | 194 | } |
195 | } | 195 | } |
196 | 196 | ||
197 | /// <summary> | 197 | /// <summary> |
198 | /// | 198 | /// |
199 | /// </summary> | 199 | /// </summary> |
200 | public string DesignerFolder | 200 | public string DesignerFolder |
201 | { | 201 | { |
202 | get | 202 | get |
203 | { | 203 | { |
204 | return m_DesignerFolder; | 204 | return m_DesignerFolder; |
205 | } | 205 | } |
206 | } | 206 | } |
207 | 207 | ||
208 | /// <summary> | 208 | /// <summary> |
209 | /// Gets the language. | 209 | /// Gets the language. |
210 | /// </summary> | 210 | /// </summary> |
211 | /// <value>The language.</value> | 211 | /// <value>The language.</value> |
212 | public string Language | 212 | public string Language |
213 | { | 213 | { |
214 | get | 214 | get |
215 | { | 215 | { |
216 | return m_Language; | 216 | return m_Language; |
217 | } | 217 | } |
218 | } | 218 | } |
219 | 219 | ||
220 | /// <summary> | 220 | /// <summary> |
221 | /// Gets the type. | 221 | /// Gets the type. |
222 | /// </summary> | 222 | /// </summary> |
223 | /// <value>The type.</value> | 223 | /// <value>The type.</value> |
224 | public ProjectType Type | 224 | public ProjectType Type |
225 | { | 225 | { |
226 | get | 226 | get |
227 | { | 227 | { |
228 | return m_Type; | 228 | return m_Type; |
229 | } | 229 | } |
230 | } | 230 | } |
231 | 231 | ||
232 | /// <summary> | 232 | /// <summary> |
233 | /// Gets the runtime. | 233 | /// Gets the runtime. |
234 | /// </summary> | 234 | /// </summary> |
235 | /// <value>The runtime.</value> | 235 | /// <value>The runtime.</value> |
236 | public ClrRuntime Runtime | 236 | public ClrRuntime Runtime |
237 | { | 237 | { |
238 | get | 238 | get |
239 | { | 239 | { |
240 | return m_Runtime; | 240 | return m_Runtime; |
241 | } | 241 | } |
242 | } | 242 | } |
243 | 243 | ||
244 | private bool m_GenerateAssemblyInfoFile = false; | 244 | private bool m_GenerateAssemblyInfoFile = false; |
245 | 245 | ||
246 | /// <summary> | 246 | /// <summary> |
247 | /// | 247 | /// |
248 | /// </summary> | 248 | /// </summary> |
249 | public bool GenerateAssemblyInfoFile | 249 | public bool GenerateAssemblyInfoFile |
250 | { | 250 | { |
251 | get | 251 | get |
252 | { | 252 | { |
253 | return m_GenerateAssemblyInfoFile; | 253 | return m_GenerateAssemblyInfoFile; |
254 | } | 254 | } |
255 | set | 255 | set |
256 | { | 256 | { |
257 | m_GenerateAssemblyInfoFile = value; | 257 | m_GenerateAssemblyInfoFile = value; |
258 | } | 258 | } |
259 | } | 259 | } |
260 | 260 | ||
261 | /// <summary> | 261 | /// <summary> |
262 | /// Gets the startup object. | 262 | /// Gets the startup object. |
263 | /// </summary> | 263 | /// </summary> |
264 | /// <value>The startup object.</value> | 264 | /// <value>The startup object.</value> |
265 | public string StartupObject | 265 | public string StartupObject |
266 | { | 266 | { |
267 | get | 267 | get |
268 | { | 268 | { |
269 | return m_StartupObject; | 269 | return m_StartupObject; |
270 | } | 270 | } |
271 | } | 271 | } |
272 | 272 | ||
273 | /// <summary> | 273 | /// <summary> |
274 | /// Gets the root namespace. | 274 | /// Gets the root namespace. |
275 | /// </summary> | 275 | /// </summary> |
276 | /// <value>The root namespace.</value> | 276 | /// <value>The root namespace.</value> |
277 | public string RootNamespace | 277 | public string RootNamespace |
278 | { | 278 | { |
279 | get | 279 | get |
280 | { | 280 | { |
281 | return m_RootNamespace; | 281 | return m_RootNamespace; |
282 | } | 282 | } |
283 | } | 283 | } |
284 | 284 | ||
285 | /// <summary> | 285 | /// <summary> |
286 | /// Gets the configurations. | 286 | /// Gets the configurations. |
287 | /// </summary> | 287 | /// </summary> |
288 | /// <value>The configurations.</value> | 288 | /// <value>The configurations.</value> |
289 | public ICollection Configurations | 289 | public ICollection Configurations |
290 | { | 290 | { |
291 | get | 291 | get |
292 | { | 292 | { |
293 | ArrayList tmp = new ArrayList( ConfigurationsTable.Values); | 293 | ArrayList tmp = new ArrayList( ConfigurationsTable.Values); |
294 | tmp.Sort(); | 294 | tmp.Sort(); |
295 | return tmp; | 295 | return tmp; |
296 | } | 296 | } |
297 | } | 297 | } |
298 | 298 | ||
299 | /// <summary> | 299 | /// <summary> |
300 | /// Gets the configurations table. | 300 | /// Gets the configurations table. |
301 | /// </summary> | 301 | /// </summary> |
302 | /// <value>The configurations table.</value> | 302 | /// <value>The configurations table.</value> |
303 | public Hashtable ConfigurationsTable | 303 | public Hashtable ConfigurationsTable |
304 | { | 304 | { |
305 | get | 305 | get |
306 | { | 306 | { |
307 | return m_Configurations; | 307 | return m_Configurations; |
308 | } | 308 | } |
309 | } | 309 | } |
310 | 310 | ||
311 | /// <summary> | 311 | /// <summary> |
312 | /// Gets the reference paths. | 312 | /// Gets the reference paths. |
313 | /// </summary> | 313 | /// </summary> |
314 | /// <value>The reference paths.</value> | 314 | /// <value>The reference paths.</value> |
315 | public ArrayList ReferencePaths | 315 | public ArrayList ReferencePaths |
316 | { | 316 | { |
317 | get | 317 | get |
318 | { | 318 | { |
319 | ArrayList tmp = new ArrayList(m_ReferencePaths); | 319 | ArrayList tmp = new ArrayList(m_ReferencePaths); |
320 | tmp.Sort(); | 320 | tmp.Sort(); |
321 | return tmp; | 321 | return tmp; |
322 | } | 322 | } |
323 | } | 323 | } |
324 | 324 | ||
325 | /// <summary> | 325 | /// <summary> |
326 | /// Gets the references. | 326 | /// Gets the references. |
327 | /// </summary> | 327 | /// </summary> |
328 | /// <value>The references.</value> | 328 | /// <value>The references.</value> |
329 | public ArrayList References | 329 | public ArrayList References |
330 | { | 330 | { |
331 | get | 331 | get |
332 | { | 332 | { |
333 | ArrayList tmp = new ArrayList(m_References); | 333 | ArrayList tmp = new ArrayList(m_References); |
334 | tmp.Sort(); | 334 | tmp.Sort(); |
335 | return tmp; | 335 | return tmp; |
336 | } | 336 | } |
337 | } | 337 | } |
338 | 338 | ||
339 | /// <summary> | 339 | /// <summary> |
340 | /// Gets the files. | 340 | /// Gets the files. |
341 | /// </summary> | 341 | /// </summary> |
342 | /// <value>The files.</value> | 342 | /// <value>The files.</value> |
343 | public FilesNode Files | 343 | public FilesNode Files |
344 | { | 344 | { |
345 | get | 345 | get |
346 | { | 346 | { |
347 | return m_Files; | 347 | return m_Files; |
348 | } | 348 | } |
349 | } | 349 | } |
350 | 350 | ||
351 | /// <summary> | 351 | /// <summary> |
352 | /// Gets or sets the parent. | 352 | /// Gets or sets the parent. |
353 | /// </summary> | 353 | /// </summary> |
354 | /// <value>The parent.</value> | 354 | /// <value>The parent.</value> |
355 | public override IDataNode Parent | 355 | public override IDataNode Parent |
356 | { | 356 | { |
357 | get | 357 | get |
358 | { | 358 | { |
359 | return base.Parent; | 359 | return base.Parent; |
360 | } | 360 | } |
361 | set | 361 | set |
362 | { | 362 | { |
363 | base.Parent = value; | 363 | base.Parent = value; |
364 | if(base.Parent is SolutionNode && m_Configurations.Count < 1) | 364 | if(base.Parent is SolutionNode && m_Configurations.Count < 1) |
365 | { | 365 | { |
366 | SolutionNode parent = (SolutionNode)base.Parent; | 366 | SolutionNode parent = (SolutionNode)base.Parent; |
367 | foreach(ConfigurationNode conf in parent.Configurations) | 367 | foreach(ConfigurationNode conf in parent.Configurations) |
368 | { | 368 | { |
369 | m_Configurations[conf.Name] = conf.Clone(); | 369 | m_Configurations[conf.Name] = conf.Clone(); |
370 | } | 370 | } |
371 | } | 371 | } |
372 | } | 372 | } |
373 | } | 373 | } |
374 | 374 | ||
375 | /// <summary> | 375 | /// <summary> |
376 | /// Gets the GUID. | 376 | /// Gets the GUID. |
377 | /// </summary> | 377 | /// </summary> |
378 | /// <value>The GUID.</value> | 378 | /// <value>The GUID.</value> |
379 | public Guid Guid | 379 | public Guid Guid |
380 | { | 380 | { |
381 | get | 381 | get |
382 | { | 382 | { |
383 | return m_Guid; | 383 | return m_Guid; |
384 | } | 384 | } |
385 | } | 385 | } |
386 | 386 | ||
387 | #endregion | 387 | #endregion |
388 | 388 | ||
389 | #region Private Methods | 389 | #region Private Methods |
390 | 390 | ||
391 | private void HandleConfiguration(ConfigurationNode conf) | 391 | private void HandleConfiguration(ConfigurationNode conf) |
392 | { | 392 | { |
393 | if(String.Compare(conf.Name, "all", true) == 0) //apply changes to all, this may not always be applied first, | 393 | if(String.Compare(conf.Name, "all", true) == 0) //apply changes to all, this may not always be applied first, |
394 | //so it *may* override changes to the same properties for configurations defines at the project level | 394 | //so it *may* override changes to the same properties for configurations defines at the project level |
395 | { | 395 | { |
396 | foreach(ConfigurationNode confNode in this.m_Configurations.Values) | 396 | foreach(ConfigurationNode confNode in this.m_Configurations.Values) |
397 | { | 397 | { |
398 | conf.CopyTo(confNode);//update the config templates defines at the project level with the overrides | 398 | conf.CopyTo(confNode);//update the config templates defines at the project level with the overrides |
399 | } | 399 | } |
400 | } | 400 | } |
401 | if(m_Configurations.ContainsKey(conf.Name)) | 401 | if(m_Configurations.ContainsKey(conf.Name)) |
402 | { | 402 | { |
403 | ConfigurationNode parentConf = (ConfigurationNode)m_Configurations[conf.Name]; | 403 | ConfigurationNode parentConf = (ConfigurationNode)m_Configurations[conf.Name]; |
404 | conf.CopyTo(parentConf);//update the config templates defines at the project level with the overrides | 404 | conf.CopyTo(parentConf);//update the config templates defines at the project level with the overrides |
405 | } | 405 | } |
406 | else | 406 | else |
407 | { | 407 | { |
408 | m_Configurations[conf.Name] = conf; | 408 | m_Configurations[conf.Name] = conf; |
409 | } | 409 | } |
410 | } | 410 | } |
411 | 411 | ||
412 | #endregion | 412 | #endregion |
413 | 413 | ||
414 | #region Public Methods | 414 | #region Public Methods |
415 | 415 | ||
416 | /// <summary> | 416 | /// <summary> |
417 | /// Parses the specified node. | 417 | /// Parses the specified node. |
418 | /// </summary> | 418 | /// </summary> |
419 | /// <param name="node">The node.</param> | 419 | /// <param name="node">The node.</param> |
420 | public override void Parse(XmlNode node) | 420 | public override void Parse(XmlNode node) |
421 | { | 421 | { |
422 | m_Name = Helper.AttributeValue(node, "name", m_Name); | 422 | m_Name = Helper.AttributeValue(node, "name", m_Name); |
423 | m_Path = Helper.AttributeValue(node, "path", m_Path); | 423 | m_Path = Helper.AttributeValue(node, "path", m_Path); |
424 | m_FilterGroups = Helper.AttributeValue(node, "filterGroups", m_FilterGroups); | 424 | m_FilterGroups = Helper.AttributeValue(node, "filterGroups", m_FilterGroups); |
425 | m_AppIcon = Helper.AttributeValue(node, "icon", m_AppIcon); | 425 | m_AppIcon = Helper.AttributeValue(node, "icon", m_AppIcon); |
426 | m_DesignerFolder = Helper.AttributeValue(node, "designerFolder", m_DesignerFolder); | 426 | m_DesignerFolder = Helper.AttributeValue(node, "designerFolder", m_DesignerFolder); |
427 | m_AssemblyName = Helper.AttributeValue(node, "assemblyName", m_AssemblyName); | 427 | m_AssemblyName = Helper.AttributeValue(node, "assemblyName", m_AssemblyName); |
428 | m_Language = Helper.AttributeValue(node, "language", m_Language); | 428 | m_Language = Helper.AttributeValue(node, "language", m_Language); |
429 | m_Type = (ProjectType)Helper.EnumAttributeValue(node, "type", typeof(ProjectType), m_Type); | 429 | m_Type = (ProjectType)Helper.EnumAttributeValue(node, "type", typeof(ProjectType), m_Type); |
430 | m_Runtime = (ClrRuntime)Helper.EnumAttributeValue(node, "runtime", typeof(ClrRuntime), m_Runtime); | 430 | m_Runtime = (ClrRuntime)Helper.EnumAttributeValue(node, "runtime", typeof(ClrRuntime), m_Runtime); |
431 | m_StartupObject = Helper.AttributeValue(node, "startupObject", m_StartupObject); | 431 | m_StartupObject = Helper.AttributeValue(node, "startupObject", m_StartupObject); |
432 | m_RootNamespace = Helper.AttributeValue(node, "rootNamespace", m_RootNamespace); | 432 | m_RootNamespace = Helper.AttributeValue(node, "rootNamespace", m_RootNamespace); |
433 | 433 | ||
434 | int hash = m_Name.GetHashCode(); | 434 | int hash = m_Name.GetHashCode(); |
435 | 435 | ||
436 | m_Guid = new Guid( hash, 0, 0, 0, 0, 0, 0,0,0,0,0 ); | 436 | m_Guid = new Guid( hash, 0, 0, 0, 0, 0, 0,0,0,0,0 ); |
437 | 437 | ||
438 | m_GenerateAssemblyInfoFile = Helper.ParseBoolean(node, "generateAssemblyInfoFile", false); | 438 | m_GenerateAssemblyInfoFile = Helper.ParseBoolean(node, "generateAssemblyInfoFile", false); |
439 | 439 | ||
440 | if(m_AssemblyName == null || m_AssemblyName.Length < 1) | 440 | if(m_AssemblyName == null || m_AssemblyName.Length < 1) |
441 | { | 441 | { |
442 | m_AssemblyName = m_Name; | 442 | m_AssemblyName = m_Name; |
443 | } | 443 | } |
444 | 444 | ||
445 | if(m_RootNamespace == null || m_RootNamespace.Length < 1) | 445 | if(m_RootNamespace == null || m_RootNamespace.Length < 1) |
446 | { | 446 | { |
447 | m_RootNamespace = m_Name; | 447 | m_RootNamespace = m_Name; |
448 | } | 448 | } |
449 | 449 | ||
450 | m_FullPath = m_Path; | 450 | m_FullPath = m_Path; |
451 | try | 451 | try |
452 | { | 452 | { |
453 | m_FullPath = Helper.ResolvePath(m_FullPath); | 453 | m_FullPath = Helper.ResolvePath(m_FullPath); |
454 | } | 454 | } |
455 | catch | 455 | catch |
456 | { | 456 | { |
457 | throw new WarningException("Could not resolve Solution path: {0}", m_Path); | 457 | throw new WarningException("Could not resolve Solution path: {0}", m_Path); |
458 | } | 458 | } |
459 | 459 | ||
460 | Kernel.Instance.CurrentWorkingDirectory.Push(); | 460 | Kernel.Instance.CurrentWorkingDirectory.Push(); |
461 | try | 461 | try |
462 | { | 462 | { |
463 | Helper.SetCurrentDir(m_FullPath); | 463 | Helper.SetCurrentDir(m_FullPath); |
464 | 464 | ||
465 | if( node == null ) | 465 | if( node == null ) |
466 | { | 466 | { |
467 | throw new ArgumentNullException("node"); | 467 | throw new ArgumentNullException("node"); |
468 | } | 468 | } |
469 | 469 | ||
470 | foreach(XmlNode child in node.ChildNodes) | 470 | foreach(XmlNode child in node.ChildNodes) |
471 | { | 471 | { |
472 | IDataNode dataNode = Kernel.Instance.ParseNode(child, this); | 472 | IDataNode dataNode = Kernel.Instance.ParseNode(child, this); |
473 | if(dataNode is ConfigurationNode) | 473 | if(dataNode is ConfigurationNode) |
474 | { | 474 | { |
475 | HandleConfiguration((ConfigurationNode)dataNode); | 475 | HandleConfiguration((ConfigurationNode)dataNode); |
476 | } | 476 | } |
477 | else if(dataNode is ReferencePathNode) | 477 | else if(dataNode is ReferencePathNode) |
478 | { | 478 | { |
479 | m_ReferencePaths.Add(dataNode); | 479 | m_ReferencePaths.Add(dataNode); |
480 | } | 480 | } |
481 | else if(dataNode is ReferenceNode) | 481 | else if(dataNode is ReferenceNode) |
482 | { | 482 | { |
483 | m_References.Add(dataNode); | 483 | m_References.Add(dataNode); |
484 | } | 484 | } |
485 | else if(dataNode is FilesNode) | 485 | else if(dataNode is FilesNode) |
486 | { | 486 | { |
487 | m_Files = (FilesNode)dataNode; | 487 | m_Files = (FilesNode)dataNode; |
488 | } | 488 | } |
489 | } | 489 | } |
490 | } | 490 | } |
491 | finally | 491 | finally |
492 | { | 492 | { |
493 | Kernel.Instance.CurrentWorkingDirectory.Pop(); | 493 | Kernel.Instance.CurrentWorkingDirectory.Pop(); |
494 | } | 494 | } |
495 | } | 495 | } |
496 | 496 | ||
497 | 497 | ||
498 | #endregion | 498 | #endregion |
499 | 499 | ||
500 | #region IComparable Members | 500 | #region IComparable Members |
501 | 501 | ||
502 | public int CompareTo(object obj) | 502 | public int CompareTo(object obj) |
503 | { | 503 | { |
504 | ProjectNode that = (ProjectNode)obj; | 504 | ProjectNode that = (ProjectNode)obj; |
505 | return this.m_Name.CompareTo(that.m_Name); | 505 | return this.m_Name.CompareTo(that.m_Name); |
506 | } | 506 | } |
507 | 507 | ||
508 | #endregion | 508 | #endregion |
509 | } | 509 | } |
510 | } | 510 | } |