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

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Thu Dec 9 19:57:58 EST 2004


Author: tberman
Date: 2004-12-09 19:57:58 -0500 (Thu, 09 Dec 2004)
New Revision: 2066

Modified:
   trunk/MonoDevelop/Core/src/AddIns/BackendBindings/CSharpBinding/CSharpBindingCompilerManager.cs
   trunk/MonoDevelop/Core/src/AddIns/BackendBindings/CSharpBinding/ChangeLog
Log:
2004-12-09  Todd Berman  <tberman at off.net>

	* CSharpBindingCompilerManager.cs: mcs in Mono 1.1.3 now outputs error
	on stderr instead of stdout. The old code just inspected stdout, now
	we look at both.



Modified: trunk/MonoDevelop/Core/src/AddIns/BackendBindings/CSharpBinding/CSharpBindingCompilerManager.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/BackendBindings/CSharpBinding/CSharpBindingCompilerManager.cs	2004-12-09 19:01:16 UTC (rev 2065)
+++ trunk/MonoDevelop/Core/src/AddIns/BackendBindings/CSharpBinding/CSharpBindingCompilerManager.cs	2004-12-10 00:57:58 UTC (rev 2066)
@@ -121,7 +121,7 @@
 			string outstr =  compilerName + " @" +responseFileName;
 			Executor.ExecWaitWithCapture(outstr, tf, ref output, ref error);
 			
-			ICompilerResult result = ParseOutput(tf, output);
+			ICompilerResult result = ParseOutput(tf, output, error);
 			
 			File.Delete(responseFileName);
 			File.Delete(output);
@@ -291,7 +291,7 @@
 			//Executor.ExecWaitWithCapture(outstr,  tf, ref output, ref error);
 			DoCompilation(outstr, tf, ref output, ref error);
 			
-			ICompilerResult result = ParseOutput(tf, output);
+			ICompilerResult result = ParseOutput(tf, output, error);
 			project.CopyReferencesToOutputPath(false);
 			File.Delete(responseFileName);
 			File.Delete(output);
@@ -575,39 +575,37 @@
 			
 		}
 		
-		ICompilerResult ParseOutput(TempFileCollection tf, string file)
+		ICompilerResult ParseOutput(TempFileCollection tf, string stdout, string stderr)
 		{
 			StringBuilder compilerOutput = new StringBuilder();
 			
-			StreamReader sr = File.OpenText(file);
-			
-			// skip fist whitespace line
-			//sr.ReadLine();
-			
 			CompilerResults cr = new CompilerResults(tf);
 			
 			// we have 2 formats for the error output the csc gives :
 			Regex normalError  = new Regex(@"(?<file>.*)\((?<line>\d+),(?<column>\d+)\):\s+(?<error>\w+)\s+(?<number>[\d\w]+):\s+(?<message>.*)", RegexOptions.Compiled);
 			Regex generalError = new Regex(@"(?<error>.+)\s+(?<number>[\d\w]+):\s+(?<message>.*)", RegexOptions.Compiled);
 			
-			while (true) {
-				string curLine = sr.ReadLine();
-				compilerOutput.Append(curLine);
-				compilerOutput.Append('\n');
-				if (curLine == null) {
-					break;
-				}
-				curLine = curLine.Trim();
-				if (curLine.Length == 0) {
-					continue;
-				}
+			foreach (string s in new string[] { stdout, stderr }) {
+				StreamReader sr = File.OpenText (s);
+				while (true) {
+					string curLine = sr.ReadLine();
+					compilerOutput.Append(curLine);
+					compilerOutput.Append('\n');
+					if (curLine == null) {
+						break;
+					}
+					curLine = curLine.Trim();
+					if (curLine.Length == 0) {
+						continue;
+					}
 				
-				CompilerError error = CreateErrorFromString (curLine);
-				
-				if (error != null)
-					cr.Errors.Add (error);
+					CompilerError error = CreateErrorFromString (curLine);
+					
+					if (error != null)
+						cr.Errors.Add (error);
+				}
+				sr.Close();
 			}
-			sr.Close();
 			return new DefaultCompilerResult(cr, compilerOutput.ToString());
 		}
 		
@@ -660,6 +658,7 @@
 		// 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);
+		
 		private static CompilerError CreateErrorFromString(string error_string)
 		{
 			// When IncludeDebugInformation is true, prevents the debug symbols stats from braeking this.

Modified: trunk/MonoDevelop/Core/src/AddIns/BackendBindings/CSharpBinding/ChangeLog
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/BackendBindings/CSharpBinding/ChangeLog	2004-12-09 19:01:16 UTC (rev 2065)
+++ trunk/MonoDevelop/Core/src/AddIns/BackendBindings/CSharpBinding/ChangeLog	2004-12-10 00:57:58 UTC (rev 2066)
@@ -1,3 +1,9 @@
+2004-12-09  Todd Berman  <tberman at off.net>
+
+	* CSharpBindingCompilerManager.cs: mcs in Mono 1.1.3 now outputs error
+	on stderr instead of stdout. The old code just inspected stdout, now
+	we look at both.
+
 2004-12-08  Everaldo Canuto  <everaldo_canuto at yahoo.com.br>
 
 	* CSharpBindingCompilerManager.cs: Add support to multiple compilers




More information about the Monodevelop-patches-list mailing list