[Monodevelop-patches-list] r1672 - in trunk/MonoDevelop: . src/AddIns/prj2make-sharp-lib

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Mon May 31 10:29:12 EDT 2004


Author: paco
Date: 2004-05-31 10:29:12 -0400 (Mon, 31 May 2004)
New Revision: 1672

Modified:
   trunk/MonoDevelop/ChangeLog
   trunk/MonoDevelop/src/AddIns/prj2make-sharp-lib/MsPrjHelper.cs
Log:
Corrected problem trying to compile files marked for "content" in csproj


Modified: trunk/MonoDevelop/ChangeLog
===================================================================
--- trunk/MonoDevelop/ChangeLog	2004-05-31 01:13:26 UTC (rev 1671)
+++ trunk/MonoDevelop/ChangeLog	2004-05-31 14:29:12 UTC (rev 1672)
@@ -1,3 +1,8 @@
+2004-05-31  Francisco "Paco" Martinez <paco at mfcon.com>
+
+	* src/Addin/prj2make-sharp-lib/MsPrjHelper.cs -- corrects problems with the
+	import of items flag as content so it will not try to build those
+
 2004-05-30  Fawad Halim  <fawad at fawad.net>
 	* help/: Imported initial docbook docs skeleton
 	* xmldocs.make,omf.make: Imported supporting omf/docbook files from GNOME CVS

Modified: trunk/MonoDevelop/src/AddIns/prj2make-sharp-lib/MsPrjHelper.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/prj2make-sharp-lib/MsPrjHelper.cs	2004-05-31 01:13:26 UTC (rev 1671)
+++ trunk/MonoDevelop/src/AddIns/prj2make-sharp-lib/MsPrjHelper.cs	2004-05-31 14:29:12 UTC (rev 1672)
@@ -19,6 +19,8 @@
 		private bool m_bIsMcs;
 		private string prjxFileName;
 		private string cmbxFileName;
+		private string m_strSlnVer;
+		private string m_strCsprojVer;
 
 		// Determines if the makefile is intended for nmake or gmake for urposes of path separator character
 		public bool IsUnix
@@ -34,12 +36,18 @@
 			set{ m_bIsMcs = value; }
 		}
 
-		public SlnMaker()
+		public string SlnVersion
 		{
-			m_bIsUnix = false;
-			m_bIsMcs = false;
+			get { return m_strSlnVer; }
+			set { m_strSlnVer = value; }
 		}
-		
+
+		public string CsprojVersion
+		{
+			get { return m_strCsprojVer; }
+			set { m_strCsprojVer = value; }
+		}
+
 		// Shuld contain the file name 
 		// of the most resent prjx generation
 		public string PrjxFileName {
@@ -53,6 +61,52 @@
 		}
 
 
+		// Default constructor
+		public SlnMaker()
+		{
+			m_bIsUnix = false;
+			m_bIsMcs = false;
+		}
+		
+		// Utility function to determine the sln file version
+		protected string GetSlnFileVersion(string strInSlnFile)
+		{
+			string strVersion = null;
+			string strInput = null;
+			Match match;
+			FileStream fis = new FileStream(strInSlnFile, FileMode.Open, FileAccess.Read, FileShare.Read);
+			StreamReader reader = new StreamReader(fis);
+			Regex regex = new Regex(@"Microsoft Visual Studio Solution File, Format Version (\d.\d\d)");
+			
+			strInput = reader.ReadLine();
+
+			match = regex.Match(strInput);
+			if (match.Success)
+			{
+				strVersion = match.Groups[1].Value;
+			}
+			
+			// Close the stream
+			reader.Close();
+
+			// Close the File Stream
+			fis.Close();
+    
+			return strVersion;
+		}
+    	
+		// Utility function to determine the csproj file version
+		protected string GetCsprojFileVersion(string strInCsprojFile)
+		{
+			string strRetVal = null;
+			XmlDocument xmlDoc = new XmlDocument();
+
+			xmlDoc.Load(strInCsprojFile);
+			strRetVal = xmlDoc.SelectSingleNode("/VisualStudioProject/CSHARP/@ProductVersion").Value;
+
+			return strRetVal;
+		}
+
 		protected void ParseMsCsProj(string fname)
 		{
 			string projectName = System.IO.Path.GetFileNameWithoutExtension (fname);
@@ -124,14 +178,20 @@
 				if (d != "")
 					Directory.SetCurrentDirectory(d);
 
-				if (isSln == true) 
+				if (isSln == true) 
 				{
+					// Get the sln file version
+					m_strSlnVer = GetSlnFileVersion(slnFile);
+
 					// We invoke the ParseSolution 
 					// by passing the file obtained
 					ParseSolution (slnFile);
-				} 
-				else 
+				} 
+				else 
 				{
+					// Get the Csproj version
+					m_strCsprojVer = GetCsprojFileVersion(slnFile);
+
 					// We invoke the ParseMsCsProj 
 					// by passing the file obtained 
 					ParseMsCsProj (slnFile);
@@ -607,6 +667,9 @@
 					case MonoDevelop.Prj2Make.Schema.Csproj.FileBuildAction.Compile:
 						flOut.buildaction = MonoDevelop.Prj2Make.Schema.Prjx.FileBuildaction.Compile;
 						break;
+					case MonoDevelop.Prj2Make.Schema.Csproj.FileBuildAction.Content:
+						flOut.buildaction = MonoDevelop.Prj2Make.Schema.Prjx.FileBuildaction.Exclude;
+						break;
 					case MonoDevelop.Prj2Make.Schema.Csproj.FileBuildAction.EmbeddedResource:
 						flOut.buildaction = MonoDevelop.Prj2Make.Schema.Prjx.FileBuildaction.EmbedAsResource;
 						break;




More information about the Monodevelop-patches-list mailing list