[Monodevelop-patches-list] r1473 - in trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding: . Gui Project
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Fri Apr 16 21:05:59 EDT 2004
Author: jluke
Date: 2004-04-16 21:05:58 -0400 (Fri, 16 Apr 2004)
New Revision: 1473
Added:
trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/JavaCompiler.cs
trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/JavaRuntime.cs
Modified:
trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/ChangeLog
trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/Gui/ProjectConfigurationPropertyPanel.cs
trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/JavaBindingCompilerServices.cs
trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/JavaBindingExecutionServices.cs
trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/Makefile.am
trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/Project/JavaCompilerParameters.cs
Log:
fix some things
Modified: trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/ChangeLog
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/ChangeLog 2004-04-16 23:05:37 UTC (rev 1472)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/ChangeLog 2004-04-17 01:05:58 UTC (rev 1473)
@@ -4,6 +4,12 @@
rework error parsing to work off of Streams instead of temp files
allows javac errors to work, gcj maybe not
set the column of the error
+ specify the output directory
+ * Project/JavaCompilerOptions: add runtime prop
+ * JavaBindingExecutionService.cs: add prelim support
+ for choosing runtime
+ * JavaCompiler.cs:
+ * JavaRuntime.cs: add enums for compiler and runtime
2004-04-09 John Luke <jluke at cfl.rr.com>
Modified: trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/Gui/ProjectConfigurationPropertyPanel.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/Gui/ProjectConfigurationPropertyPanel.cs 2004-04-16 23:05:37 UTC (rev 1472)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/Gui/ProjectConfigurationPropertyPanel.cs 2004-04-17 01:05:58 UTC (rev 1473)
@@ -21,30 +21,36 @@
{
public class ProjectConfigurationPropertyPanel : AbstractOptionPanel
{
- private Label label4 = new Label ();
- private Label label5 = new Label ();
+ private Label runtimeLabel = new Label ();
+ private Label labelWarnings = new Label ();
+ private Label labelOutput = new Label ();
private Label titleLabel = new Label ();
- private Label label6 = new Label ();
- private Label label7 = new Label ();
- private Label label8 = new Label ();
+ private Label labelCompiler = new Label ();
+ private Label labelClasspath = new Label ();
+ private Label labelMainClass = new Label ();
- private Button button1;
+ private Button browseButton;
- private CheckButton checkBox3;
- private CheckButton checkBox5;
- private CheckButton checkBox6;
- private CheckButton checkBox7;
+ private CheckButton checkDebug = new CheckButton (GettextCatalog.GetString ("Enable debug"));
+ private CheckButton checkDeprecation = new CheckButton (GettextCatalog.GetString ("Deprecated"));
+ private CheckButton checkOptimize = new CheckButton (GettextCatalog.GetString ("Enable optimizations"));
+ private CheckButton checkWarnings = new CheckButton (GettextCatalog.GetString ("Generate Warnings"));
+ // compiler chooser
private RadioButton javac = new RadioButton ("javac");
private RadioButton gcj;
+ // runtime chooser
+ private RadioButton ikvm = new RadioButton ("ikvm");
+ private RadioButton mono;
+ private RadioButton java;
+
private Entry outputAssembly = new Entry ();
private Entry outputDirectory = new Entry ();
private Entry compilerPath = new Entry ();
private Entry classPath = new Entry ();
private Entry mainClass = new Entry ();
- ResourceService resourceService = (ResourceService) ServiceManager.Services.GetService (typeof (IResourceService));
JavaCompilerParameters compilerParameters = null;
public override bool ReceiveDialogMessage(DialogMessage message)
@@ -52,14 +58,23 @@
if (message == DialogMessage.OK) {
if (compilerParameters == null)
return true;
+
if (javac.Active)
- compilerParameters.Compiler = "javac";
+ compilerParameters.Compiler = JavaCompiler.Javac;
else
- compilerParameters.Compiler = "gcj";
- compilerParameters.GenWarnings = checkBox7.Active;
- compilerParameters.Deprecation = checkBox6.Active;
- compilerParameters.Debugmode = checkBox5.Active;
- compilerParameters.Optimize = checkBox3.Active;
+ compilerParameters.Compiler = JavaCompiler.Gcj;
+
+ if (ikvm.Active)
+ compilerParameters.Runtime = JavaRuntime.Ikvm;
+ else if (mono.Active)
+ compilerParameters.Runtime = JavaRuntime.Mono;
+ else
+ compilerParameters.Runtime = JavaRuntime.Java;
+
+ compilerParameters.GenWarnings = checkWarnings.Active;
+ compilerParameters.Deprecation = checkDeprecation.Active;
+ compilerParameters.Debugmode = checkDebug.Active;
+ compilerParameters.Optimize = checkOptimize.Active;
compilerParameters.OutputAssembly = outputAssembly.Text;
compilerParameters.OutputDirectory = outputDirectory.Text;
@@ -74,16 +89,32 @@
{
this.compilerParameters = (JavaCompilerParameters)((IProperties)CustomizationObject).GetProperty("Config");
- if (compilerParameters.Compiler == "javac")
+ if (compilerParameters.Compiler == JavaCompiler.Javac)
javac.Active = true;
else
gcj.Active = true;
- checkBox3.Active = compilerParameters.Optimize;
- checkBox5.Active = compilerParameters.Debugmode;
- checkBox6.Active = compilerParameters.Deprecation;
- checkBox7.Active = compilerParameters.GenWarnings;
+
+ switch (compilerParameters.Runtime) {
+ case JavaRuntime.Ikvm:
+ ikvm.Active = true;
+ break;
+ case JavaRuntime.Mono:
+ mono.Active = true;
+ break;
+ case JavaRuntime.Java:
+ java.Active = true;
+ break;
+ default:
+ ikvm.Active = true;
+ break;
+ }
+
+ checkOptimize.Active = compilerParameters.Optimize;
+ checkDebug.Active = compilerParameters.Debugmode;
+ checkDeprecation.Active = compilerParameters.Deprecation;
+ checkWarnings.Active = compilerParameters.GenWarnings;
outputAssembly.Text = compilerParameters.OutputAssembly;
- outputDirectory.Text = compilerParameters.OutputDirectory;
+ outputDirectory.Text = compilerParameters.OutputDirectory;
compilerPath.Text = compilerParameters.CompilerPath;
classPath.Text = compilerParameters.ClassPath;
@@ -105,25 +136,45 @@
{
InitializeComponent ();
VBox vbox = new VBox ();
- vbox.PackStart (titleLabel);
+ HBox hboxTitle = new HBox ();
+ hboxTitle.PackStart (titleLabel, false, false, 0);
+ vbox.PackStart (hboxTitle);
vbox.PackStart (outputAssembly);
- vbox.PackStart (label6);
+ HBox hboxCompiler = new HBox ();
+ hboxCompiler.PackStart (labelCompiler, false, false, 0);
+ vbox.PackStart (hboxCompiler);
HBox comps = new HBox ();
+ comps.PackStart (gcj);
comps.PackStart (javac);
- comps.PackStart (gcj);
vbox.PackStart (comps);
vbox.PackStart (compilerPath);
- vbox.PackStart (label7);
+ HBox hboxRuntime = new HBox ();
+ hboxRuntime.PackStart (runtimeLabel, false, false, 0);
+ vbox.PackStart (hboxRuntime);
+ HBox runtimes = new HBox ();
+ runtimes.PackStart (ikvm);
+ runtimes.PackStart (mono);
+ runtimes.PackStart (java);
+ vbox.PackStart (runtimes);
+ HBox hboxClasspath = new HBox ();
+ hboxClasspath.PackStart (labelClasspath, false, false, 0);
+ vbox.PackStart (hboxClasspath);
vbox.PackStart (classPath);
- vbox.PackStart (label8);
+ HBox hboxMainClass = new HBox ();
+ hboxMainClass.PackStart (labelMainClass, false, false, 0);
+ vbox.PackStart (hboxMainClass);
vbox.PackStart (mainClass);
- vbox.PackStart (label4);
+ HBox hboxWarnings = new HBox ();
+ hboxWarnings.PackStart (labelWarnings, false, false, 0);
+ vbox.PackStart (hboxWarnings);
HBox hbox = new HBox ();
- hbox.PackStart (checkBox5);
- hbox.PackStart (checkBox6);
- hbox.PackStart (checkBox3);
+ hbox.PackStart (checkDeprecation);
+ hbox.PackStart (checkDebug);
+ hbox.PackStart (checkOptimize);
vbox.PackStart (hbox);
- vbox.PackStart (label5);
+ HBox hboxOutput = new HBox ();
+ hboxOutput.PackStart (labelOutput, false, false, 0);
+ vbox.PackStart (hboxOutput);
vbox.PackStart (outputDirectory);
this.Add (vbox);
CustomizationObjectChanged += new EventHandler (SetValues);
@@ -143,21 +194,23 @@
gcj.Toggled += OnCompilerToggled;
javac.Toggled += OnCompilerToggled;
- this.checkBox6 = new CheckButton (GettextCatalog.GetString ("Deprecation"));
- this.checkBox5 = new CheckButton (GettextCatalog.GetString ("Debug Info"));
- this.checkBox3 = new CheckButton (GettextCatalog.GetString ("Optimize"));
-
- this.button1 = new Button ("...");
- this.button1.Clicked += new EventHandler (SelectFolder);
- label5.Markup = String.Format ("<b>{0}</b>", GettextCatalog.GetString ("Output path"));
+ mono = new RadioButton (ikvm, "mono");
+ mono.Sensitive = false;
+ java = new RadioButton (ikvm, "java");
+ java.Sensitive = false;
+
+ runtimeLabel.Markup = String.Format ("<b>{0}</b>", GettextCatalog.GetString ("Runtime"));
+
+ this.browseButton = new Button ("_Browse");
+ this.browseButton.Clicked += new EventHandler (SelectFolder);
+ labelOutput.Markup = String.Format ("<b>{0}</b>", GettextCatalog.GetString ("Output path"));
this.outputAssembly = new Entry ();
titleLabel.Markup = String.Format ("<b>{0}</b>", GettextCatalog.GetString ("Output Assembly"));
- label4.Markup = String.Format ("<b>{0}</b>", GettextCatalog.GetString ("Warnings and Errors"));
+ labelWarnings.Markup = String.Format ("<b>{0}</b>", GettextCatalog.GetString ("Warnings and Errors"));
- this.checkBox7 = new CheckButton (GettextCatalog.GetString ("Generate Warnings"));
- label6.Markup = String.Format ("<b>{0}</b>", GettextCatalog.GetString ("Compiler"));
- label7.Markup = String.Format ("<b>{0}</b>", GettextCatalog.GetString ("Classpath"));
- label8.Markup = String.Format ("<b>{0}</b>", GettextCatalog.GetString ("Main Class"));
+ labelCompiler.Markup = String.Format ("<b>{0}</b>", GettextCatalog.GetString ("Compiler"));
+ labelClasspath.Markup = String.Format ("<b>{0}</b>", GettextCatalog.GetString ("Classpath"));
+ labelMainClass.Markup = String.Format ("<b>{0}</b>", GettextCatalog.GetString ("Main Class"));
}
}
}
Modified: trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/JavaBindingCompilerServices.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/JavaBindingCompilerServices.cs 2004-04-16 23:05:37 UTC (rev 1472)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/JavaBindingCompilerServices.cs 2004-04-17 01:05:58 UTC (rev 1473)
@@ -119,20 +119,28 @@
TempFileCollection tf = new TempFileCollection ();
- string compiler = compilerparameters.Compiler;
- if (compiler == "gcj")
+ string outdir = " -d " + compilerparameters.OutputDirectory;
+ string compiler;
+
+ if (compilerparameters.Compiler == JavaCompiler.Gcj)
+ {
compiler = "gcj -C"; // compile to bytecode
+ }
+ else
+ {
+ compiler = "javac";
+ }
- // FIXME: maybe just send javac command to vte
- // we don't seem to have task support anyways
string outstr;
//FIXME re-enable options
//FIXME re-enable compilerPath
if (compilerparameters.ClassPath == "") {
- outstr = compiler + files;
+ outstr = compiler + files + outdir;
} else {
- outstr = compiler + " -classpath " + compilerparameters.ClassPath + files;
+ outstr = compiler + " -classpath " + compilerparameters.ClassPath + files + outdir;
}
+ Console.WriteLine (outstr);
+
StreamReader output;
StreamReader error;
DoCompilation (outstr, tf, out output, out error);
Modified: trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/JavaBindingExecutionServices.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/JavaBindingExecutionServices.cs 2004-04-16 23:05:37 UTC (rev 1472)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/JavaBindingExecutionServices.cs 2004-04-17 01:05:58 UTC (rev 1473)
@@ -47,7 +47,25 @@
string CurrentDir = Directory.GetCurrentDirectory();
Directory.SetCurrentDirectory (parameters.OutputDirectory);
- string javaExec = "xterm -e \"ikvm -classpath " + parameters.ClassPath + " " + mainClass + ";read -p 'press any key to continue...' -n1\"";
+
+ string javaExec;
+ switch (parameters.Runtime) {
+ case JavaRuntime.Ikvm:
+ javaExec = "xterm -e \"ikvm -classpath " + parameters.ClassPath + " " + mainClass + ";read -p 'press any key to continue...' -n1\"";
+ break;
+ // FIXME: need to both compile with ikvmc
+ // and then run with mono
+ case JavaRuntime.Mono:
+ javaExec = "xterm -e \"ikvm -classpath " + parameters.ClassPath + " " + mainClass + ";read -p 'press any key to continue...' -n1\"";
+ break;
+ case JavaRuntime.Java:
+ javaExec = "xterm -e \"java -classpath " + parameters.ClassPath + " " + mainClass + ";read -p 'press any key to continue...' -n1\"";
+ break;
+ default:
+ javaExec = "xterm -e \"ikvm -classpath " + parameters.ClassPath + " " + mainClass + ";read -p 'press any key to continue...' -n1\"";
+ break;
+ }
+
ProcessStartInfo psi = new ProcessStartInfo(javaExec);
try {
Added: trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/JavaCompiler.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/JavaCompiler.cs 2004-04-16 23:05:37 UTC (rev 1472)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/JavaCompiler.cs 2004-04-17 01:05:58 UTC (rev 1473)
@@ -0,0 +1,11 @@
+using System;
+
+namespace JavaBinding
+{
+ public enum JavaCompiler
+ {
+ Javac,
+ Gcj,
+ }
+}
+
Added: trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/JavaRuntime.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/JavaRuntime.cs 2004-04-16 23:05:37 UTC (rev 1472)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/JavaRuntime.cs 2004-04-17 01:05:58 UTC (rev 1473)
@@ -0,0 +1,12 @@
+using System;
+
+namespace JavaBinding
+{
+ public enum JavaRuntime
+ {
+ Ikvm, // JIT to CIL and then exec with mono
+ Mono, // compile with ikvmc and then run with mono
+ Java, // an installed JRE
+ }
+}
+
Modified: trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/Makefile.am
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/Makefile.am 2004-04-16 23:05:37 UTC (rev 1472)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/Makefile.am 2004-04-17 01:05:58 UTC (rev 1473)
@@ -13,7 +13,9 @@
./Project/JavaCompilerParameters.cs \
./Project/JavaProject.cs \
./JavaBindingCompilerServices.cs \
+./JavaCompiler.cs \
./JavaLanguageBinding.cs \
+./JavaRuntime.cs \
./FormatingStrategy/JavaFormattingStrategy.cs \
./JavaBindingExecutionServices.cs \
./ProjectTreeBuilder/JavaNodeBuilder.cs
Modified: trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/Project/JavaCompilerParameters.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/Project/JavaCompilerParameters.cs 2004-04-16 23:05:37 UTC (rev 1472)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/Project/JavaCompilerParameters.cs 2004-04-17 01:05:58 UTC (rev 1473)
@@ -40,10 +40,13 @@
public string classpath = String.Empty;
[XmlAttribute ("compiler")]
- public string compiler = "javac";
+ public JavaCompiler compiler = JavaCompiler.Gcj;
+ [XmlAttribute ("runtime")]
+ public JavaRuntime runtime = JavaRuntime.Ikvm;
+
[XmlAttribute("compilerpath")]
- public string compilerpath = "javac";
+ public string compilerpath = "javac";
[XmlAttribute("genwarnings")]
public bool genwarnings = false;
@@ -78,8 +81,17 @@
}
}
- public string Compiler {
+ public JavaRuntime Runtime {
get {
+ return codeGeneration.runtime;
+ }
+ set {
+ codeGeneration.runtime = value;
+ }
+ }
+
+ public JavaCompiler Compiler {
+ get {
return codeGeneration.compiler;
}
set {
More information about the Monodevelop-patches-list
mailing list