[Monodevelop-patches-list] r1428 - 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 9 19:13:13 EDT 2004
Author: jluke
Date: 2004-04-09 19:13:13 -0400 (Fri, 09 Apr 2004)
New Revision: 1428
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/Project/JavaCompilerParameters.cs
Log:
update and fix some things
Modified: trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/ChangeLog
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/ChangeLog 2004-04-09 23:07:20 UTC (rev 1427)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/ChangeLog 2004-04-09 23:13:13 UTC (rev 1428)
@@ -1,10 +1,14 @@
2004-04-09 John Luke <jluke at cfl.rr.com>
- * JavaBindingCompilerService.cs: account for classpath when compiling
- * Gui/ProjectConfigurationPropertyPanel.cs: rough port, needs major HIG love
+ * JavaBindingCompilerService.cs: account for classpath when compiling,
+ work with gcj or javac, cleanup old code
+ * Gui/ProjectConfigurationPropertyPanel.cs: rough port, needs major HIG love,
+ cleanup, add RadioButtons to select from gcj and javac
* JavaBindingExecutionService.cs: use ikvm instead of java runtime
* Parser/*: make a copy of the CSharpBinding/Parser in case I am crazy enough
to port the parser to work with Java (not built yet)
+ * Project/JavaCompilerParameters.cs: add javac/gcj .Compiler property,
+ fix CompilerPath from being hardcoded
2004-03-25 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-09 23:07:20 UTC (rev 1427)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/Gui/ProjectConfigurationPropertyPanel.cs 2004-04-09 23:13:13 UTC (rev 1428)
@@ -21,26 +21,28 @@
{
public class ProjectConfigurationPropertyPanel : AbstractOptionPanel
{
- private Label label4;
- private Label label5;
- private Label titleLabel;
- private Entry outputAssembly;
+ private Label label4 = new Label ();
+ private Label label5 = new Label ();
+ private Label titleLabel = new Label ();
+ private Label label6 = new Label ();
+ private Label label7 = new Label ();
+ private Label label8 = new Label ();
- private Entry textBox3;
private Button button1;
private CheckButton checkBox3;
private CheckButton checkBox5;
private CheckButton checkBox6;
private CheckButton checkBox7;
-
- private Label label6;
- private Label label7;
- private Label label8;
- private Entry textBox5; //Compiler Path
- private Entry textBox6; //Classpath
- private Entry textBox7; //MainClass
+ private RadioButton javac = new RadioButton ("javac");
+ private RadioButton gcj;
+
+ 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;
@@ -50,16 +52,20 @@
if (message == DialogMessage.OK) {
if (compilerParameters == null)
return true;
+ if (javac.Active)
+ compilerParameters.Compiler = "javac";
+ else
+ compilerParameters.Compiler = "gcj";
compilerParameters.GenWarnings = checkBox7.Active;
compilerParameters.Deprecation = checkBox6.Active;
compilerParameters.Debugmode = checkBox5.Active;
compilerParameters.Optimize = checkBox3.Active;
compilerParameters.OutputAssembly = outputAssembly.Text;
- compilerParameters.OutputDirectory = textBox3.Text;
+ compilerParameters.OutputDirectory = outputDirectory.Text;
- compilerParameters.CompilerPath = textBox5.Text;
- compilerParameters.ClassPath = textBox6.Text;
- compilerParameters.MainClass = textBox7.Text;
+ compilerParameters.CompilerPath = compilerPath.Text;
+ compilerParameters.ClassPath = classPath.Text;
+ compilerParameters.MainClass = mainClass.Text;
}
return true;
}
@@ -68,16 +74,20 @@
{
this.compilerParameters = (JavaCompilerParameters)((IProperties)CustomizationObject).GetProperty("Config");
+ if (compilerParameters.Compiler == "javac")
+ javac.Active = true;
+ else
+ gcj.Active = true;
checkBox3.Active = compilerParameters.Optimize;
checkBox5.Active = compilerParameters.Debugmode;
checkBox6.Active = compilerParameters.Deprecation;
checkBox7.Active = compilerParameters.GenWarnings;
outputAssembly.Text = compilerParameters.OutputAssembly;
- textBox3.Text = compilerParameters.OutputDirectory;
+ outputDirectory.Text = compilerParameters.OutputDirectory;
- textBox5.Text = compilerParameters.CompilerPath;
- textBox6.Text = compilerParameters.ClassPath;
- textBox7.Text = compilerParameters.MainClass;
+ compilerPath.Text = compilerParameters.CompilerPath;
+ classPath.Text = compilerParameters.ClassPath;
+ mainClass.Text = compilerParameters.MainClass;
}
void SelectFolder(object sender, EventArgs e)
@@ -98,11 +108,15 @@
vbox.PackStart (titleLabel);
vbox.PackStart (outputAssembly);
vbox.PackStart (label6);
- vbox.PackStart (textBox5);
+ HBox comps = new HBox ();
+ comps.PackStart (javac);
+ comps.PackStart (gcj);
+ vbox.PackStart (comps);
+ vbox.PackStart (compilerPath);
vbox.PackStart (label7);
- vbox.PackStart (textBox6);
+ vbox.PackStart (classPath);
vbox.PackStart (label8);
- vbox.PackStart (textBox7);
+ vbox.PackStart (mainClass);
vbox.PackStart (label4);
HBox hbox = new HBox ();
hbox.PackStart (checkBox5);
@@ -110,38 +124,39 @@
hbox.PackStart (checkBox3);
vbox.PackStart (hbox);
vbox.PackStart (label5);
- vbox.PackStart (textBox3);
+ vbox.PackStart (outputDirectory);
this.Add (vbox);
CustomizationObjectChanged += new EventHandler (SetValues);
}
+
+ void OnCompilerToggled (object o, EventArgs args)
+ {
+ if (javac.Active)
+ compilerPath.Text = "javac";
+ else
+ compilerPath.Text = "gcj";
+ }
private void InitializeComponent()
{
+ gcj = new RadioButton (javac, "gcj");
+ 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);
- this.textBox3 = new Entry ();
- this.label5 = new Label ();
label5.Markup = String.Format ("<b>{0}</b>", GettextCatalog.GetString ("Output path"));
- this.titleLabel = new Label ();
this.outputAssembly = new Entry ();
titleLabel.Markup = String.Format ("<b>{0}</b>", GettextCatalog.GetString ("Output Assembly"));
- this.label4 = new Label ();
label4.Markup = String.Format ("<b>{0}</b>", GettextCatalog.GetString ("Warnings and Errors"));
this.checkBox7 = new CheckButton (GettextCatalog.GetString ("Generate Warnings"));
- this.textBox5 = new Entry ();
- this.textBox6 = new Entry ();
- this.textBox7 = new Entry ();
-
- this.label6 = new Label ();
- label6.Markup = String.Format ("<b>{0}</b>", GettextCatalog.GetString ("Compiler path"));
- this.label7 = new Label ();
+ label6.Markup = String.Format ("<b>{0}</b>", GettextCatalog.GetString ("Compiler"));
label7.Markup = String.Format ("<b>{0}</b>", GettextCatalog.GetString ("Classpath"));
- this.label8 = new Label ();
label8.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-09 23:07:20 UTC (rev 1427)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/JavaBindingCompilerServices.cs 2004-04-09 23:13:13 UTC (rev 1428)
@@ -120,19 +120,20 @@
TempFileCollection tf = new TempFileCollection ();
- //string CurrentDir = Directory.GetCurrentDirectory();
- //Directory.SetCurrentDirectory(compilerparameters.OutputDirectory);
-
- //string outstr = compilerparameters.CompilerPath + "" + files + " -classpath " + compilerparameters.ClassPath + options;
- //string outstr = compilerparameters.CompilerPath + "" + files + " -classpath " + compilerparameters.ClassPath + options;
+ string compiler = compilerparameters.Compiler;
+ if (compiler == "gcj")
+ compiler = "gcj -C"; // compile to bytecode
+
// 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 = compilerparameters.CompilerPath + files + options;
+ outstr = compiler + files;
} else {
- outstr = compilerparameters.CompilerPath + " -classpath " + compilerparameters.ClassPath + files + options;
+ outstr = compiler + " -classpath " + compilerparameters.ClassPath + files;
}
DoCompilation (outstr, tf, ref output, ref error);
//Executor.ExecWaitWithCapture(outstr, tf, ref error , ref output);
@@ -140,18 +141,6 @@
File.Delete(output);
File.Delete(error);
- //Directory.SetCurrentDirectory(CurrentDir);
-
-// TempFileCollection tf = new TempFileCollection ();
-// string output = "";
-// string error = "";
-// //string outstr = compilerparameters.CompilerPath + " " + compilerparameters.OutputDirectory+"untitled.java -classpath " + compilerparameters.ClassPath + options;
-// string outstr = compilerparameters.CompilerPath + " " + compilerparameters.OutputDirectory + finfo.Name;
-// Executor.ExecWaitWithCapture(outstr, tf, ref error , ref output);
-// CompilerResults cr = ParseOutput(tf, output);
-// File.Delete(output);
-// File.Delete(error);
-
return cr;
}
Modified: trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/JavaBindingExecutionServices.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/JavaBindingExecutionServices.cs 2004-04-09 23:07:20 UTC (rev 1427)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/JavaBindingExecutionServices.cs 2004-04-09 23:13:13 UTC (rev 1428)
@@ -47,7 +47,8 @@
string CurrentDir = Directory.GetCurrentDirectory();
Directory.SetCurrentDirectory (parameters.OutputDirectory);
- ProcessStartInfo psi = new ProcessStartInfo("xterm -e \"ikvm -classpath " + parameters.ClassPath + " " + mainClass + ";read -p 'press any key to continue...' -n1\"");
+ string javaExec = "xterm -e \"ikvm -classpath " + parameters.ClassPath + " " + mainClass + ";read -p 'press any key to continue...' -n1\"";
+ ProcessStartInfo psi = new ProcessStartInfo(javaExec);
try {
psi.WorkingDirectory = Path.GetDirectoryName (directory);
Modified: trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/Project/JavaCompilerParameters.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/Project/JavaCompilerParameters.cs 2004-04-09 23:07:20 UTC (rev 1427)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/JavaBinding/Project/JavaCompilerParameters.cs 2004-04-09 23:13:13 UTC (rev 1428)
@@ -39,6 +39,9 @@
[XmlAttribute("classpath")]
public string classpath = String.Empty;
+ [XmlAttribute ("compiler")]
+ public string compiler = "javac";
+
[XmlAttribute("compilerpath")]
public string compilerpath = "javac";
@@ -57,12 +60,6 @@
Execution execution = new Execution();
- public override string OutputDirectory {
- get {
- return base.OutputDirectory.Substring (0, base.OutputDirectory.Length - 4);
- }
- }
-
public bool GenWarnings {
get {
return codeGeneration.genwarnings;
@@ -80,12 +77,19 @@
codeGeneration.classpath = value;
}
}
+
+ public string Compiler {
+ get {
+ return codeGeneration.compiler;
+ }
+ set {
+ codeGeneration.compiler = value;
+ }
+ }
public string CompilerPath {
get {
- //return codeGeneration.compilerpath;
- //FIXME
- return "javac";
+ return codeGeneration.compilerpath;
}
set {
codeGeneration.compilerpath = value;
More information about the Monodevelop-patches-list
mailing list