[Monodevelop-patches-list] r1708 - trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Tue Jun 8 01:15:12 EDT 2004


Author: jluke
Date: 2004-06-08 01:15:12 -0400 (Tue, 08 Jun 2004)
New Revision: 1708

Modified:
   trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/ChangeLog
   trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/JavaBindingCompilerServices.cs
Log:
begin fixing java stuff


Modified: trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/ChangeLog
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/ChangeLog	2004-06-08 05:12:24 UTC (rev 1707)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/ChangeLog	2004-06-08 05:15:12 UTC (rev 1708)
@@ -1,3 +1,8 @@
+2004-06-08  John Luke  <jluke at cfl.rr.com>
+
+	* JavaBindingCompilerService.cs: rework so Process.Start works
+	for the compiler, for a normal error message
+
 2004-05-25  Todd Berman  <tberman at sevenl.net>
 
 	* JavaLanguageBinding.cs: signature change for GenerateMakefile.

Modified: trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/JavaBindingCompilerServices.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/JavaBindingCompilerServices.cs	2004-06-08 05:12:24 UTC (rev 1707)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/JavaBindingCompilerServices.cs	2004-06-08 05:15:12 UTC (rev 1708)
@@ -49,11 +49,12 @@
 			options += " -encoding utf8 ";
 			
 			TempFileCollection  tf = new TempFileCollection();					
-			
-			string outstr = "javac \"" + filename + "\" -classpath " + cparam.ClassPath + options;
+			// FIXME
+			string compiler = "javac";
+			string args = filename + " -classpath " + cparam.ClassPath + options;
 			//Executor.ExecWaitWithCapture(outstr, tf, ref error , ref output);
 			StreamReader output, error;
-			DoCompilation (outstr, tf, out output, out error);
+			DoCompilation (compiler, args, tf, out output, out error);
 			ICompilerResult cr = ParseOutput (tf, error);
 			
 			return cr;	
@@ -74,6 +75,16 @@
 			string exe         = fileUtilityService.GetDirectoryNameWithSeparator(compilerparameters.OutputDirectory) + compilerparameters.OutputAssembly + ".class";
 			return exe;
 		}
+
+		string GetCompilerName (JavaCompilerParameters cp)
+		{
+			if (cp.Compiler == JavaCompiler.Gcj)
+			{
+				return "gcj"; // compile to bytecode
+			}
+
+			return "javac";
+		}
 		
 		public ICompilerResult CompileProject(IProject project)
 		{
@@ -82,6 +93,8 @@
 			
 			string exe         = fileUtilityService.GetDirectoryNameWithSeparator(compilerparameters.OutputDirectory) + compilerparameters.OutputAssembly + ".class";
 			string options   = "";
+
+			string compiler = GetCompilerName (compilerparameters);
 			
 			if (compilerparameters.Debugmode) 
 				options += " -g ";
@@ -117,50 +130,40 @@
 			}
 
 			TempFileCollection  tf = new TempFileCollection ();			
+			string args = "";
 			
+			if (compilerparameters.Compiler == JavaCompiler.Gcj)
+				args = "-C ";
 
 			string outdir = " -d " + compilerparameters.OutputDirectory;
-			string compiler;
-
-			if (compilerparameters.Compiler == JavaCompiler.Gcj)
-			{
-				compiler = "gcj -C"; // compile to bytecode
-			}
-			else
-			{
-				compiler = "javac";
-			}
-
-			string outstr;
+			
 			//FIXME re-enable options
 			//FIXME re-enable compilerPath
 			if (compilerparameters.ClassPath == "") {
-				outstr = compiler + files + outdir;			
+				args += files + outdir;			
 			} else {
-				outstr = compiler + " -classpath " + compilerparameters.ClassPath + files + outdir;
+				args += " -classpath " + compilerparameters.ClassPath + files + outdir;
 			}
-			Console.WriteLine (outstr);
+			Console.WriteLine (args);
 
 			StreamReader output;
 			StreamReader error;
-			DoCompilation (outstr, tf, out output, out error);
+			DoCompilation (compiler, args, tf, out output, out error);
 			//Executor.ExecWaitWithCapture(outstr, tf, ref error , ref output);			
 			ICompilerResult cr = ParseOutput (tf, error);			
 			
 			return cr;
 		}
 
-		private void DoCompilation (string outstr, TempFileCollection tf, out StreamReader output, out StreamReader error)
+		private void DoCompilation (string compiler, string args, TempFileCollection tf, out StreamReader output, out StreamReader error)
 		{
-            string arguments = outstr;
-            string command = arguments;
-            ProcessStartInfo si = new ProcessStartInfo (command);
+            		ProcessStartInfo si = new ProcessStartInfo (compiler, args);
 			si.RedirectStandardOutput = true;
-            si.RedirectStandardError = true;
+            		si.RedirectStandardError = true;
 			si.UseShellExecute = false;
 			Process p = new Process ();
-            p.StartInfo = si;
-            p.Start ();
+           		p.StartInfo = si;
+            		p.Start ();
 
 			IStatusBarService sbs = (IStatusBarService)ServiceManager.Services.GetService (typeof (IStatusBarService));
 			sbs.SetMessage ("Compiling...");
@@ -178,7 +181,7 @@
 			// and then return cr at end 
 			output = p.StandardOutput;
 			error = p.StandardError;
-            p.WaitForExit ();
+            		p.WaitForExit ();
         }
 		
 		ICompilerResult ParseOutput(TempFileCollection tf, StreamReader errorStream)




More information about the Monodevelop-patches-list mailing list