aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Prebuild/src/Core/Nodes/ConfigurationNode.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Prebuild/src/Core/Nodes/ConfigurationNode.cs')
-rw-r--r--Prebuild/src/Core/Nodes/ConfigurationNode.cs49
1 files changed, 48 insertions, 1 deletions
diff --git a/Prebuild/src/Core/Nodes/ConfigurationNode.cs b/Prebuild/src/Core/Nodes/ConfigurationNode.cs
index 67d78d5..cd2f740 100644
--- a/Prebuild/src/Core/Nodes/ConfigurationNode.cs
+++ b/Prebuild/src/Core/Nodes/ConfigurationNode.cs
@@ -41,6 +41,7 @@ namespace Prebuild.Core.Nodes
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 OptionsNode m_Options; 45 private OptionsNode m_Options;
45 46
46 #endregion 47 #endregion
@@ -84,6 +85,33 @@ namespace Prebuild.Core.Nodes
84 } 85 }
85 86
86 /// <summary> 87 /// <summary>
88 /// Identifies the platform for this specific configuration.
89 /// </summary>
90 public string Platform
91 {
92 get
93 {
94 return m_Platform;
95 }
96 set
97 {
98 switch ((value + "").ToLower())
99 {
100 case "x86":
101 case "x64":
102 m_Platform = value;
103 break;
104 case "itanium":
105 m_Platform = "Itanium";
106 break;
107 default:
108 m_Platform = "AnyCPU";
109 break;
110 }
111 }
112 }
113
114 /// <summary>
87 /// Gets the name. 115 /// Gets the name.
88 /// </summary> 116 /// </summary>
89 /// <value>The name.</value> 117 /// <value>The name.</value>
@@ -96,6 +124,22 @@ namespace Prebuild.Core.Nodes
96 } 124 }
97 125
98 /// <summary> 126 /// <summary>
127 /// Gets the name and platform for the configuration.
128 /// </summary>
129 /// <value>The name and platform.</value>
130 public string NameAndPlatform
131 {
132 get
133 {
134 string platform = m_Platform;
135 if (platform == "AnyCPU")
136 platform = "Any CPU";
137
138 return String.Format("{0}|{1}", m_Name, platform);
139 }
140 }
141
142 /// <summary>
99 /// Gets or sets the options. 143 /// Gets or sets the options.
100 /// </summary> 144 /// </summary>
101 /// <value>The options.</value> 145 /// <value>The options.</value>
@@ -122,7 +166,9 @@ namespace Prebuild.Core.Nodes
122 public override void Parse(XmlNode node) 166 public override void Parse(XmlNode node)
123 { 167 {
124 m_Name = Helper.AttributeValue(node, "name", m_Name); 168 m_Name = Helper.AttributeValue(node, "name", m_Name);
125 if( node == null ) 169 Platform = Helper.AttributeValue(node, "platform", m_Platform);
170
171 if (node == null)
126 { 172 {
127 throw new ArgumentNullException("node"); 173 throw new ArgumentNullException("node");
128 } 174 }
@@ -159,6 +205,7 @@ namespace Prebuild.Core.Nodes
159 { 205 {
160 ConfigurationNode ret = new ConfigurationNode(); 206 ConfigurationNode ret = new ConfigurationNode();
161 ret.m_Name = m_Name; 207 ret.m_Name = m_Name;
208 ret.m_Platform = m_Platform;
162 m_Options.CopyTo(ret.m_Options); 209 m_Options.CopyTo(ret.m_Options);
163 return ret; 210 return ret;
164 } 211 }