[Monodevelop-patches-list] r2370 - trunk/MonoDevelop/Core/src/AddIns/prj2make-sharp-lib

Francisco T. Martinez <martinf@mfconsulting.com> paco at mono-cvs.ximian.com
Fri Mar 18 07:43:12 EST 2005


Author: paco
Date: 2005-03-18 07:43:11 -0500 (Fri, 18 Mar 2005)
New Revision: 2370

Modified:
   trunk/MonoDevelop/Core/src/AddIns/prj2make-sharp-lib/MdPrjHelper.cs
   trunk/MonoDevelop/Core/src/AddIns/prj2make-sharp-lib/MsPrjHelper.cs
Log:
Mono 2.0 has been commented out until further notice.
Gtk# 2.0 is searched first for a match otherwise it goes to Gtk# 1.0
Added Gecko# 2.0 (0.7) is searched first for a match otherwise it goes
to Gecko# 1.0 (0.6)

I also included the changes inside the patch in
http://bugzilla.ximian.com/show_bug.cgi?id=73705.



Modified: trunk/MonoDevelop/Core/src/AddIns/prj2make-sharp-lib/MdPrjHelper.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/prj2make-sharp-lib/MdPrjHelper.cs	2005-03-17 19:51:49 UTC (rev 2369)
+++ trunk/MonoDevelop/Core/src/AddIns/prj2make-sharp-lib/MdPrjHelper.cs	2005-03-18 12:43:11 UTC (rev 2370)
@@ -136,6 +136,7 @@
     			slash = "\\";
     		}
     
+    		string origDir = Directory.GetCurrentDirectory();
     		try
     		{
     			string d = Path.GetDirectoryName(slnFile);
@@ -361,6 +362,10 @@
     			Console.WriteLine("EXCEPTION: {0}\n", e);
     			return "";
     		}
+    		finally
+    		{
+    			Directory.SetCurrentDirectory(origDir);
+    		}
     		
    			return MakefileBuilder.ToString();
     	}

Modified: trunk/MonoDevelop/Core/src/AddIns/prj2make-sharp-lib/MsPrjHelper.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/prj2make-sharp-lib/MsPrjHelper.cs	2005-03-17 19:51:49 UTC (rev 2369)
+++ trunk/MonoDevelop/Core/src/AddIns/prj2make-sharp-lib/MsPrjHelper.cs	2005-03-18 12:43:11 UTC (rev 2370)
@@ -187,7 +187,8 @@
 			{
 				slash = "\\";
 			}
-    
+    		
+    		string origDir = Directory.GetCurrentDirectory();
 			try
 			{
 				string d = Path.GetDirectoryName(slnFile);
@@ -432,6 +433,10 @@
 				Console.WriteLine("EXCEPTION: {0}\n", e);
 				return "";
 			}
+			finally
+			{
+				Directory.SetCurrentDirectory(origDir);
+			}
 		}
 		
 		public void CreatePrjxFromCsproj(string csprojFileName)
@@ -511,6 +516,7 @@
 			
 			Console.WriteLine(String.Format("Will create combine filename:{0}", cmbxFileName));
 
+			string origDir = Directory.GetCurrentDirectory();
 			try
 			{
 				string d = Path.GetDirectoryName(slnFileName);
@@ -615,6 +621,10 @@
 				Console.WriteLine("EXCEPTION: {0}\n", e);
 				return;
 			}
+			finally
+			{
+				Directory.SetCurrentDirectory(origDir);
+			}
 		}
 
 		protected MonoDevelop.Prj2Make.Schema.Prjx.Reference[] GetReferences(MonoDevelop.Prj2Make.Schema.Csproj.Reference[] References)
@@ -627,14 +637,26 @@
 					MonoDevelop.Prj2Make.PkgConfigInvoker.GetPkgVariableValue("mono", "libdir").TrimEnd(),
 					"mono/1.0");
 
-			string strBasePathMono2_0 = Path.Combine(
-					MonoDevelop.Prj2Make.PkgConfigInvoker.GetPkgVariableValue("mono", "libdir").TrimEnd(),
-					"mono/2.0");
-
+//			string strBasePathMono2_0 = Path.Combine(
+//					MonoDevelop.Prj2Make.PkgConfigInvoker.GetPkgVariableValue("mono", "libdir").TrimEnd(),
+//					"mono/2.0");
+//
 			string strBasePathGtkSharp = Path.Combine(
-					MonoDevelop.Prj2Make.PkgConfigInvoker.GetPkgVariableValue("mono", "libdir").TrimEnd(),
+					MonoDevelop.Prj2Make.PkgConfigInvoker.GetPkgVariableValue("gtk-sharp", "libdir").TrimEnd(),
 					"mono/gtk-sharp");
 
