diff options
Diffstat (limited to 'Prebuild/src/Core/Nodes/ProjectNode.cs')
-rw-r--r-- | Prebuild/src/Core/Nodes/ProjectNode.cs | 1024 |
1 files changed, 512 insertions, 512 deletions
diff --git a/Prebuild/src/Core/Nodes/ProjectNode.cs b/Prebuild/src/Core/Nodes/ProjectNode.cs index a822704..e02b11b 100644 --- a/Prebuild/src/Core/Nodes/ProjectNode.cs +++ b/Prebuild/src/Core/Nodes/ProjectNode.cs | |||
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea | |||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided that the following conditions are met: |
7 | 7 | ||
8 | * Redistributions of source code must retain the above copyright notice, this list of conditions | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions |
9 | and the following disclaimer. | 9 | and the following disclaimer. |
10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions |
11 | and the following disclaimer in the documentation and/or other materials provided with the | 11 | and the following disclaimer in the documentation and/or other materials provided with the |
12 | distribution. | 12 | distribution. |
13 | * The name of the author may not be used to endorse or promote products derived from this software | 13 | * The name of the author may not be used to endorse or promote products derived from this software |
14 | without specific prior written permission. | 14 | without specific prior written permission. |
15 | 15 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
@@ -34,65 +34,65 @@ using Prebuild.Core.Utilities; | |||
34 | 34 | ||
35 | namespace Prebuild.Core.Nodes | 35 | namespace Prebuild.Core.Nodes |
36 | { | 36 | { |
37 | /// <summary> | 37 | /// <summary> |
38 | /// A set of values that the Project's type can be | 38 | /// A set of values that the Project's type can be |
39 | /// </summary> | 39 | /// </summary> |
40 | public enum ProjectType | 40 | public enum ProjectType |
41 | { | 41 | { |
42 | /// <summary> | 42 | /// <summary> |
43 | /// The project is a console executable | 43 | /// The project is a console executable |
44 | /// </summary> | 44 | /// </summary> |
45 | Exe, | 45 | Exe, |
46 | /// <summary> | 46 | /// <summary> |
47 | /// The project is a windows executable | 47 | /// The project is a windows executable |
48 | /// </summary> | 48 | /// </summary> |
49 | WinExe, | 49 | WinExe, |
50 | /// <summary> | 50 | /// <summary> |
51 | /// The project is a library | 51 | /// The project is a library |
52 | /// </summary> | 52 | /// </summary> |
53 | Library, | 53 | Library, |
54 | /// <summary> | 54 | /// <summary> |
55 | /// The project is a website | 55 | /// The project is a website |
56 | /// </summary> | 56 | /// </summary> |
57 | Web, | 57 | Web, |
58 | } | 58 | } |
59 | 59 | ||
60 | /// <summary> | 60 | /// <summary> |
61 | /// | 61 | /// |
62 | /// </summary> | 62 | /// </summary> |
63 | public enum ClrRuntime | 63 | public enum ClrRuntime |
64 | { | 64 | { |
65 | /// <summary> | 65 | /// <summary> |
66 | /// | 66 | /// |
67 | /// </summary> | 67 | /// </summary> |
68 | Microsoft, | 68 | Microsoft, |
69 | /// <summary> | 69 | /// <summary> |
70 | /// | 70 | /// |
71 | /// </summary> | 71 | /// </summary> |
72 | Mono | 72 | Mono |
73 | } | 73 | } |
74 | /// <summary> | 74 | /// <summary> |
75 | /// The version of the .NET framework to use (Required for VS2008) | 75 | /// The version of the .NET framework to use (Required for VS2008) |
76 | /// <remarks>We don't need .NET 1.1 in here, it'll default when using vs2003.</remarks> | 76 | /// <remarks>We don't need .NET 1.1 in here, it'll default when using vs2003.</remarks> |
77 | /// </summary> | 77 | /// </summary> |
78 | public enum FrameworkVersion | 78 | public enum FrameworkVersion |
79 | { | 79 | { |
80 | /// <summary> | 80 | /// <summary> |
81 | /// .NET 2.0 | 81 | /// .NET 2.0 |
82 | /// </summary> | 82 | /// </summary> |
83 | v2_0, | 83 | v2_0, |
84 | /// <summary> | 84 | /// <summary> |
85 | /// .NET 3.0 | 85 | /// .NET 3.0 |
86 | /// </summary> | 86 | /// </summary> |
87 | v3_0, | 87 | v3_0, |
88 | /// <summary> | 88 | /// <summary> |
89 | /// .NET 3.5 | 89 | /// .NET 3.5 |
90 | /// </summary> | 90 | /// </summary> |
91 | v3_5, | 91 | v3_5, |
92 | /// <summary> | 92 | /// <summary> |
93 | /// .NET 4.0 | 93 | /// .NET 4.0 |
94 | /// </summary> | 94 | /// </summary> |
95 | v4_0, | 95 | v4_0, |
96 | /// <summary> | 96 | /// <summary> |
97 | /// .NET 4.5 | 97 | /// .NET 4.5 |
98 | /// </summary> | 98 | /// </summary> |
@@ -102,477 +102,477 @@ namespace Prebuild.Core.Nodes | |||
102 | /// </summary> | 102 | /// </summary> |
103 | v4_5_1 | 103 | v4_5_1 |
104 | } | 104 | } |
105 | /// <summary> | 105 | /// <summary> |
106 | /// The Node object representing /Prebuild/Solution/Project elements | 106 | /// The Node object representing /Prebuild/Solution/Project elements |
107 | /// </summary> | 107 | /// </summary> |
108 | [DataNode("Project")] | 108 | [DataNode("Project")] |
109 | public class ProjectNode : DataNode, IComparable | 109 | public class ProjectNode : DataNode, IComparable |
110 | { | 110 | { |
111 | #region Fields | 111 | #region Fields |
112 | 112 | ||
113 | private string m_Name = "unknown"; | 113 | private string m_Name = "unknown"; |
114 | private string m_Path = ""; | 114 | private string m_Path = ""; |
115 | private string m_FullPath = ""; | 115 | private string m_FullPath = ""; |
116 | private string m_AssemblyName; | 116 | private string m_AssemblyName; |
117 | private string m_AppIcon = ""; | 117 | private string m_AppIcon = ""; |
118 | private string m_ConfigFile = ""; | 118 | private string m_ConfigFile = ""; |
119 | private string m_DesignerFolder = ""; | 119 | private string m_DesignerFolder = ""; |
120 | private string m_Language = "C#"; | 120 | private string m_Language = "C#"; |
121 | private ProjectType m_Type = ProjectType.Exe; | 121 | private ProjectType m_Type = ProjectType.Exe; |
122 | private ClrRuntime m_Runtime = ClrRuntime.Microsoft; | 122 | private ClrRuntime m_Runtime = ClrRuntime.Microsoft; |
123 | private FrameworkVersion m_Framework = FrameworkVersion.v2_0; | 123 | private FrameworkVersion m_Framework = FrameworkVersion.v2_0; |
124 | private string m_StartupObject = ""; | 124 | private string m_StartupObject = ""; |
125 | private string m_RootNamespace; | 125 | private string m_RootNamespace; |
126 | private string m_FilterGroups = ""; | 126 | private string m_FilterGroups = ""; |
127 | private string m_Version = ""; | 127 | private string m_Version = ""; |
128 | private Guid m_Guid; | 128 | private Guid m_Guid; |
129 | private string m_DebugStartParameters; | 129 | private string m_DebugStartParameters; |
130 | 130 | ||
131 | private readonly Dictionary<string, ConfigurationNode> m_Configurations = new Dictionary<string, ConfigurationNode>(); | 131 | private readonly Dictionary<string, ConfigurationNode> m_Configurations = new Dictionary<string, ConfigurationNode>(); |
132 | private readonly List<ReferencePathNode> m_ReferencePaths = new List<ReferencePathNode>(); | 132 | private readonly List<ReferencePathNode> m_ReferencePaths = new List<ReferencePathNode>(); |
133 | private readonly List<ReferenceNode> m_References = new List<ReferenceNode>(); | 133 | private readonly List<ReferenceNode> m_References = new List<ReferenceNode>(); |
134 | private readonly List<AuthorNode> m_Authors = new List<AuthorNode>(); | 134 | private readonly List<AuthorNode> m_Authors = new List<AuthorNode>(); |
135 | private FilesNode m_Files; | 135 | private FilesNode m_Files; |
136 | 136 | ||
137 | #endregion | 137 | #endregion |
138 | 138 | ||
139 | #region Properties | 139 | #region Properties |
140 | 140 | ||
141 | /// <summary> | 141 | /// <summary> |
142 | /// Gets the name. | 142 | /// Gets the name. |
143 | /// </summary> | 143 | /// </summary> |
144 | /// <value>The name.</value> | 144 | /// <value>The name.</value> |
145 | public string Name | 145 | public string Name |
146 | { | 146 | { |
147 | get | 147 | get |
148 | { | 148 | { |
149 | return m_Name; | 149 | return m_Name; |
150 | } | 150 | } |
151 | } | 151 | } |
152 | /// <summary> | 152 | /// <summary> |
153 | /// The version of the .NET Framework to compile under | 153 | /// The version of the .NET Framework to compile under |
154 | /// </summary> | 154 | /// </summary> |
155 | public FrameworkVersion FrameworkVersion | 155 | public FrameworkVersion FrameworkVersion |
156 | { | 156 | { |
157 | get | 157 | get |
158 | { | 158 | { |
159 | return m_Framework; | 159 | return m_Framework; |
160 | } | 160 | } |
161 | } | 161 | } |
162 | /// <summary> | 162 | /// <summary> |
163 | /// Gets the path. | 163 | /// Gets the path. |
164 | /// </summary> | 164 | /// </summary> |
165 | /// <value>The path.</value> | 165 | /// <value>The path.</value> |
166 | public string Path | 166 | public string Path |
167 | { | 167 | { |
168 | get | 168 | get |
169 | { | 169 | { |
170 | return m_Path; | 170 | return m_Path; |
171 | } | 171 | } |
172 | } | 172 | } |
173 | 173 | ||
174 | /// <summary> | 174 | /// <summary> |
175 | /// Gets the filter groups. | 175 | /// Gets the filter groups. |
176 | /// </summary> | 176 | /// </summary> |
177 | /// <value>The filter groups.</value> | 177 | /// <value>The filter groups.</value> |
178 | public string FilterGroups | 178 | public string FilterGroups |
179 | { | 179 | { |
180 | get | 180 | get |
181 | { | 181 | { |
182 | return m_FilterGroups; | 182 | return m_FilterGroups; |
183 | } | 183 | } |
184 | } | 184 | } |
185 | 185 | ||
186 | /// <summary> | 186 | /// <summary> |
187 | /// Gets the project's version | 187 | /// Gets the project's version |
188 | /// </summary> | 188 | /// </summary> |
189 | /// <value>The project's version.</value> | 189 | /// <value>The project's version.</value> |
190 | public string Version | 190 | public string Version |
191 | { | 191 | { |
192 | get | 192 | get |
193 | { | 193 | { |
194 | return m_Version; | 194 | return m_Version; |
195 | } | 195 | } |
196 | } | 196 | } |
197 | 197 | ||
198 | /// <summary> | 198 | /// <summary> |
199 | /// Gets the full path. | 199 | /// Gets the full path. |
200 | /// </summary> | 200 | /// </summary> |
201 | /// <value>The full path.</value> | 201 | /// <value>The full path.</value> |
202 | public string FullPath | 202 | public string FullPath |
203 | { | 203 | { |
204 | get | 204 | get |
205 | { | 205 | { |
206 | return m_FullPath; | 206 | return m_FullPath; |
207 | } | 207 | } |
208 | } | 208 | } |
209 | 209 | ||
210 | /// <summary> | 210 | /// <summary> |
211 | /// Gets the name of the assembly. | 211 | /// Gets the name of the assembly. |
212 | /// </summary> | 212 | /// </summary> |
213 | /// <value>The name of the assembly.</value> | 213 | /// <value>The name of the assembly.</value> |
214 | public string AssemblyName | 214 | public string AssemblyName |
215 | { | 215 | { |
216 | get | 216 | get |
217 | { | 217 | { |
218 | return m_AssemblyName; | 218 | return m_AssemblyName; |
219 | } | 219 | } |
220 | } | 220 | } |
221 | 221 | ||
222 | /// <summary> | 222 | /// <summary> |
223 | /// Gets the app icon. | 223 | /// Gets the app icon. |
224 | /// </summary> | 224 | /// </summary> |
225 | /// <value>The app icon.</value> | 225 | /// <value>The app icon.</value> |
226 | public string AppIcon | 226 | public string AppIcon |
227 | { | 227 | { |
228 | get | 228 | get |
229 | { | 229 | { |
230 | return m_AppIcon; | 230 | return m_AppIcon; |
231 | } | 231 | } |
232 | } | 232 | } |
233 | 233 | ||
234 | /// <summary> | 234 | /// <summary> |
235 | /// Gets the app icon. | 235 | /// Gets the app icon. |
236 | /// </summary> | 236 | /// </summary> |
237 | /// <value>The app icon.</value> | 237 | /// <value>The app icon.</value> |
238 | public string ConfigFile | 238 | public string ConfigFile |
239 | { | 239 | { |
240 | get | 240 | get |
241 | { | 241 | { |
242 | return m_ConfigFile; | 242 | return m_ConfigFile; |
243 | } | 243 | } |
244 | } | 244 | } |
245 | 245 | ||
246 | /// <summary> | 246 | /// <summary> |
247 | /// | 247 | /// |
248 | /// </summary> | 248 | /// </summary> |
249 | public string DesignerFolder | 249 | public string DesignerFolder |
250 | { | 250 | { |
251 | get | 251 | get |
252 | { | 252 | { |
253 | return m_DesignerFolder; | 253 | return m_DesignerFolder; |
254 | } | 254 | } |
255 | } | 255 | } |
256 | 256 | ||
257 | /// <summary> | 257 | /// <summary> |
258 | /// Gets the language. | 258 | /// Gets the language. |
259 | /// </summary> | 259 | /// </summary> |
260 | /// <value>The language.</value> | 260 | /// <value>The language.</value> |
261 | public string Language | 261 | public string Language |
262 | { | 262 | { |
263 | get | 263 | get |
264 | { | 264 | { |
265 | return m_Language; | 265 | return m_Language; |
266 | } | 266 | } |
267 | } | 267 | } |
268 | 268 | ||
269 | /// <summary> | 269 | /// <summary> |
270 | /// Gets the type. | 270 | /// Gets the type. |
271 | /// </summary> | 271 | /// </summary> |
272 | /// <value>The type.</value> | 272 | /// <value>The type.</value> |
273 | public ProjectType Type | 273 | public ProjectType Type |
274 | { | 274 | { |
275 | get | 275 | get |
276 | { | 276 | { |
277 | return m_Type; | 277 | return m_Type; |
278 | } | 278 | } |
279 | } | 279 | } |
280 | 280 | ||
281 | /// <summary> | 281 | /// <summary> |
282 | /// Gets the runtime. | 282 | /// Gets the runtime. |
283 | /// </summary> | 283 | /// </summary> |
284 | /// <value>The runtime.</value> | 284 | /// <value>The runtime.</value> |
285 | public ClrRuntime Runtime | 285 | public ClrRuntime Runtime |
286 | { | 286 | { |
287 | get | 287 | get |
288 | { | 288 | { |
289 | return m_Runtime; | 289 | return m_Runtime; |
290 | } | 290 | } |
291 | } | 291 | } |
292 | 292 | ||
293 | private bool m_GenerateAssemblyInfoFile; | 293 | private bool m_GenerateAssemblyInfoFile; |
294 | 294 | ||
295 | /// <summary> | 295 | /// <summary> |
296 | /// | 296 | /// |
297 | /// </summary> | 297 | /// </summary> |
298 | public bool GenerateAssemblyInfoFile | 298 | public bool GenerateAssemblyInfoFile |
299 | { | 299 | { |
300 | get | 300 | get |
301 | { | 301 | { |
302 | return m_GenerateAssemblyInfoFile; | 302 | return m_GenerateAssemblyInfoFile; |
303 | } | 303 | } |
304 | set | 304 | set |
305 | { | 305 | { |
306 | m_GenerateAssemblyInfoFile = value; | 306 | m_GenerateAssemblyInfoFile = value; |
307 | } | 307 | } |
308 | } | 308 | } |
309 | 309 | ||
310 | /// <summary> | 310 | /// <summary> |
311 | /// Gets the startup object. | 311 | /// Gets the startup object. |
312 | /// </summary> | 312 | /// </summary> |
313 | /// <value>The startup object.</value> | 313 | /// <value>The startup object.</value> |
314 | public string StartupObject | 314 | public string StartupObject |
315 | { | 315 | { |
316 | get | 316 | get |
317 | { | 317 | { |
318 | return m_StartupObject; | 318 | return m_StartupObject; |
319 | } | 319 | } |
320 | } | 320 | } |
321 | 321 | ||
322 | /// <summary> | 322 | /// <summary> |
323 | /// Gets the root namespace. | 323 | /// Gets the root namespace. |
324 | /// </summary> | 324 | /// </summary> |
325 | /// <value>The root namespace.</value> | 325 | /// <value>The root namespace.</value> |
326 | public string RootNamespace | 326 | public string RootNamespace |
327 | { | 327 | { |
328 | get | 328 | get |
329 | { | 329 | { |
330 | return m_RootNamespace; | 330 | return m_RootNamespace; |
331 | } | 331 | } |
332 | } | 332 | } |
333 | 333 | ||
334 | /// <summary> | 334 | /// <summary> |
335 | /// Gets the configurations. | 335 | /// Gets the configurations. |
336 | /// </summary> | 336 | /// </summary> |
337 | /// <value>The configurations.</value> | 337 | /// <value>The configurations.</value> |
338 | public List<ConfigurationNode> Configurations | 338 | public List<ConfigurationNode> Configurations |
339 | { | 339 | { |
340 | get | 340 | get |
341 | { | 341 | { |
342 | List<ConfigurationNode> tmp = new List<ConfigurationNode>(ConfigurationsTable.Values); | 342 | List<ConfigurationNode> tmp = new List<ConfigurationNode>(ConfigurationsTable.Values); |
343 | tmp.Sort(); | 343 | tmp.Sort(); |
344 | return tmp; | 344 | return tmp; |
345 | } | 345 | } |
346 | } | 346 | } |
347 | 347 | ||
348 | /// <summary> | 348 | /// <summary> |
349 | /// Gets the configurations table. | 349 | /// Gets the configurations table. |
350 | /// </summary> | 350 | /// </summary> |
351 | /// <value>The configurations table.</value> | 351 | /// <value>The configurations table.</value> |
352 | public Dictionary<string, ConfigurationNode> ConfigurationsTable | 352 | public Dictionary<string, ConfigurationNode> ConfigurationsTable |
353 | { | 353 | { |
354 | get | 354 | get |
355 | { | 355 | { |
356 | return m_Configurations; | 356 | return m_Configurations; |
357 | } | 357 | } |
358 | } | 358 | } |
359 | 359 | ||
360 | /// <summary> | 360 | /// <summary> |
361 | /// Gets the reference paths. | 361 | /// Gets the reference paths. |
362 | /// </summary> | 362 | /// </summary> |
363 | /// <value>The reference paths.</value> | 363 | /// <value>The reference paths.</value> |
364 | public List<ReferencePathNode> ReferencePaths | 364 | public List<ReferencePathNode> ReferencePaths |
365 | { | 365 | { |
366 | get | 366 | get |
367 | { | 367 | { |
368 | List<ReferencePathNode> tmp = new List<ReferencePathNode>(m_ReferencePaths); | 368 | List<ReferencePathNode> tmp = new List<ReferencePathNode>(m_ReferencePaths); |
369 | tmp.Sort(); | 369 | tmp.Sort(); |
370 | return tmp; | 370 | return tmp; |
371 | } | 371 | } |
372 | } | 372 | } |
373 | 373 | ||
374 | /// <summary> | 374 | /// <summary> |
375 | /// Gets the references. | 375 | /// Gets the references. |
376 | /// </summary> | 376 | /// </summary> |
377 | /// <value>The references.</value> | 377 | /// <value>The references.</value> |
378 | public List<ReferenceNode> References | 378 | public List<ReferenceNode> References |
379 | { | 379 | { |
380 | get | 380 | get |
381 | { | 381 | { |
382 | List<ReferenceNode> tmp = new List<ReferenceNode>(m_References); | 382 | List<ReferenceNode> tmp = new List<ReferenceNode>(m_References); |
383 | tmp.Sort(); | 383 | tmp.Sort(); |
384 | return tmp; | 384 | return tmp; |
385 | } | 385 | } |
386 | } | 386 | } |
387 | 387 | ||
388 | /// <summary> | 388 | /// <summary> |
389 | /// Gets the Authors list. | 389 | /// Gets the Authors list. |
390 | /// </summary> | 390 | /// </summary> |
391 | /// <value>The list of the project's authors.</value> | 391 | /// <value>The list of the project's authors.</value> |
392 | public List<AuthorNode> Authors | 392 | public List<AuthorNode> Authors |
393 | { | 393 | { |
394 | get | 394 | get |
395 | { | 395 | { |
396 | return m_Authors; | 396 | return m_Authors; |
397 | } | 397 | } |
398 | } | 398 | } |
399 | 399 | ||
400 | /// <summary> | 400 | /// <summary> |
401 | /// Gets the files. | 401 | /// Gets the files. |
402 | /// </summary> | 402 | /// </summary> |
403 | /// <value>The files.</value> | 403 | /// <value>The files.</value> |
404 | public FilesNode Files | 404 | public FilesNode Files |
405 | { | 405 | { |
406 | get | 406 | get |
407 | { | 407 | { |
408 | return m_Files; | 408 | return m_Files; |
409 | } | 409 | } |
410 | } | 410 | } |
411 | 411 | ||
412 | /// <summary> | 412 | /// <summary> |
413 | /// Gets or sets the parent. | 413 | /// Gets or sets the parent. |
414 | /// </summary> | 414 | /// </summary> |
415 | /// <value>The parent.</value> | 415 | /// <value>The parent.</value> |
416 | public override IDataNode Parent | 416 | public override IDataNode Parent |
417 | { | 417 | { |
418 | get | 418 | get |
419 | { | 419 | { |
420 | return base.Parent; | 420 | return base.Parent; |
421 | } | 421 | } |
422 | set | 422 | set |
423 | { | 423 | { |
424 | base.Parent = value; | 424 | base.Parent = value; |
425 | if(base.Parent is SolutionNode && m_Configurations.Count < 1) | 425 | if(base.Parent is SolutionNode && m_Configurations.Count < 1) |
426 | { | 426 | { |
427 | SolutionNode parent = (SolutionNode)base.Parent; | 427 | SolutionNode parent = (SolutionNode)base.Parent; |
428 | foreach(ConfigurationNode conf in parent.Configurations) | 428 | foreach(ConfigurationNode conf in parent.Configurations) |
429 | { | 429 | { |
430 | m_Configurations[conf.NameAndPlatform] = (ConfigurationNode) conf.Clone(); | 430 | m_Configurations[conf.NameAndPlatform] = (ConfigurationNode) conf.Clone(); |
431 | } | 431 | } |
432 | } | 432 | } |
433 | } | 433 | } |
434 | } | 434 | } |
435 | 435 | ||
436 | /// <summary> | 436 | /// <summary> |
437 | /// Gets the GUID. | 437 | /// Gets the GUID. |
438 | /// </summary> | 438 | /// </summary> |
439 | /// <value>The GUID.</value> | 439 | /// <value>The GUID.</value> |
440 | public Guid Guid | 440 | public Guid Guid |
441 | { | 441 | { |
442 | get | 442 | get |
443 | { | 443 | { |
444 | return m_Guid; | 444 | return m_Guid; |
445 | } | 445 | } |
446 | } | 446 | } |
447 | 447 | ||
448 | public string DebugStartParameters | 448 | public string DebugStartParameters |
449 | { | 449 | { |
450 | get | 450 | get |
451 | { | 451 | { |
452 | return m_DebugStartParameters; | 452 | return m_DebugStartParameters; |
453 | } | 453 | } |
454 | } | 454 | } |
455 | 455 | ||
456 | #endregion | 456 | #endregion |
457 | 457 | ||
458 | #region Private Methods | 458 | #region Private Methods |
459 | 459 | ||
460 | private void HandleConfiguration(ConfigurationNode conf) | 460 | private void HandleConfiguration(ConfigurationNode conf) |
461 | { | 461 | { |
462 | if(String.Compare(conf.Name, "all", true) == 0) //apply changes to all, this may not always be applied first, | 462 | if(String.Compare(conf.Name, "all", true) == 0) //apply changes to all, this may not always be applied first, |
463 | //so it *may* override changes to the same properties for configurations defines at the project level | 463 | //so it *may* override changes to the same properties for configurations defines at the project level |
464 | { | 464 | { |
465 | foreach(ConfigurationNode confNode in m_Configurations.Values) | 465 | foreach(ConfigurationNode confNode in m_Configurations.Values) |
466 | { | 466 | { |
467 | conf.CopyTo(confNode);//update the config templates defines at the project level with the overrides | 467 | conf.CopyTo(confNode);//update the config templates defines at the project level with the overrides |
468 | } | 468 | } |
469 | } | 469 | } |
470 | if(m_Configurations.ContainsKey(conf.NameAndPlatform)) | 470 | if(m_Configurations.ContainsKey(conf.NameAndPlatform)) |
471 | { | 471 | { |
472 | ConfigurationNode parentConf = m_Configurations[conf.NameAndPlatform]; | 472 | ConfigurationNode parentConf = m_Configurations[conf.NameAndPlatform]; |
473 | conf.CopyTo(parentConf);//update the config templates defines at the project level with the overrides | 473 | conf.CopyTo(parentConf);//update the config templates defines at the project level with the overrides |
474 | } | 474 | } |
475 | else | 475 | else |
476 | { | 476 | { |
477 | m_Configurations[conf.NameAndPlatform] = conf; | 477 | m_Configurations[conf.NameAndPlatform] = conf; |
478 | } | 478 | } |
479 | } | 479 | } |
480 | 480 | ||
481 | #endregion | 481 | #endregion |
482 | 482 | ||
483 | #region Public Methods | 483 | #region Public Methods |
484 | 484 | ||
485 | /// <summary> | 485 | /// <summary> |
486 | /// Parses the specified node. | 486 | /// Parses the specified node. |
487 | /// </summary> | 487 | /// </summary> |
488 | /// <param name="node">The node.</param> | 488 | /// <param name="node">The node.</param> |
489 | public override void Parse(XmlNode node) | 489 | public override void Parse(XmlNode node) |
490 | { | 490 | { |
491 | m_Name = Helper.AttributeValue(node, "name", m_Name); | 491 | m_Name = Helper.AttributeValue(node, "name", m_Name); |
492 | m_Path = Helper.AttributeValue(node, "path", m_Path); | 492 | m_Path = Helper.AttributeValue(node, "path", m_Path); |
493 | m_FilterGroups = Helper.AttributeValue(node, "filterGroups", m_FilterGroups); | 493 | m_FilterGroups = Helper.AttributeValue(node, "filterGroups", m_FilterGroups); |
494 | m_Version = Helper.AttributeValue(node, "version", m_Version); | 494 | m_Version = Helper.AttributeValue(node, "version", m_Version); |
495 | m_AppIcon = Helper.AttributeValue(node, "icon", m_AppIcon); | 495 | m_AppIcon = Helper.AttributeValue(node, "icon", m_AppIcon); |
496 | m_ConfigFile = Helper.AttributeValue(node, "configFile", m_ConfigFile); | 496 | m_ConfigFile = Helper.AttributeValue(node, "configFile", m_ConfigFile); |
497 | m_DesignerFolder = Helper.AttributeValue(node, "designerFolder", m_DesignerFolder); | 497 | m_DesignerFolder = Helper.AttributeValue(node, "designerFolder", m_DesignerFolder); |
498 | m_AssemblyName = Helper.AttributeValue(node, "assemblyName", m_AssemblyName); | 498 | m_AssemblyName = Helper.AttributeValue(node, "assemblyName", m_AssemblyName); |
499 | m_Language = Helper.AttributeValue(node, "language", m_Language); | 499 | m_Language = Helper.AttributeValue(node, "language", m_Language); |
500 | m_Type = (ProjectType)Helper.EnumAttributeValue(node, "type", typeof(ProjectType), m_Type); | 500 | m_Type = (ProjectType)Helper.EnumAttributeValue(node, "type", typeof(ProjectType), m_Type); |
501 | m_Runtime = (ClrRuntime)Helper.EnumAttributeValue(node, "runtime", typeof(ClrRuntime), m_Runtime); | 501 | m_Runtime = (ClrRuntime)Helper.EnumAttributeValue(node, "runtime", typeof(ClrRuntime), m_Runtime); |
502 | m_Framework = (FrameworkVersion)Helper.EnumAttributeValue(node, "frameworkVersion", typeof(FrameworkVersion), m_Framework); | 502 | m_Framework = (FrameworkVersion)Helper.EnumAttributeValue(node, "frameworkVersion", typeof(FrameworkVersion), m_Framework); |
503 | m_StartupObject = Helper.AttributeValue(node, "startupObject", m_StartupObject); | 503 | m_StartupObject = Helper.AttributeValue(node, "startupObject", m_StartupObject); |
504 | m_RootNamespace = Helper.AttributeValue(node, "rootNamespace", m_RootNamespace); | 504 | m_RootNamespace = Helper.AttributeValue(node, "rootNamespace", m_RootNamespace); |
505 | 505 | ||
506 | int hash = m_Name.GetHashCode(); | 506 | int hash = m_Name.GetHashCode(); |
507 | Guid guidByHash = new Guid(hash, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); | 507 | Guid guidByHash = new Guid(hash, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); |
508 | string guid = Helper.AttributeValue(node, "guid", guidByHash.ToString()); | 508 | string guid = Helper.AttributeValue(node, "guid", guidByHash.ToString()); |
509 | m_Guid = new Guid(guid); | 509 | m_Guid = new Guid(guid); |
510 | 510 | ||
511 | m_GenerateAssemblyInfoFile = Helper.ParseBoolean(node, "generateAssemblyInfoFile", false); | 511 | m_GenerateAssemblyInfoFile = Helper.ParseBoolean(node, "generateAssemblyInfoFile", false); |
512 | m_DebugStartParameters = Helper.AttributeValue(node, "debugStartParameters", string.Empty); | 512 | m_DebugStartParameters = Helper.AttributeValue(node, "debugStartParameters", string.Empty); |
513 | 513 | ||
514 | if(string.IsNullOrEmpty(m_AssemblyName)) | 514 | if(string.IsNullOrEmpty(m_AssemblyName)) |
515 | { | 515 | { |
516 | m_AssemblyName = m_Name; | 516 | m_AssemblyName = m_Name; |
517 | } | 517 | } |
518 | 518 | ||
519 | if(string.IsNullOrEmpty(m_RootNamespace)) | 519 | if(string.IsNullOrEmpty(m_RootNamespace)) |
520 | { | 520 | { |
521 | m_RootNamespace = m_Name; | 521 | m_RootNamespace = m_Name; |
522 | } | 522 | } |
523 | 523 | ||
524 | m_FullPath = m_Path; | 524 | m_FullPath = m_Path; |
525 | try | 525 | try |
526 | { | 526 | { |
527 | m_FullPath = Helper.ResolvePath(m_FullPath); | 527 | m_FullPath = Helper.ResolvePath(m_FullPath); |
528 | } | 528 | } |
529 | catch | 529 | catch |
530 | { | 530 | { |
531 | throw new WarningException("Could not resolve Solution path: {0}", m_Path); | 531 | throw new WarningException("Could not resolve Solution path: {0}", m_Path); |
532 | } | 532 | } |
533 | 533 | ||
534 | Kernel.Instance.CurrentWorkingDirectory.Push(); | 534 | Kernel.Instance.CurrentWorkingDirectory.Push(); |
535 | try | 535 | try |
536 | { | 536 | { |
537 | Helper.SetCurrentDir(m_FullPath); | 537 | Helper.SetCurrentDir(m_FullPath); |
538 | 538 | ||
539 | if( node == null ) | 539 | if( node == null ) |
540 | { | 540 | { |
541 | throw new ArgumentNullException("node"); | 541 | throw new ArgumentNullException("node"); |
542 | } | 542 | } |
543 | 543 | ||
544 | foreach(XmlNode child in node.ChildNodes) | 544 | foreach(XmlNode child in node.ChildNodes) |
545 | { | 545 | { |
546 | IDataNode dataNode = Kernel.Instance.ParseNode(child, this); | 546 | IDataNode dataNode = Kernel.Instance.ParseNode(child, this); |
547 | if(dataNode is ConfigurationNode) | 547 | if(dataNode is ConfigurationNode) |
548 | { | 548 | { |
549 | HandleConfiguration((ConfigurationNode)dataNode); | 549 | HandleConfiguration((ConfigurationNode)dataNode); |
550 | } | 550 | } |
551 | else if(dataNode is ReferencePathNode) | 551 | else if(dataNode is ReferencePathNode) |
552 | { | 552 | { |
553 | m_ReferencePaths.Add((ReferencePathNode)dataNode); | 553 | m_ReferencePaths.Add((ReferencePathNode)dataNode); |
554 | } | 554 | } |
555 | else if(dataNode is ReferenceNode) | 555 | else if(dataNode is ReferenceNode) |
556 | { | 556 | { |
557 | m_References.Add((ReferenceNode)dataNode); | 557 | m_References.Add((ReferenceNode)dataNode); |
558 | } | 558 | } |
559 | else if(dataNode is AuthorNode) | 559 | else if(dataNode is AuthorNode) |
560 | { | 560 | { |
561 | m_Authors.Add((AuthorNode)dataNode); | 561 | m_Authors.Add((AuthorNode)dataNode); |
562 | } | 562 | } |
563 | else if(dataNode is FilesNode) | 563 | else if(dataNode is FilesNode) |
564 | { | 564 | { |
565 | m_Files = (FilesNode)dataNode; | 565 | m_Files = (FilesNode)dataNode; |
566 | } | 566 | } |
567 | } | 567 | } |
568 | } | 568 | } |
569 | finally | 569 | finally |
570 | { | 570 | { |
571 | Kernel.Instance.CurrentWorkingDirectory.Pop(); | 571 | Kernel.Instance.CurrentWorkingDirectory.Pop(); |
572 | } | 572 | } |
573 | } | 573 | } |
574 | 574 | ||
575 | #endregion | 575 | #endregion |
576 | 576 | ||
577 | #region IComparable Members | 577 | #region IComparable Members |
578 | 578 | ||
@@ -582,6 +582,6 @@ namespace Prebuild.Core.Nodes | |||
582 | return m_Name.CompareTo(that.m_Name); | 582 | return m_Name.CompareTo(that.m_Name); |
583 | } | 583 | } |
584 | 584 | ||
585 | #endregion | 585 | #endregion |
586 | } | 586 | } |
587 | } | 587 | } |