aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Prebuild/src/Core/Nodes/ProjectNode.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Prebuild/src/Core/Nodes/ProjectNode.cs')
-rw-r--r--Prebuild/src/Core/Nodes/ProjectNode.cs169
1 files changed, 73 insertions, 96 deletions
diff --git a/Prebuild/src/Core/Nodes/ProjectNode.cs b/Prebuild/src/Core/Nodes/ProjectNode.cs
index 0a24abf..e98ab5f 100644
--- a/Prebuild/src/Core/Nodes/ProjectNode.cs
+++ b/Prebuild/src/Core/Nodes/ProjectNode.cs
@@ -23,9 +23,17 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
23*/ 23*/
24#endregion 24#endregion
25 25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2007-05-26 06:58:26 +0900 (Sat, 26 May 2007) $
31 * $Revision: 244 $
32 */
33#endregion
34
26using System; 35using System;
27using System.Collections; 36using System.Collections;
28using System.Collections.Generic;
29using System.IO; 37using System.IO;
30using System.Xml; 38using System.Xml;
31 39
@@ -51,11 +59,7 @@ namespace Prebuild.Core.Nodes
51 /// <summary> 59 /// <summary>
52 /// The project is a library 60 /// The project is a library
53 /// </summary> 61 /// </summary>
54 Library, 62 Library
55 /// <summary>
56 /// The project is a website
57 /// </summary>
58 Web,
59 } 63 }
60 64
61 /// <summary> 65 /// <summary>
@@ -72,25 +76,7 @@ namespace Prebuild.Core.Nodes
72 /// </summary> 76 /// </summary>
73 Mono 77 Mono
74 } 78 }
75 /// <summary> 79
76 /// The version of the .NET framework to use (Required for VS2008)
77 /// <remarks>We don't need .NET 1.1 in here, it'll default when using vs2003.</remarks>
78 /// </summary>
79 public enum FrameworkVersion
80 {
81 /// <summary>
82 /// .NET 2.0
83 /// </summary>
84 v2_0,
85 /// <summary>
86 /// .NET 3.0
87 /// </summary>
88 v3_0,
89 /// <summary>
90 /// .NET 3.5
91 /// </summary>
92 v3_5,
93 }
94 /// <summary> 80 /// <summary>
95 /// The Node object representing /Prebuild/Solution/Project elements 81 /// The Node object representing /Prebuild/Solution/Project elements
96 /// </summary> 82 /// </summary>
@@ -109,45 +95,49 @@ namespace Prebuild.Core.Nodes
109 private string m_Language = "C#"; 95 private string m_Language = "C#";
110 private ProjectType m_Type = ProjectType.Exe; 96 private ProjectType m_Type = ProjectType.Exe;
111 private ClrRuntime m_Runtime = ClrRuntime.Microsoft; 97 private ClrRuntime m_Runtime = ClrRuntime.Microsoft;
112 private FrameworkVersion m_Framework = FrameworkVersion.v2_0;
113 private string m_StartupObject = ""; 98 private string m_StartupObject = "";
114 private string m_RootNamespace; 99 private string m_RootNamespace;
115 private string m_FilterGroups = ""; 100 private string m_FilterGroups = "";
116 private string m_Version = ""; 101 private string m_Version = "";
117 private Guid m_Guid; 102 private Guid m_Guid;
118 private string m_DebugStartParameters;
119 103
120 private Hashtable m_Configurations = new Hashtable(); 104 private Hashtable m_Configurations;
121 private readonly List<ReferencePathNode> m_ReferencePaths = new List<ReferencePathNode>(); 105 private ArrayList m_ReferencePaths;
122 private readonly List<ReferenceNode> m_References = new List<ReferenceNode>(); 106 private ArrayList m_References;
123 private readonly List<AuthorNode> m_Authors = new List<AuthorNode>(); 107 private ArrayList m_Authors;
124 private FilesNode m_Files; 108 private FilesNode m_Files;
125 109
126 #endregion 110 #endregion
127 111
128 #region Properties 112 #region Constructors
129 113
130 /// <summary> 114 /// <summary>
131 /// Gets the name. 115 /// Initializes a new instance of the <see cref="ProjectNode"/> class.
132 /// </summary> 116 /// </summary>
133 /// <value>The name.</value> 117 public ProjectNode()
134 public string Name
135 { 118 {
136 get 119 m_Configurations = new Hashtable();
137 { 120 m_ReferencePaths = new ArrayList();
138 return m_Name; 121 m_References = new ArrayList();
139 } 122 m_Authors = new ArrayList();
140 } 123 }
124
125 #endregion
126
127 #region Properties
128
141 /// <summary> 129 /// <summary>
142 /// The version of the .NET Framework to compile under 130 /// Gets the name.
143 /// </summary> 131 /// </summary>
144 public FrameworkVersion FrameworkVersion 132 /// <value>The name.</value>
133 public string Name
145 { 134 {
146 get 135 get
147 { 136 {
148 return this.m_Framework; 137 return m_Name;
149 } 138 }
150 } 139 }
140
151 /// <summary> 141 /// <summary>
152 /// Gets the path. 142 /// Gets the path.
153 /// </summary> 143 /// </summary>
@@ -220,17 +210,17 @@ namespace Prebuild.Core.Nodes
220 } 210 }
221 } 211 }
222 212
223 /// <summary> 213 /// <summary>
224 /// Gets the app icon. 214 /// Gets the app icon.
225 /// </summary> 215 /// </summary>
226 /// <value>The app icon.</value> 216 /// <value>The app icon.</value>
227 public string ConfigFile 217 public string ConfigFile
228 { 218 {
229 get 219 get
230 { 220 {
231 return m_ConfigFile; 221 return m_ConfigFile;
232 } 222 }
233 } 223 }
234 224
235 /// <summary> 225 /// <summary>
236 /// 226 ///
@@ -279,22 +269,22 @@ namespace Prebuild.Core.Nodes
279 } 269 }
280 } 270 }
281 271
282 private bool m_GenerateAssemblyInfoFile = false; 272 private bool m_GenerateAssemblyInfoFile = false;
283 273
284 /// <summary> 274 /// <summary>
285 /// 275 ///
286 /// </summary> 276 /// </summary>
287 public bool GenerateAssemblyInfoFile 277 public bool GenerateAssemblyInfoFile
288 { 278 {
289 get 279 get
290 { 280 {
291 return m_GenerateAssemblyInfoFile; 281 return m_GenerateAssemblyInfoFile;
292 } 282 }
293 set 283 set
294 { 284 {
295 m_GenerateAssemblyInfoFile = value; 285 m_GenerateAssemblyInfoFile = value;
296 } 286 }
297 } 287 }
298 288
299 /// <summary> 289 /// <summary>
300 /// Gets the startup object. 290 /// Gets the startup object.
@@ -324,7 +314,7 @@ namespace Prebuild.Core.Nodes
324 /// Gets the configurations. 314 /// Gets the configurations.
325 /// </summary> 315 /// </summary>
326 /// <value>The configurations.</value> 316 /// <value>The configurations.</value>
327 public IList Configurations 317 public ICollection Configurations
328 { 318 {
329 get 319 get
330 { 320 {
@@ -350,11 +340,11 @@ namespace Prebuild.Core.Nodes
350 /// Gets the reference paths. 340 /// Gets the reference paths.
351 /// </summary> 341 /// </summary>
352 /// <value>The reference paths.</value> 342 /// <value>The reference paths.</value>
353 public List<ReferencePathNode> ReferencePaths 343 public ArrayList ReferencePaths
354 { 344 {
355 get 345 get
356 { 346 {
357 List<ReferencePathNode> tmp = new List<ReferencePathNode>(m_ReferencePaths); 347 ArrayList tmp = new ArrayList(m_ReferencePaths);
358 tmp.Sort(); 348 tmp.Sort();
359 return tmp; 349 return tmp;
360 } 350 }
@@ -364,11 +354,11 @@ namespace Prebuild.Core.Nodes
364 /// Gets the references. 354 /// Gets the references.
365 /// </summary> 355 /// </summary>
366 /// <value>The references.</value> 356 /// <value>The references.</value>
367 public List<ReferenceNode> References 357 public ArrayList References
368 { 358 {
369 get 359 get
370 { 360 {
371 List<ReferenceNode> tmp = new List<ReferenceNode>(m_References); 361 ArrayList tmp = new ArrayList(m_References);
372 tmp.Sort(); 362 tmp.Sort();
373 return tmp; 363 return tmp;
374 } 364 }
@@ -378,7 +368,7 @@ namespace Prebuild.Core.Nodes
378 /// Gets the Authors list. 368 /// Gets the Authors list.
379 /// </summary> 369 /// </summary>
380 /// <value>The list of the project's authors.</value> 370 /// <value>The list of the project's authors.</value>
381 public List<AuthorNode> Authors 371 public ArrayList Authors
382 { 372 {
383 get 373 get
384 { 374 {
@@ -434,15 +424,7 @@ namespace Prebuild.Core.Nodes
434 } 424 }
435 } 425 }
436 426
437 public string DebugStartParameters 427 #endregion
438 {
439 get
440 {
441 return m_DebugStartParameters;
442 }
443 }
444
445 #endregion
446 428
447 #region Private Methods 429 #region Private Methods
448 430
@@ -488,18 +470,13 @@ namespace Prebuild.Core.Nodes
488 m_Language = Helper.AttributeValue(node, "language", m_Language); 470 m_Language = Helper.AttributeValue(node, "language", m_Language);
489 m_Type = (ProjectType)Helper.EnumAttributeValue(node, "type", typeof(ProjectType), m_Type); 471 m_Type = (ProjectType)Helper.EnumAttributeValue(node, "type", typeof(ProjectType), m_Type);
490 m_Runtime = (ClrRuntime)Helper.EnumAttributeValue(node, "runtime", typeof(ClrRuntime), m_Runtime); 472 m_Runtime = (ClrRuntime)Helper.EnumAttributeValue(node, "runtime", typeof(ClrRuntime), m_Runtime);
491 m_Framework = (FrameworkVersion)Helper.EnumAttributeValue(node, "frameworkVersion", typeof(FrameworkVersion), m_Framework);
492 m_StartupObject = Helper.AttributeValue(node, "startupObject", m_StartupObject); 473 m_StartupObject = Helper.AttributeValue(node, "startupObject", m_StartupObject);
493 m_RootNamespace = Helper.AttributeValue(node, "rootNamespace", m_RootNamespace); 474 m_RootNamespace = Helper.AttributeValue(node, "rootNamespace", m_RootNamespace);
494 475 m_GenerateAssemblyInfoFile = Helper.ParseBoolean(node, "generateAssemblyInfoFile", false);
476
495 int hash = m_Name.GetHashCode(); 477 int hash = m_Name.GetHashCode();
496 Guid guidByHash = new Guid(hash, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); 478 m_Guid = new Guid(hash, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
497 string guid = Helper.AttributeValue(node, "guid", guidByHash.ToString());
498 m_Guid = new Guid(guid);
499 479
500 m_GenerateAssemblyInfoFile = Helper.ParseBoolean(node, "generateAssemblyInfoFile", false);
501 m_DebugStartParameters = Helper.AttributeValue(node, "debugStartParameters", string.Empty);
502
503 if(m_AssemblyName == null || m_AssemblyName.Length < 1) 480 if(m_AssemblyName == null || m_AssemblyName.Length < 1)
504 { 481 {
505 m_AssemblyName = m_Name; 482 m_AssemblyName = m_Name;
@@ -539,15 +516,15 @@ namespace Prebuild.Core.Nodes
539 } 516 }
540 else if(dataNode is ReferencePathNode) 517 else if(dataNode is ReferencePathNode)
541 { 518 {
542 m_ReferencePaths.Add((ReferencePathNode)dataNode); 519 m_ReferencePaths.Add(dataNode);
543 } 520 }
544 else if(dataNode is ReferenceNode) 521 else if(dataNode is ReferenceNode)
545 { 522 {
546 m_References.Add((ReferenceNode)dataNode); 523 m_References.Add(dataNode);
547 } 524 }
548 else if(dataNode is AuthorNode) 525 else if(dataNode is AuthorNode)
549 { 526 {
550 m_Authors.Add((AuthorNode)dataNode); 527 m_Authors.Add(dataNode);
551 } 528 }
552 else if(dataNode is FilesNode) 529 else if(dataNode is FilesNode)
553 { 530 {
@@ -571,6 +548,6 @@ namespace Prebuild.Core.Nodes
571 return this.m_Name.CompareTo(that.m_Name); 548 return this.m_Name.CompareTo(that.m_Name);
572 } 549 }
573 550
574 #endregion 551 #endregion
575 } 552 }
576} 553}