+			string strBasePathGtkSharp2_0 = Path.Combine(
+					MonoDevelop.Prj2Make.PkgConfigInvoker.GetPkgVariableValue("gtk-sharp-2.0", "libdir").TrimEnd(),
+					"mono/gtk-sharp-2.0");
+
+			string strBasePathGeckoSharp = Path.Combine(
+					MonoDevelop.Prj2Make.PkgConfigInvoker.GetPkgVariableValue("gecko-sharp", "libdir").TrimEnd(),
+					"mono/gecko-sharp");
+
+			string strBasePathGeckoSharp2_0 = Path.Combine(
+					MonoDevelop.Prj2Make.PkgConfigInvoker.GetPkgVariableValue("gecko-sharp-2.0", "libdir").TrimEnd(),
+					"mono/gecko-sharp-2.0");
+
 			if(References != null && References.Length > 0)
 			{
 				theReferences = new MonoDevelop.Prj2Make.Schema.Prjx.Reference[References.Length];
@@ -650,7 +672,7 @@
 				MonoDevelop.Prj2Make.Schema.Prjx.Reference rfOut = new MonoDevelop.Prj2Make.Schema.Prjx.Reference();
 				string strRefFileName;
 
-				if(rf.Package == null || rf.Package.CompareTo("") == 0)
+				if(rf.Package == null || rf.Package.Length == 0)
 				{
 					bool bIsWhereExpected = false;
 
@@ -667,15 +689,20 @@
 								rfOut.type = MonoDevelop.Prj2Make.Schema.Prjx.ReferenceType.Gac;
 								rfOut.localcopy = MonoDevelop.Prj2Make.Schema.Prjx.ReferenceLocalcopy.True;
 								bIsWhereExpected = true;
+								// increment the iterator value
+								theReferences[i++] = rfOut;
+								continue;
 							} catch (Exception exc) {
 								Console.WriteLine ("Error doing Assembly.LoadFrom with File: {0}\nErr Msg: {1}",
 									strRefFileName,
 									exc.Message );
 							}
 						}
+					} else {					
+						//////////////////////////
+						// Check on Mono 1.0
+						strRefFileName = Path.Combine (strBasePathMono1_0, Path.GetFileName(rf.HintPath));
 
-						strRefFileName = Path.Combine (strBasePathMono2_0, Path.GetFileName("System.Xml.dll"));
-
 						// Test to see if file exist in GAC location
 						if(System.IO.File.Exists(strRefFileName) == true) {
 							try {
@@ -683,15 +710,19 @@
 								rfOut.type = MonoDevelop.Prj2Make.Schema.Prjx.ReferenceType.Gac;
 								rfOut.localcopy = MonoDevelop.Prj2Make.Schema.Prjx.ReferenceLocalcopy.True;
 								bIsWhereExpected = true;
+								// increment the iterator value
+								theReferences[i++] = rfOut;
+								continue;
 							} catch (Exception exc) {
 								Console.WriteLine ("Error doing Assembly.LoadFrom with File: {0}\nErr Msg: {1}",
 									strRefFileName,
 									exc.Message );
 							}
 						}
-					} else {
-						strRefFileName = Path.Combine (strBasePathMono1_0, Path.GetFileName(rf.HintPath));
 
+						//////////////////////////
+						// Check on Gtk# 2.0
+						strRefFileName = Path.Combine (strBasePathGtkSharp2_0, Path.GetFileName(rf.HintPath));
 
 						// Test to see if file exist in GAC location
 						if(System.IO.File.Exists(strRefFileName) == true) {
@@ -700,6 +731,9 @@
 								rfOut.type = MonoDevelop.Prj2Make.Schema.Prjx.ReferenceType.Gac;
 								rfOut.localcopy = MonoDevelop.Prj2Make.Schema.Prjx.ReferenceLocalcopy.True;
 								bIsWhereExpected = true;
+								// increment the iterator value
+								theReferences[i++] = rfOut;
+								continue;
 							} catch (Exception exc) {
 								Console.WriteLine ("Error doing Assembly.LoadFrom with File: {0}\nErr Msg: {1}",
 									strRefFileName,
@@ -707,7 +741,9 @@
 							}
 						}
 
-						strRefFileName = Path.Combine (strBasePathMono2_0, Path.GetFileName(rf.HintPath));
+						//////////////////////////
+						// Check on Gtk# 1.0
+						strRefFileName = Path.Combine (strBasePathGtkSharp, Path.GetFileName(rf.HintPath));
 
 						// Test to see if file exist in GAC location
 						if(System.IO.File.Exists(strRefFileName) == true) {
@@ -716,15 +752,41 @@
 								rfOut.type = MonoDevelop.Prj2Make.Schema.Prjx.ReferenceType.Gac;
 								rfOut.localcopy = MonoDevelop.Prj2Make.Schema.Prjx.ReferenceLocalcopy.True;
 								bIsWhereExpected = true;
+								// increment the iterator value
+								theReferences[i++] = rfOut;
+								continue;
 							} catch (Exception exc) {
 								Console.WriteLine ("Error doing Assembly.LoadFrom with File: {0}\nErr Msg: {1}",
 									strRefFileName,
 									exc.Message );
 							}
 						}
