From ffc1428dff8e71952b43001a8fc6223daeeb5bcf Mon Sep 17 00:00:00 2001
From: lbsa71
Date: Thu, 20 Dec 2007 11:30:56 +0000
Subject: * Added prototypical VS2008 target

---
 Prebuild/src/Core/Targets/SharpDevelop2Target.cs | 35 ++++----------
 Prebuild/src/Core/Targets/VS2005Target.cs        | 47 ++++++++++---------
 Prebuild/src/Core/Targets/VS2008Target.cs        | 58 ++++++++++++++++++++++++
 3 files changed, 89 insertions(+), 51 deletions(-)
 create mode 100644 Prebuild/src/Core/Targets/VS2008Target.cs

(limited to 'Prebuild/src')

diff --git a/Prebuild/src/Core/Targets/SharpDevelop2Target.cs b/Prebuild/src/Core/Targets/SharpDevelop2Target.cs
index 7109ceb..6b0552e 100644
--- a/Prebuild/src/Core/Targets/SharpDevelop2Target.cs
+++ b/Prebuild/src/Core/Targets/SharpDevelop2Target.cs
@@ -44,35 +44,16 @@ namespace Prebuild.Core.Targets
 	[Target("sharpdev2")]
 	public class SharpDevelop2Target : VS2005Target
 	{
-		#region Private Methods
-		private void SetSharpDevelop2()
-		{
-			this.VersionName = "SharpDevelop2";
-		}
-		#endregion
+        protected override string VersionName
+        {
+            get
+            {
+                return "SharpDevelop2";
+            }
+        }
 
 		#region Public Methods
-
-		/// <summary>
-		/// Writes the specified kern.
-		/// </summary>
-		/// <param name="kern">The kern.</param>
-		public override void Write(Kernel kern)
-		{
-			SetSharpDevelop2();
-			base.Write(kern);
-		}
-
-		/// <summary>
-		/// Cleans the specified kern.
-		/// </summary>
-		/// <param name="kern">The kern.</param>
-		public override void Clean(Kernel kern)
-		{
-			SetSharpDevelop2();
-			base.Clean(kern);
-		}
-
+	
 		/// <summary>
 		/// Gets the name.
 		/// </summary>
diff --git a/Prebuild/src/Core/Targets/VS2005Target.cs b/Prebuild/src/Core/Targets/VS2005Target.cs
index f01906b..bd56beb 100644
--- a/Prebuild/src/Core/Targets/VS2005Target.cs
+++ b/Prebuild/src/Core/Targets/VS2005Target.cs
@@ -230,45 +230,48 @@ namespace Prebuild.Core.Targets
 
         #region Fields
 
-        string solutionVersion = "9.00";
-        string productVersion = "8.0.50727";
         string schemaVersion = "2.0";
-        string versionName = "Visual C# 2005";
         VSVersion version = VSVersion.VS80;
 
         Hashtable tools;
         Kernel kernel;
+        
+        protected virtual string ToolsVersionXml
+        {
+            get
+            {
+                return String.Empty;
+            }
+        }
 
-        /// <summary>
+        protected virtual string SolutionTag
+        {
+            get { return "# Visual Studio 2005"; }
+        }
+
+            /// <summary>
         /// Gets or sets the solution version.
         /// </summary>
         /// <value>The solution version.</value>
-        protected string SolutionVersion
+        protected virtual string SolutionVersion
         {
             get
             {
-                return this.solutionVersion;
-            }
-            set
-            {
-                this.solutionVersion = value;
+                return "9.00";
             }
         }
         /// <summary>
         /// Gets or sets the product version.
         /// </summary>
         /// <value>The product version.</value>
-        protected string ProductVersion
+        protected virtual string ProductVersion
         {
             get
             {
-                return this.productVersion;
-            }
-            set
-            {
-                this.productVersion = value;
+                return "8.0.50727";
             }
         }
+
         /// <summary>
         /// Gets or sets the schema version.
         /// </summary>
@@ -288,15 +291,11 @@ namespace Prebuild.Core.Targets
         /// Gets or sets the name of the version.
         /// </summary>
         /// <value>The name of the version.</value>
-        protected string VersionName
+        protected virtual string VersionName
         {
             get
             {
-                return this.versionName;
-            }
-            set
-            {
-                this.versionName = value;
+                return "Visual C# 2005";
             }
         }
         /// <summary>
@@ -378,7 +377,7 @@ namespace Prebuild.Core.Targets
             #region Project File
             using (ps)
             {
-                ps.WriteLine("<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">");
+                ps.WriteLine("<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\"{0}>", ToolsVersionXml );
                 //ps.WriteLine("  <{0}", toolInfo.XMLTag);
                 ps.WriteLine("  <PropertyGroup>");
                 ps.WriteLine("    <ProjectType>Local</ProjectType>");
@@ -707,7 +706,7 @@ namespace Prebuild.Core.Targets
             using (ss)
             {
                 ss.WriteLine("Microsoft Visual Studio Solution File, Format Version {0}", this.SolutionVersion);
-                ss.WriteLine("# Visual Studio 2005");
+                ss.WriteLine(SolutionTag);
                 foreach (ProjectNode project in solution.Projects)
                 {
                     if (!tools.ContainsKey(project.Language))
diff --git a/Prebuild/src/Core/Targets/VS2008Target.cs b/Prebuild/src/Core/Targets/VS2008Target.cs
new file mode 100644
index 0000000..6074915
--- /dev/null
+++ b/Prebuild/src/Core/Targets/VS2008Target.cs
@@ -0,0 +1,58 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Prebuild.Core.Attributes;
+
+namespace Prebuild.Core.Targets
+{
+    [Target("vs2008")]
+    public class VS2008Target : VS2005Target
+    {
+        protected override string SolutionTag
+        {
+            get { return "# Visual Studio 2008"; }
+        }
+
+        protected override string SolutionVersion
+        {
+            get
+            {
+                return "10.00";
+            }
+        }
+
+        protected override string VersionName
+        {
+            get
+            {
+                return "Visual C# 2008";
+            }
+        }
+
+        protected override string ToolsVersionXml
+        {
+            get
+            {
+                return " ToolsVersion=\"3.5\"";
+            }
+        }
+
+
+        // TODO: This needs updating!
+        protected override string ProductVersion
+        {
+            get
+            {
+                return "9.0.20706";
+            }
+        }
+
+        public override string Name
+        {
+            get
+            {
+                return "vs2008";
+            }
+        }
+    }
+}
-- 
cgit v1.1