[Monodevelop-patches-list] r2151 - trunk/MonoDevelop/Core/src/AddIns/BackendBindings/CSharpBinding

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Mon Jan 24 18:29:20 EST 2005


Author: lluis
Date: 2005-01-24 18:29:20 -0500 (Mon, 24 Jan 2005)
New Revision: 2151

Modified:
   trunk/MonoDevelop/Core/src/AddIns/BackendBindings/CSharpBinding/CSharpBindingCompilerManager.cs
   trunk/MonoDevelop/Core/src/AddIns/BackendBindings/CSharpBinding/CSharpLanguageBinding.cs
   trunk/MonoDevelop/Core/src/AddIns/BackendBindings/CSharpBinding/ChangeLog
Log:
2005-01-24  Lluis Sanchez Gual  <lluis at novell.com>

	* CSharpLanguageBinding.cs: 
	* CSharpBindingCompilerManager.cs: Use the new progress monitor API.
	


Modified: trunk/MonoDevelop/Core/src/AddIns/BackendBindings/CSharpBinding/CSharpBindingCompilerManager.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/BackendBindings/CSharpBinding/CSharpBindingCompilerManager.cs	2005-01-24 23:29:00 UTC (rev 2150)
+++ trunk/MonoDevelop/Core/src/AddIns/BackendBindings/CSharpBinding/CSharpBindingCompilerManager.cs	2005-01-24 23:29:20 UTC (rev 2151)
@@ -34,7 +34,7 @@
 			return Path.GetExtension(fileName).ToUpper() == ".CS";
 		}
 
-		public ICompilerResult Compile (ProjectFileCollection projectFiles, ProjectReferenceCollection references, DotNetProjectConfiguration configuration)
+		public ICompilerResult Compile (ProjectFileCollection projectFiles, ProjectReferenceCollection references, DotNetProjectConfiguration configuration, IProgressMonitor monitor)
 		{
 			CSharpCompilerParameters compilerparameters = (CSharpCompilerParameters) configuration.CompilationParameters;
 			if (compilerparameters == null) compilerparameters = new CSharpCompilerParameters ();
@@ -46,7 +46,6 @@
 			if (compilerparameters.CsharpCompiler == CsharpCompiler.Csc) {
 				writer.WriteLine("\"/out:" + exe + '"');
 				
-				IProjectService projectService = (IProjectService)MonoDevelop.Core.Services.ServiceManager.GetService(typeof(IProjectService));
 				ArrayList pkg_references = new ArrayList ();
 				
 				if (references != null) {
@@ -141,7 +140,6 @@
 				}
 				
 				writer.WriteLine("--wlevel " + compilerparameters.WarningLevel);
-				IProjectService projectService = (IProjectService)MonoDevelop.Core.Services.ServiceManager.GetService(typeof(IProjectService));
 		
 				if (references != null) {		
 					foreach (ProjectReference lib in references) {
@@ -191,6 +189,9 @@
 			DoCompilation(outstr, tf, ref output, ref error);
 			
 			ICompilerResult result = ParseOutput(tf, output, error);
+			if (result.CompilerOutput.Trim () != "")
+				monitor.Log.WriteLine (result.CompilerOutput);
+			
 			File.Delete(responseFileName);
 			File.Delete(output);
 			File.Delete(error);
@@ -520,39 +521,9 @@
 			Process p = new Process();
 			p.StartInfo = si;
 			p.Start();
-			//FIXME: The glib.idle stuff is here because this *SHOULD* be
-			//a background thread calling back to the main thread.
-			//GLib.Idle.Add (new GLib.IdleHandler (setmsg));
-			setmsg ();
-			while (!p.HasExited) {
-				//GLib.Idle.Add (new GLib.IdleHandler (pulse));
-				pulse ();
-				System.Threading.Thread.Sleep (100);
-			}
-			//GLib.Idle.Add (new GLib.IdleHandler (done));
-			done ();
+			p.WaitForExit ();
 		}
 
-		bool setmsg ()
-		{
-			Runtime.Gui.StatusBar.SetMessage ("Compiling...");
-			return false;
-		}
-
-		bool done ()
-		{
-			Runtime.Gui.StatusBar.ProgressMonitor.Done ();
-			return false;
-		}
-
-		bool pulse () 
-		{
-			Runtime.Gui.StatusBar.ProgressMonitor.Pulse ();
-			while (Gtk.Application.EventsPending ())
-				Gtk.Application.RunIteration ();
-			return false;
-		}
-		
 		// Snatched from our codedom code :-).
 		static Regex regexError = new Regex (@"^(\s*(?<file>.*)\((?<line>\d*)(,(?<column>\d*))?\)\s+)*(?<level>\w+)\s*(?<number>.*):\s(?<message>.*)",
 			RegexOptions.Compiled | RegexOptions.ExplicitCapture);

Modified: trunk/MonoDevelop/Core/src/AddIns/BackendBindings/CSharpBinding/CSharpLanguageBinding.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/BackendBindings/CSharpBinding/CSharpLanguageBinding.cs	2005-01-24 23:29:00 UTC (rev 2150)
+++ trunk/MonoDevelop/Core/src/AddIns/BackendBindings/CSharpBinding/CSharpLanguageBinding.cs	2005-01-24 23:29:20 UTC (rev 2151)
@@ -45,10 +45,10 @@
 			return compilerManager.CanCompile(fileName);
 		}
 		
-		public ICompilerResult Compile (ProjectFileCollection projectFiles, ProjectReferenceCollection references, DotNetProjectConfiguration configuration)
+		public ICompilerResult Compile (ProjectFileCollection projectFiles, ProjectReferenceCollection references, DotNetProjectConfiguration configuration, IProgressMonitor monitor)
 		{
 			Debug.Assert(compilerManager != null);
-			return compilerManager.Compile (projectFiles, references, configuration);
+			return compilerManager.Compile (projectFiles, references, configuration, monitor);
 		}
 		
 		public void GenerateMakefile (Project project, Combine parentCombine)

Modified: trunk/MonoDevelop/Core/src/AddIns/BackendBindings/CSharpBinding/ChangeLog
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/BackendBindings/CSharpBinding/ChangeLog	2005-01-24 23:29:00 UTC (rev 2150)
+++ trunk/MonoDevelop/Core/src/AddIns/BackendBindings/CSharpBinding/ChangeLog	2005-01-24 23:29:20 UTC (rev 2151)
@@ -1,3 +1,8 @@
+2005-01-24  Lluis Sanchez Gual  <lluis at novell.com>
+
+	* CSharpLanguageBinding.cs: 
+	* CSharpBindingCompilerManager.cs: Use the new progress monitor API.
+	
 2005-01-11  Lluis Sanchez Gual  <lluis at novell.com>
 
 	* CSharpLanguageBinding.cs: 




More information about the Monodevelop-patches-list mailing list