+						
+						//////////////////////////
+						// Check on Gecko# 2.0
+						strRefFileName = Path.Combine (strBasePathGeckoSharp2_0, Path.GetFileName(rf.HintPath));
 
-						strRefFileName = Path.Combine (strBasePathGtkSharp, Path.GetFileName(rf.HintPath));
+						// Test to see if file exist in GAC location
+						if(System.IO.File.Exists(strRefFileName) == true) {
+							try {
+								rfOut.refto = System.Reflection.Assembly.LoadFrom(strRefFileName).FullName;
+								rfOut.type = MonoDevelop.Prj2Make.Schema.Prjx.ReferenceType.Gac;
+								rfOut.localcopy = MonoDevelop.Prj2Make.Schema.Prjx.ReferenceLocalcopy.True;
+								bIsWhereExpected = true;
+								// increment the iterator value
+								theReferences[i++] = rfOut;
+								continue;
+							} catch (Exception exc) {
+								Console.WriteLine ("Error doing Assembly.LoadFrom with File: {0}\nErr Msg: {1}",
+									strRefFileName,
+									exc.Message );
+							}
+						}
 
+						//////////////////////////
+						// Check on Gecko# 1.0
+						strRefFileName = Path.Combine (strBasePathGeckoSharp, Path.GetFileName(rf.HintPath));
+
 						// Test to see if file exist in GAC location
 						if(System.IO.File.Exists(strRefFileName) == true) {
 							try {
@@ -732,6 +794,9 @@
 								rfOut.type = MonoDevelop.Prj2Make.Schema.Prjx.ReferenceType.Gac;
 								rfOut.localcopy = MonoDevelop.Prj2Make.Schema.Prjx.ReferenceLocalcopy.True;
 								bIsWhereExpected = true;
+								// increment the iterator value
+								theReferences[i++] = rfOut;
+								continue;
 							} catch (Exception exc) {
 								Console.WriteLine ("Error doing Assembly.LoadFrom with File: {0}\nErr Msg: {1}",
 									strRefFileName,
@@ -744,11 +809,11 @@
 							rfOut.refto = Path.GetFileName(rf.HintPath);
 							rfOut.type = MonoDevelop.Prj2Make.Schema.Prjx.ReferenceType.Gac;
 							rfOut.localcopy = MonoDevelop.Prj2Make.Schema.Prjx.ReferenceLocalcopy.True;
+							// increment the iterator value
+							theReferences[i++] = rfOut;
+							continue;
 						}
 					}
-
-					// increment the iterator value
-					theReferences[i++] = rfOut;
 				}
 				else
 				{
@@ -864,7 +929,7 @@
 			ExecutionObj.consolepause = "True";
 
 			// OutputObj member population
-			OutputObj.directory = ConfigBlock.OutputPath;
+			OutputObj.directory = ConfigBlock.OutputPath.Replace("\\", "/");
 			OutputObj.assembly = AssemblyName;
 			OutputObj.executeScript = "";
 			OutputObj.executeBeforeBuild = "";




More information about the Monodevelop-patches-list mailing list