mail-archives/monodevelop-patches-list/2004-July/001504.html

2686 строки
93 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Monodevelop-patches-list] r1897 - in trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding: . FormatingStrategy Gui Project ProjectTreeBuilder
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:monodevelop-patches-list%40lists.ximian.com?Subject=%5BMonodevelop-patches-list%5D%20r1897%20-%20in%20trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding%3A%20.%20FormatingStrategy%20Gui%20Project%20ProjectTreeBuilder&In-Reply-To=">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="001503.html">
<LINK REL="Next" HREF="001505.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Monodevelop-patches-list] r1897 - in trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding: . FormatingStrategy Gui Project ProjectTreeBuilder</H1>
<B>commit-watcher at mono-cvs.ximian.com</B>
<A HREF="mailto:monodevelop-patches-list%40lists.ximian.com?Subject=%5BMonodevelop-patches-list%5D%20r1897%20-%20in%20trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding%3A%20.%20FormatingStrategy%20Gui%20Project%20ProjectTreeBuilder&In-Reply-To="
TITLE="[Monodevelop-patches-list] r1897 - in trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding: . FormatingStrategy Gui Project ProjectTreeBuilder">commit-watcher at mono-cvs.ximian.com
</A><BR>
<I>Mon Jul 5 15:05:54 EDT 2004</I>
<P><UL>
<LI>Previous message: <A HREF="001503.html">[Monodevelop-patches-list] r1896 - in trunk/MonoDevelop/Core: . build/AddIns build/AddIns/AddIns/BackendBindings build/AddIns/AddIns/BackendBindings/templates build/AddIns/AddIns/Misc/StartPage build/data/options build/data/resources/css build/data/resources/icons gdldock/gdl gdldock/sources/gdl
</A></li>
<LI>Next message: <A HREF="001505.html">[Monodevelop-patches-list] r1898 - in trunk/MonoDevelop/Core: . src/AddIns/BackendBindings/CSharpBinding src/AddIns/BackendBindings/NemerleBinding src/Libraries/SharpRefactory
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#1504">[ date ]</a>
<a href="thread.html#1504">[ thread ]</a>
<a href="subject.html#1504">[ subject ]</a>
<a href="author.html#1504">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>Author: jluke
Date: 2004-07-05 15:05:54 -0400 (Mon, 05 Jul 2004)
New Revision: 1897
Added:
trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/README
Removed:
trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/JavaRuntime.cs
Modified:
trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/ChangeLog
trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/FormatingStrategy/JavaFormattingStrategy.cs
trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/Gui/ProjectConfigurationPropertyPanel.cs
trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/JavaBindingCompilerServices.cs
trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/JavaBindingExecutionServices.cs
trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/JavaCompiler.cs
trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/JavaLanguageBinding.cs
trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/Makefile.JavaBinding
trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/Makefile.am
trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/Project/JavaCompilerParameters.cs
trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/Project/JavaProject.cs
trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/ProjectTreeBuilder/JavaNodeBuilder.cs
Log:
update
Modified: trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/ChangeLog
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/ChangeLog 2004-07-05 18:40:45 UTC (rev 1896)
+++ trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/ChangeLog 2004-07-05 19:05:54 UTC (rev 1897)
@@ -1,3 +1,14 @@
+2004-07-05 John Luke &lt;<A HREF="http://lists.ximian.com/mailman/listinfo/monodevelop-patches-list">jluke at cfl.rr.com</A>&gt;
+
+ * *.cs: cleanup everything
+ remove single file compile/run
+ remove runtime choices and use ikvmc to produce assemblies
+
+ need to check errors on ikvmc part, I wish there was a better
+ way than screen-scraping to do this.
+
+ convert line endings to unix, not sure why they were dos style
+
2004-06-08 John Luke &lt;<A HREF="http://lists.ximian.com/mailman/listinfo/monodevelop-patches-list">jluke at cfl.rr.com</A>&gt;
* JavaBindingCompilerService.cs: rework so Process.Start works
Modified: trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/FormatingStrategy/JavaFormattingStrategy.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/FormatingStrategy/JavaFormattingStrategy.cs 2004-07-05 18:40:45 UTC (rev 1896)
+++ trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/FormatingStrategy/JavaFormattingStrategy.cs 2004-07-05 19:05:54 UTC (rev 1897)
@@ -1,237 +1,237 @@
-// &lt;file&gt;
-// &lt;copyright see=&quot;<A HREF="prj:///doc/copyright.txt&quot;/">prj:///doc/copyright.txt&quot;/</A>&gt;
-// &lt;license see=&quot;<A HREF="prj:///doc/license.txt&quot;/">prj:///doc/license.txt&quot;/</A>&gt;
-// &lt;owner name=&quot;Mike Kr&#252;ger&quot; email=&quot;<A HREF="http://lists.ximian.com/mailman/listinfo/monodevelop-patches-list">mike at icsharpcode.net</A>&quot;/&gt;
-// &lt;version value=&quot;$version&quot;/&gt;
-// &lt;/file&gt;
-
-using System;
-using System.Collections;
-using System.Diagnostics;
-using System.Drawing;
-using System.Text;
-
-using MonoDevelop.TextEditor;
-using MonoDevelop.TextEditor.Document;
-using MonoDevelop.Core.Properties;
-using MonoDevelop.Core.Services;
-using MonoDevelop.Services;
-using MonoDevelop.EditorBindings.FormattingStrategy;
-
-namespace JavaBinding.FormattingStrategy
-{
- /// &lt;summary&gt;
- /// This class handles the auto and smart indenting in the textbuffer while
- /// you type.
- /// &lt;/summary&gt;
- public class JavaFormattingStrategy : DefaultFormattingStrategy
- {
- public JavaFormattingStrategy()
- {
- }
-
- /// &lt;summary&gt;
- /// Define Java specific smart indenting for a line :)
- /// &lt;/summary&gt;
- protected override int SmartIndentLine(IFormattableDocument d, int lineNr)
- {
- if (lineNr &gt; 0) {
- string lineAboveText = d.GetLineAsString (lineNr - 1);
- string trimlineAboveText = lineAboveText.Trim ();
- string curLineText = d.GetLineAsString (lineNr);
- string trimcurLineText = curLineText.Trim ();
-
- if (lineAboveText.EndsWith(&quot;)&quot;) &amp;&amp; curLineText.StartsWith(&quot;{&quot;)) {
- string indentation = GetIndentation(d, lineNr - 1);
- d.ReplaceLine (lineNr, indentation + curLineText);
- return indentation.Length;
- }
-
- if (curLineText.StartsWith(&quot;}&quot;)) { // indent closing bracket.
- int openLine;
- int closingBracketOffset = d.GetClosingBraceForLine (lineNr, out openLine);
- if (closingBracketOffset == -1) { // no closing bracket found -&gt; autoindent
- return AutoIndentLine(d, lineNr);
- }
-
- string indentation = GetIndentation (d, lineNr - 1);
-
- d.ReplaceLine (lineNr, indentation + curLineText);
- return indentation.Length;
- }
-
- if (lineAboveText.EndsWith(&quot;;&quot;)) { // expression ended, reset to valid indent.
- int openLine;
- int closingBracketOffset = d.GetClosingBraceForLine (lineNr, out openLine);
- if (closingBracketOffset == -1) { // no closing bracket found -&gt; autoindent
- return AutoIndentLine(d, lineNr);
- }
-
- string closingBracketLineText = d.GetLineAsString (openLine).Trim ();
-
- string indentation = GetIndentation (d, openLine);
-
- // special handling for switch statement formatting.
- if (closingBracketLineText.StartsWith(&quot;switch&quot;)) {
- if (lineAboveText.StartsWith(&quot;break;&quot;) ||
- lineAboveText.StartsWith(&quot;goto&quot;) ||
- lineAboveText.StartsWith(&quot;return&quot;)) {
- } else {
- indentation += d.IndentString;
- }
- }
- indentation += d.IndentString;
-
- d.ReplaceLine (lineNr, indentation + curLineText);
- return indentation.Length;
- }
-
- if (lineAboveText.EndsWith(&quot;{&quot;) || // indent opening bracket.
- lineAboveText.EndsWith(&quot;:&quot;) || // indent case xyz:
- (lineAboveText.EndsWith(&quot;)&quot;) &amp;&amp; // indent single line if, for ... etc
- (lineAboveText.StartsWith(&quot;if&quot;) ||
- lineAboveText.StartsWith(&quot;while&quot;) ||
- lineAboveText.StartsWith(&quot;for&quot;))) ||
- lineAboveText.EndsWith(&quot;else&quot;)) {
- string indentation = GetIndentation (d, lineNr - 1) + d.IndentString;
- d.ReplaceLine (lineNr, indentation + curLineText);
- return indentation.Length;
- } else {
- // try to indent linewrap
- ArrayList bracketPos = new ArrayList();
- for (int i = 0; i &lt; lineAboveText.Length; ++i) { // search for a ( bracket that isn't closed
- switch (lineAboveText[i]) {
- case '(':
- bracketPos.Add(i);
- break;
- case ')':
- if (bracketPos.Count &gt; 0) {
- bracketPos.RemoveAt(bracketPos.Count - 1);
- }
- break;
- }
- }
- if (bracketPos.Count &gt; 0) {
- int bracketIndex = (int)bracketPos[bracketPos.Count - 1];
- string indentation = GetIndentation (d, lineNr - 1);
-
- for (int i = 0; i &lt;= bracketIndex; ++i) { // insert enough spaces to match
- indentation += &quot; &quot;; // brace start in the next line
- }
-
- d.ReplaceLine (lineNr, indentation + curLineText);
- return indentation.Length;
- }
- }
- }
- return AutoIndentLine (d, lineNr);
- }
-
- bool NeedCurlyBracket(string text)
- {
- int curlyCounter = 0;
-
- bool inString = false;
- bool inChar = false;
-
- bool lineComment = false;
- bool blockComment = false;
-
- for (int i = 0; i &lt; text.Length; ++i) {
- switch (text[i]) {
- case '\r':
- case '\n':
- lineComment = false;
- break;
- case '/':
- if (blockComment) {
- Debug.Assert(i &gt; 0);
- if (text[i - 1] == '*') {
- blockComment = false;
- }
- }
- if (!inString &amp;&amp; !inChar &amp;&amp; i + 1 &lt; text.Length) {
- if (!blockComment &amp;&amp; text[i + 1] == '/') {
- lineComment = true;
- }
- if (!lineComment &amp;&amp; text[i + 1] == '*') {
- blockComment = true;
- }
- }
- break;
- case '&quot;':
- inString = !inString;
- break;
- case '\'':
- inChar = !inChar;
- break;
- case '{':
- if (!(inString || inChar || lineComment || blockComment)) {
- ++curlyCounter;
- }
- break;
- case '}':
- if (!(inString || inChar || lineComment || blockComment)) {
- --curlyCounter;
- }
- break;
- }
- }
- return curlyCounter &gt; 0;
- }
-
- // used for comment tag formater/inserter
- public override int FormatLine (IFormattableDocument d, int lineNr, int cursorOffset, char ch)
- {
- switch (ch) {
- //case '}':
- //case '{':
- // return d.FormattingStrategy.IndentLine (d, lineNr);
- case '\n':
- if (lineNr &lt;= 0) {
- return IndentLine(d, lineNr);
- }
-
- if (d.AutoInsertCurlyBracket) {
- string oldLineText = d.GetLineAsString (lineNr - 1);
- if (oldLineText.EndsWith (&quot;{&quot;) &amp;&amp; NeedCurlyBracket (d.TextContent)) {
- d.Insert (cursorOffset, &quot;\n}&quot;);
- IndentLine(d, lineNr + 1);
- }
- }
-
- string lineAboveText = d.GetLineAsString (lineNr - 1);
-
-
-#if NON_PORTABLE_CODE
- if (lineAbove.HighlightSpanStack != null &amp;&amp; lineAbove.HighlightSpanStack.Count &gt; 0) {
- if (!((Span)lineAbove.HighlightSpanStack.Peek()).StopEOL) { // case for /* style comments
- int index = lineAboveText.IndexOf(&quot;/*&quot;);
-
- if (index &gt; 0) {
- string indentation = GetIndentation(d, lineNr - 1);
- for (int i = indentation.Length; i &lt; index; ++ i) {
- indentation += ' ';
- }
- d.Document.Replace(curLine.Offset, cursorOffset - curLine.Offset, indentation + &quot; * &quot;);
- return indentation.Length + 3;
- }
-
- index = lineAboveText.IndexOf(&quot;*&quot;);
- if (index &gt; 0) {
- string indentation = GetIndentation(d, lineNr - 1);
- for (int i = indentation.Length; i &lt; index; ++ i) {
- indentation += ' ';
- }
- d.Document.Replace(curLine.Offset, cursorOffset - curLine.Offset, indentation + &quot;* &quot;);
- return indentation.Length + 2;
- }
- }
- }
-#endif
- return IndentLine(d, lineNr);
- }
- return 0;
- }
- }
-}
+// &lt;file&gt;
+// &lt;copyright see=&quot;<A HREF="prj:///doc/copyright.txt&quot;/">prj:///doc/copyright.txt&quot;/</A>&gt;
+// &lt;license see=&quot;<A HREF="prj:///doc/license.txt&quot;/">prj:///doc/license.txt&quot;/</A>&gt;
+// &lt;owner name=&quot;Mike Kr&#252;ger&quot; email=&quot;<A HREF="http://lists.ximian.com/mailman/listinfo/monodevelop-patches-list">mike at icsharpcode.net</A>&quot;/&gt;
+// &lt;version value=&quot;$version&quot;/&gt;
+// &lt;/file&gt;
+
+using System;
+using System.Collections;
+using System.Diagnostics;
+using System.Drawing;
+using System.Text;
+
+using MonoDevelop.TextEditor;
+using MonoDevelop.TextEditor.Document;
+using MonoDevelop.Core.Properties;
+using MonoDevelop.Core.Services;
+using MonoDevelop.Services;
+using MonoDevelop.EditorBindings.FormattingStrategy;
+
+namespace JavaBinding.FormattingStrategy
+{
+ /// &lt;summary&gt;
+ /// This class handles the auto and smart indenting in the textbuffer while
+ /// you type.
+ /// &lt;/summary&gt;
+ public class JavaFormattingStrategy : DefaultFormattingStrategy
+ {
+ public JavaFormattingStrategy()
+ {
+ }
+
+ /// &lt;summary&gt;
+ /// Define Java specific smart indenting for a line :)
+ /// &lt;/summary&gt;
+ protected override int SmartIndentLine(IFormattableDocument d, int lineNr)
+ {
+ if (lineNr &gt; 0) {
+ string lineAboveText = d.GetLineAsString (lineNr - 1);
+ string trimlineAboveText = lineAboveText.Trim ();
+ string curLineText = d.GetLineAsString (lineNr);
+ string trimcurLineText = curLineText.Trim ();
+
+ if (lineAboveText.EndsWith(&quot;)&quot;) &amp;&amp; curLineText.StartsWith(&quot;{&quot;)) {
+ string indentation = GetIndentation(d, lineNr - 1);
+ d.ReplaceLine (lineNr, indentation + curLineText);
+ return indentation.Length;
+ }
+
+ if (curLineText.StartsWith(&quot;}&quot;)) { // indent closing bracket.
+ int openLine;
+ int closingBracketOffset = d.GetClosingBraceForLine (lineNr, out openLine);
+ if (closingBracketOffset == -1) { // no closing bracket found -&gt; autoindent
+ return AutoIndentLine(d, lineNr);
+ }
+
+ string indentation = GetIndentation (d, lineNr - 1);
+
+ d.ReplaceLine (lineNr, indentation + curLineText);
+ return indentation.Length;
+ }
+
+ if (lineAboveText.EndsWith(&quot;;&quot;)) { // expression ended, reset to valid indent.
+ int openLine;
+ int closingBracketOffset = d.GetClosingBraceForLine (lineNr, out openLine);
+ if (closingBracketOffset == -1) { // no closing bracket found -&gt; autoindent
+ return AutoIndentLine(d, lineNr);
+ }
+
+ string closingBracketLineText = d.GetLineAsString (openLine).Trim ();
+
+ string indentation = GetIndentation (d, openLine);
+
+ // special handling for switch statement formatting.
+ if (closingBracketLineText.StartsWith(&quot;switch&quot;)) {
+ if (lineAboveText.StartsWith(&quot;break;&quot;) ||
+ lineAboveText.StartsWith(&quot;goto&quot;) ||
+ lineAboveText.StartsWith(&quot;return&quot;)) {
+ } else {
+ indentation += d.IndentString;
+ }
+ }
+ indentation += d.IndentString;
+
+ d.ReplaceLine (lineNr, indentation + curLineText);
+ return indentation.Length;
+ }
+
+ if (lineAboveText.EndsWith(&quot;{&quot;) || // indent opening bracket.
+ lineAboveText.EndsWith(&quot;:&quot;) || // indent case xyz:
+ (lineAboveText.EndsWith(&quot;)&quot;) &amp;&amp; // indent single line if, for ... etc
+ (lineAboveText.StartsWith(&quot;if&quot;) ||
+ lineAboveText.StartsWith(&quot;while&quot;) ||
+ lineAboveText.StartsWith(&quot;for&quot;))) ||
+ lineAboveText.EndsWith(&quot;else&quot;)) {
+ string indentation = GetIndentation (d, lineNr - 1) + d.IndentString;
+ d.ReplaceLine (lineNr, indentation + curLineText);
+ return indentation.Length;
+ } else {
+ // try to indent linewrap
+ ArrayList bracketPos = new ArrayList();
+ for (int i = 0; i &lt; lineAboveText.Length; ++i) { // search for a ( bracket that isn't closed
+ switch (lineAboveText[i]) {
+ case '(':
+ bracketPos.Add(i);
+ break;
+ case ')':
+ if (bracketPos.Count &gt; 0) {
+ bracketPos.RemoveAt(bracketPos.Count - 1);
+ }
+ break;
+ }
+ }
+ if (bracketPos.Count &gt; 0) {
+ int bracketIndex = (int)bracketPos[bracketPos.Count - 1];
+ string indentation = GetIndentation (d, lineNr - 1);
+
+ for (int i = 0; i &lt;= bracketIndex; ++i) { // insert enough spaces to match
+ indentation += &quot; &quot;; // brace start in the next line
+ }
+
+ d.ReplaceLine (lineNr, indentation + curLineText);
+ return indentation.Length;
+ }
+ }
+ }
+ return AutoIndentLine (d, lineNr);
+ }
+
+ bool NeedCurlyBracket(string text)
+ {
+ int curlyCounter = 0;
+
+ bool inString = false;
+ bool inChar = false;
+
+ bool lineComment = false;
+ bool blockComment = false;
+
+ for (int i = 0; i &lt; text.Length; ++i) {
+ switch (text[i]) {
+ case '\r':
+ case '\n':
+ lineComment = false;
+ break;
+ case '/':
+ if (blockComment) {
+ Debug.Assert(i &gt; 0);
+ if (text[i - 1] == '*') {
+ blockComment = false;
+ }
+ }
+ if (!inString &amp;&amp; !inChar &amp;&amp; i + 1 &lt; text.Length) {
+ if (!blockComment &amp;&amp; text[i + 1] == '/') {
+ lineComment = true;
+ }
+ if (!lineComment &amp;&amp; text[i + 1] == '*') {
+ blockComment = true;
+ }
+ }
+ break;
+ case '&quot;':
+ inString = !inString;
+ break;
+ case '\'':
+ inChar = !inChar;
+ break;
+ case '{':
+ if (!(inString || inChar || lineComment || blockComment)) {
+ ++curlyCounter;
+ }
+ break;
+ case '}':
+ if (!(inString || inChar || lineComment || blockComment)) {
+ --curlyCounter;
+ }
+ break;
+ }
+ }
+ return curlyCounter &gt; 0;
+ }
+
+ // used for comment tag formater/inserter
+ public override int FormatLine (IFormattableDocument d, int lineNr, int cursorOffset, char ch)
+ {
+ switch (ch) {
+ //case '}':
+ //case '{':
+ // return d.FormattingStrategy.IndentLine (d, lineNr);
+ case '\n':
+ if (lineNr &lt;= 0) {
+ return IndentLine(d, lineNr);
+ }
+
+ if (d.AutoInsertCurlyBracket) {
+ string oldLineText = d.GetLineAsString (lineNr - 1);
+ if (oldLineText.EndsWith (&quot;{&quot;) &amp;&amp; NeedCurlyBracket (d.TextContent)) {
+ d.Insert (cursorOffset, &quot;\n}&quot;);
+ IndentLine(d, lineNr + 1);
+ }
+ }
+
+ string lineAboveText = d.GetLineAsString (lineNr - 1);
+
+
+#if NON_PORTABLE_CODE
+ if (lineAbove.HighlightSpanStack != null &amp;&amp; lineAbove.HighlightSpanStack.Count &gt; 0) {
+ if (!((Span)lineAbove.HighlightSpanStack.Peek()).StopEOL) { // case for /* style comments
+ int index = lineAboveText.IndexOf(&quot;/*&quot;);
+
+ if (index &gt; 0) {
+ string indentation = GetIndentation(d, lineNr - 1);
+ for (int i = indentation.Length; i &lt; index; ++ i) {
+ indentation += ' ';
+ }
+ d.Document.Replace(curLine.Offset, cursorOffset - curLine.Offset, indentation + &quot; * &quot;);
+ return indentation.Length + 3;
+ }
+
+ index = lineAboveText.IndexOf(&quot;*&quot;);
+ if (index &gt; 0) {
+ string indentation = GetIndentation(d, lineNr - 1);
+ for (int i = indentation.Length; i &lt; index; ++ i) {
+ indentation += ' ';
+ }
+ d.Document.Replace(curLine.Offset, cursorOffset - curLine.Offset, indentation + &quot;* &quot;);
+ return indentation.Length + 2;
+ }
+ }
+ }
+#endif
+ return IndentLine(d, lineNr);
+ }
+ return 0;
+ }
+ }
+}
Modified: trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/Gui/ProjectConfigurationPropertyPanel.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/Gui/ProjectConfigurationPropertyPanel.cs 2004-07-05 18:40:45 UTC (rev 1896)
+++ trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/Gui/ProjectConfigurationPropertyPanel.cs 2004-07-05 19:05:54 UTC (rev 1897)
@@ -1,224 +1,177 @@
-// &lt;file&gt;
-// &lt;copyright see=&quot;<A HREF="prj:///doc/copyright.txt&quot;/">prj:///doc/copyright.txt&quot;/</A>&gt;
-// &lt;license see=&quot;<A HREF="prj:///doc/license.txt&quot;/">prj:///doc/license.txt&quot;/</A>&gt;
-// &lt;owner name=&quot;Mike Kr&#252;ger&quot; email=&quot;<A HREF="http://lists.ximian.com/mailman/listinfo/monodevelop-patches-list">mike at icsharpcode.net</A>&quot;/&gt;
-// &lt;version value=&quot;$version&quot;/&gt;
-// &lt;/file&gt;
-
-using System;
-using Gtk;
-
-using MonoDevelop.Internal.Project;
-using MonoDevelop.Internal.ExternalTool;
-using MonoDevelop.Gui.Dialogs;
-using MonoDevelop.Gui.Widgets;
-using MonoDevelop.Services;
-using MonoDevelop.Core.Services;
-using MonoDevelop.Core.Properties;
-using MonoDevelop.Core.AddIns.Codons;
-
-namespace JavaBinding
-{
- public class ProjectConfigurationPropertyPanel : AbstractOptionPanel
- {
- private Label runtimeLabel = new Label ();
- private Label labelWarnings = new Label ();
- private Label labelOutput = new Label ();
- private Label titleLabel = new Label ();
- private Label labelCompiler = new Label ();
- private Label labelClasspath = new Label ();
- private Label labelMainClass = new Label ();
-
- private Button browseButton;
-
- private CheckButton checkDebug = new CheckButton (GettextCatalog.GetString (&quot;Enable debug&quot;));
- private CheckButton checkDeprecation = new CheckButton (GettextCatalog.GetString (&quot;Deprecated&quot;));
- private CheckButton checkOptimize = new CheckButton (GettextCatalog.GetString (&quot;Enable optimizations&quot;));
- private CheckButton checkWarnings = new CheckButton (GettextCatalog.GetString (&quot;Generate Warnings&quot;));
-
- // compiler chooser
- private RadioButton javac = new RadioButton (&quot;javac&quot;);
- private RadioButton gcj;
-
- // runtime chooser
- private RadioButton ikvm = new RadioButton (&quot;ikvm&quot;);
- private RadioButton mono;
- private RadioButton java;
- private RadioButton gij;
-
- 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 ();
-
- JavaCompilerParameters compilerParameters = null;
-
- public override bool ReceiveDialogMessage(DialogMessage message)
- {
- if (message == DialogMessage.OK) {
- if (compilerParameters == null)
- return true;
-
- if (javac.Active)
- compilerParameters.Compiler = JavaCompiler.Javac;
- else
- compilerParameters.Compiler = JavaCompiler.Gcj;
-
- if (ikvm.Active)
- compilerParameters.Runtime = JavaRuntime.Ikvm;
- else if (mono.Active)
- compilerParameters.Runtime = JavaRuntime.Mono;
- else if (gij.Active)
- compilerParameters.Runtime = JavaRuntime.Gij;
- 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;
-
- compilerParameters.CompilerPath = compilerPath.Text;
- compilerParameters.ClassPath = classPath.Text;
- compilerParameters.MainClass = mainClass.Text;
- }
- return true;
- }
-
- void SetValues(object sender, EventArgs e)
- {
- this.compilerParameters = (JavaCompilerParameters)((IProperties)CustomizationObject).GetProperty(&quot;Config&quot;);
-
- if (compilerParameters.Compiler == JavaCompiler.Javac)
- javac.Active = true;
- else
- gcj.Active = true;
-
- switch (compilerParameters.Runtime) {
- case JavaRuntime.Ikvm:
- ikvm.Active = true;
- break;
- case JavaRuntime.Mono:
- mono.Active = true;
- break;
- case JavaRuntime.Java:
- java.Active = true;
- break;
- case JavaRuntime.Gij:
- gij.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;
-
- compilerPath.Text = compilerParameters.CompilerPath;
- classPath.Text = compilerParameters.ClassPath;
- mainClass.Text = compilerParameters.MainClass;
- }
-
- void SelectFolder(object sender, EventArgs e)
- {
- using (FolderDialog fdiag = new FolderDialog (GettextCatalog.GetString (&quot;Browse&quot;))) {
-
- if (fdiag.Run () == (int) ResponseType.Ok) {
- //textBox3.Text = fdiag.Path;
- }
- fdiag.Hide ();
- }
- }
-
- public ProjectConfigurationPropertyPanel ()
- {
- InitializeComponent ();
- VBox vbox = new VBox ();
- HBox hboxTitle = new HBox ();
- hboxTitle.PackStart (titleLabel, false, false, 0);
- vbox.PackStart (hboxTitle);
- vbox.PackStart (outputAssembly);
- HBox hboxCompiler = new HBox ();
- hboxCompiler.PackStart (labelCompiler, false, false, 0);
- vbox.PackStart (hboxCompiler);
- HBox comps = new HBox ();
- comps.PackStart (gcj);
- comps.PackStart (javac);
- vbox.PackStart (comps);
- vbox.PackStart (compilerPath);
- 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);
- runtimes.PackStart (gij);
- vbox.PackStart (runtimes);
- HBox hboxClasspath = new HBox ();
- hboxClasspath.PackStart (labelClasspath, false, false, 0);
- vbox.PackStart (hboxClasspath);
- vbox.PackStart (classPath);
- HBox hboxMainClass = new HBox ();
- hboxMainClass.PackStart (labelMainClass, false, false, 0);
- vbox.PackStart (hboxMainClass);
- vbox.PackStart (mainClass);
- HBox hboxWarnings = new HBox ();
- hboxWarnings.PackStart (labelWarnings, false, false, 0);
- vbox.PackStart (hboxWarnings);
- HBox hbox = new HBox ();
- hbox.PackStart (checkDeprecation);
- hbox.PackStart (checkDebug);
- hbox.PackStart (checkOptimize);
- vbox.PackStart (hbox);
- HBox hboxOutput = new HBox ();
- hboxOutput.PackStart (labelOutput, false, false, 0);
- vbox.PackStart (hboxOutput);
- vbox.PackStart (outputDirectory);
- this.Add (vbox);
- CustomizationObjectChanged += new EventHandler (SetValues);
- }
-
- void OnCompilerToggled (object o, EventArgs args)
- {
- if (javac.Active)
- compilerPath.Text = &quot;javac&quot;;
- else
- compilerPath.Text = &quot;gcj&quot;;
- }
-
- private void InitializeComponent()
- {
- gcj = new RadioButton (javac, &quot;gcj&quot;);
- gcj.Toggled += OnCompilerToggled;
- javac.Toggled += OnCompilerToggled;
-
- mono = new RadioButton (ikvm, &quot;mono&quot;);
- mono.Sensitive = false;
- java = new RadioButton (ikvm, &quot;java&quot;);
- //java.Sensitive = false;
- gij = new RadioButton (ikvm, &quot;gij&quot;);
-
- runtimeLabel.Markup = String.Format (&quot;&lt;b&gt;{0}&lt;/b&gt;&quot;, GettextCatalog.GetString (&quot;Runtime&quot;));
-
- this.browseButton = new Button (&quot;_Browse&quot;);
- this.browseButton.Clicked += new EventHandler (SelectFolder);
- labelOutput.Markup = String.Format (&quot;&lt;b&gt;{0}&lt;/b&gt;&quot;, GettextCatalog.GetString (&quot;Output path&quot;));
- this.outputAssembly = new Entry ();
- titleLabel.Markup = String.Format (&quot;&lt;b&gt;{0}&lt;/b&gt;&quot;, GettextCatalog.GetString (&quot;Output Assembly&quot;));
- labelWarnings.Markup = String.Format (&quot;&lt;b&gt;{0}&lt;/b&gt;&quot;, GettextCatalog.GetString (&quot;Warnings and Errors&quot;));
-
- labelCompiler.Markup = String.Format (&quot;&lt;b&gt;{0}&lt;/b&gt;&quot;, GettextCatalog.GetString (&quot;Compiler&quot;));
- labelClasspath.Markup = String.Format (&quot;&lt;b&gt;{0}&lt;/b&gt;&quot;, GettextCatalog.GetString (&quot;Classpath&quot;));
- labelMainClass.Markup = String.Format (&quot;&lt;b&gt;{0}&lt;/b&gt;&quot;, GettextCatalog.GetString (&quot;Main Class&quot;));
- }
- }
-}
+// &lt;file&gt;
+// &lt;copyright see=&quot;<A HREF="prj:///doc/copyright.txt&quot;/">prj:///doc/copyright.txt&quot;/</A>&gt;
+// &lt;license see=&quot;<A HREF="prj:///doc/license.txt&quot;/">prj:///doc/license.txt&quot;/</A>&gt;
+// &lt;owner name=&quot;Mike Kr&#252;ger&quot; email=&quot;<A HREF="http://lists.ximian.com/mailman/listinfo/monodevelop-patches-list">mike at icsharpcode.net</A>&quot;/&gt;
+// &lt;version value=&quot;$version&quot;/&gt;
+// &lt;/file&gt;
+
+using System;
+using Gtk;
+
+using MonoDevelop.Internal.Project;
+using MonoDevelop.Internal.ExternalTool;
+using MonoDevelop.Gui.Dialogs;
+using MonoDevelop.Gui.Widgets;
+using MonoDevelop.Services;
+using MonoDevelop.Core.Services;
+using MonoDevelop.Core.Properties;
+using MonoDevelop.Core.AddIns.Codons;
+
+namespace JavaBinding
+{
+ public class ProjectConfigurationPropertyPanel : AbstractOptionPanel
+ {
+ private Label runtimeLabel = new Label ();
+ private Label labelWarnings = new Label ();
+ private Label labelOutput = new Label ();
+ private Label titleLabel = new Label ();
+ private Label labelCompiler = new Label ();
+ private Label labelClasspath = new Label ();
+ private Label labelMainClass = new Label ();
+
+ private Button browseButton;
+
+ private CheckButton checkDebug = new CheckButton (GettextCatalog.GetString (&quot;Enable debug&quot;));
+ private CheckButton checkDeprecation = new CheckButton (GettextCatalog.GetString (&quot;Deprecated&quot;));
+ private CheckButton checkOptimize = new CheckButton (GettextCatalog.GetString (&quot;Enable optimizations&quot;));
+ private CheckButton checkWarnings = new CheckButton (GettextCatalog.GetString (&quot;Generate Warnings&quot;));
+
+ // compiler chooser
+ private RadioButton javac = new RadioButton (&quot;javac&quot;);
+ 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 ();
+
+ JavaCompilerParameters compilerParameters = null;
+
+ public override bool ReceiveDialogMessage(DialogMessage message)
+ {
+ if (message == DialogMessage.OK) {
+ if (compilerParameters == null)
+ return true;
+
+ if (javac.Active)
+ compilerParameters.Compiler = JavaCompiler.Javac;
+ else
+ compilerParameters.Compiler = JavaCompiler.Gcj;
+
+ compilerParameters.GenWarnings = checkWarnings.Active;
+ compilerParameters.Deprecation = checkDeprecation.Active;
+ compilerParameters.Debugmode = checkDebug.Active;
+ compilerParameters.Optimize = checkOptimize.Active;
+ compilerParameters.OutputAssembly = outputAssembly.Text;
+ compilerParameters.OutputDirectory = outputDirectory.Text;
+
+ compilerParameters.CompilerPath = compilerPath.Text;
+ compilerParameters.ClassPath = classPath.Text;
+ compilerParameters.MainClass = mainClass.Text;
+ }
+ return true;
+ }
+
+ void SetValues(object sender, EventArgs e)
+ {
+ this.compilerParameters = (JavaCompilerParameters)((IProperties)CustomizationObject).GetProperty(&quot;Config&quot;);
+
+ if (compilerParameters.Compiler == JavaCompiler.Javac)
+ javac.Active = true;
+ else
+ gcj.Active = true;
+
+ checkOptimize.Active = compilerParameters.Optimize;
+ checkDebug.Active = compilerParameters.Debugmode;
+ checkDeprecation.Active = compilerParameters.Deprecation;
+ checkWarnings.Active = compilerParameters.GenWarnings;
+ outputAssembly.Text = compilerParameters.OutputAssembly;
+ outputDirectory.Text = compilerParameters.OutputDirectory;
+
+ compilerPath.Text = compilerParameters.CompilerPath;
+ classPath.Text = compilerParameters.ClassPath;
+ mainClass.Text = compilerParameters.MainClass;
+ }
+
+ void SelectFolder(object sender, EventArgs e)
+ {
+ using (FolderDialog fdiag = new FolderDialog (GettextCatalog.GetString (&quot;Browse&quot;))) {
+
+ if (fdiag.Run () == (int) ResponseType.Ok) {
+ //textBox3.Text = fdiag.Path;
+ }
+ fdiag.Hide ();
+ }
+ }
+
+ public ProjectConfigurationPropertyPanel ()
+ {
+ InitializeComponent ();
+ VBox vbox = new VBox ();
+ HBox hboxTitle = new HBox ();
+ hboxTitle.PackStart (titleLabel, false, false, 0);
+ vbox.PackStart (hboxTitle);
+ vbox.PackStart (outputAssembly);
+ HBox hboxCompiler = new HBox ();
+ hboxCompiler.PackStart (labelCompiler, false, false, 0);
+ vbox.PackStart (hboxCompiler);
+ HBox comps = new HBox ();
+ comps.PackStart (gcj);
+ comps.PackStart (javac);
+ vbox.PackStart (comps);
+ vbox.PackStart (compilerPath);
+ HBox hboxRuntime = new HBox ();
+ hboxRuntime.PackStart (runtimeLabel, false, false, 0);
+ vbox.PackStart (hboxRuntime);
+ HBox hboxClasspath = new HBox ();
+ hboxClasspath.PackStart (labelClasspath, false, false, 0);
+ vbox.PackStart (hboxClasspath);
+ vbox.PackStart (classPath);
+ HBox hboxMainClass = new HBox ();
+ hboxMainClass.PackStart (labelMainClass, false, false, 0);
+ vbox.PackStart (hboxMainClass);
+ vbox.PackStart (mainClass);
+ HBox hboxWarnings = new HBox ();
+ hboxWarnings.PackStart (labelWarnings, false, false, 0);
+ vbox.PackStart (hboxWarnings);
+ HBox hbox = new HBox ();
+ hbox.PackStart (checkDeprecation);
+ hbox.PackStart (checkDebug);
+ hbox.PackStart (checkOptimize);
+ vbox.PackStart (hbox);
+ HBox hboxOutput = new HBox ();
+ hboxOutput.PackStart (labelOutput, false, false, 0);
+ vbox.PackStart (hboxOutput);
+ vbox.PackStart (outputDirectory);
+ this.Add (vbox);
+ CustomizationObjectChanged += new EventHandler (SetValues);
+ }
+
+ void OnCompilerToggled (object o, EventArgs args)
+ {
+ if (javac.Active)
+ compilerPath.Text = &quot;javac&quot;;
+ else
+ compilerPath.Text = &quot;gcj&quot;;
+ }
+
+ private void InitializeComponent()
+ {
+ gcj = new RadioButton (javac, &quot;gcj&quot;);
+ gcj.Toggled += OnCompilerToggled;
+ javac.Toggled += OnCompilerToggled;
+
+ this.browseButton = new Button (&quot;_Browse&quot;);
+ this.browseButton.Clicked += new EventHandler (SelectFolder);
+ labelOutput.Markup = String.Format (&quot;&lt;b&gt;{0}&lt;/b&gt;&quot;, GettextCatalog.GetString (&quot;Output path&quot;));
+ this.outputAssembly = new Entry ();
+ titleLabel.Markup = String.Format (&quot;&lt;b&gt;{0}&lt;/b&gt;&quot;, GettextCatalog.GetString (&quot;Output Assembly&quot;));
+ labelWarnings.Markup = String.Format (&quot;&lt;b&gt;{0}&lt;/b&gt;&quot;, GettextCatalog.GetString (&quot;Warnings and Errors&quot;));
+
+ labelCompiler.Markup = String.Format (&quot;&lt;b&gt;{0}&lt;/b&gt;&quot;, GettextCatalog.GetString (&quot;Compiler&quot;));
+ labelClasspath.Markup = String.Format (&quot;&lt;b&gt;{0}&lt;/b&gt;&quot;, GettextCatalog.GetString (&quot;Classpath&quot;));
+ labelMainClass.Markup = String.Format (&quot;&lt;b&gt;{0}&lt;/b&gt;&quot;, GettextCatalog.GetString (&quot;Main Class&quot;));
+ }
+ }
+}
Modified: trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/JavaBindingCompilerServices.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/JavaBindingCompilerServices.cs 2004-07-05 18:40:45 UTC (rev 1896)
+++ trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/JavaBindingCompilerServices.cs 2004-07-05 19:05:54 UTC (rev 1897)
@@ -1,232 +1,226 @@
-// &lt;file&gt;
-// &lt;copyright see=&quot;<A HREF="prj:///doc/copyright.txt&quot;/">prj:///doc/copyright.txt&quot;/</A>&gt;
-// &lt;license see=&quot;<A HREF="prj:///doc/license.txt&quot;/">prj:///doc/license.txt&quot;/</A>&gt;
-// &lt;owner name=&quot;Mike Kr&#252;ger&quot; email=&quot;<A HREF="http://lists.ximian.com/mailman/listinfo/monodevelop-patches-list">mike at icsharpcode.net</A>&quot;/&gt;
-// &lt;version value=&quot;$version&quot;/&gt;
-// &lt;/file&gt;
-
-using System;
-using System.Diagnostics;
-using System.IO;
-using System.CodeDom.Compiler;
-
-using MonoDevelop.Gui.Components;
-using MonoDevelop.Services;
-using MonoDevelop.Core.Services;
-using MonoDevelop.Internal.Project;
-
-namespace JavaBinding
-{
- /// &lt;summary&gt;
- /// This class controls the compilation of C Sharp files and C Sharp projects
- /// &lt;/summary&gt;
- public class JavaBindingCompilerServices
- {
- public bool CanCompile(string fileName)
- {
- return Path.GetExtension(fileName) == &quot;.java&quot;;
- }
-
- public ICompilerResult CompileFile(string filename)
- {
- string options = &quot;&quot;;
-
- JavaCompilerParameters cparam = new JavaCompilerParameters();
-
- if (cparam.Debugmode) {
- options += &quot; -g &quot;;
- } else {
- options += &quot; -g:none &quot;;
- }
-
- if (cparam.Optimize) {
- options += &quot; -O &quot;;
- }
-
- if (cparam.GenWarnings) {
- options += &quot; -nowarn &quot;;
- }
- options += &quot; -encoding utf8 &quot;;
-
- TempFileCollection tf = new TempFileCollection();
- // FIXME
- string compiler = &quot;javac&quot;;
- string args = filename + &quot; -classpath &quot; + cparam.ClassPath + options;
- //Executor.ExecWaitWithCapture(outstr, tf, ref error , ref output);
- StreamReader output, error;
- DoCompilation (compiler, args, tf, out output, out error);
- ICompilerResult cr = ParseOutput (tf, error);
-
- return cr;
- }
-
- public string GetCompiledOutputName(string fileName)
- {
- return Path.ChangeExtension(fileName, &quot;.class&quot;);
- }
-
- FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.GetService(typeof(FileUtilityService));
-
- public string GetCompiledOutputName(IProject project)
- {
- JavaProject p = (JavaProject)project;
- JavaCompilerParameters compilerparameters = (JavaCompilerParameters)p.ActiveConfiguration;
-
- string exe = fileUtilityService.GetDirectoryNameWithSeparator(compilerparameters.OutputDirectory) + compilerparameters.OutputAssembly + &quot;.class&quot;;
- return exe;
- }
-
- string GetCompilerName (JavaCompilerParameters cp)
- {
- if (cp.Compiler == JavaCompiler.Gcj)
- {
- return &quot;gcj&quot;; // compile to bytecode
- }
-
- return &quot;javac&quot;;
- }
-
- public ICompilerResult CompileProject(IProject project)
- {
- JavaProject p = (JavaProject)project;
- JavaCompilerParameters compilerparameters = (JavaCompilerParameters)p.ActiveConfiguration;
-
- string exe = fileUtilityService.GetDirectoryNameWithSeparator(compilerparameters.OutputDirectory) + compilerparameters.OutputAssembly + &quot;.class&quot;;
- string options = &quot;&quot;;
-
- string compiler = GetCompilerName (compilerparameters);
-
- if (compilerparameters.Debugmode)
- options += &quot; -g &quot;;
- else
- options += &quot; -g:none &quot;;
-
- if (compilerparameters.Optimize)
- options += &quot; -O &quot;;
-
- if (compilerparameters.Deprecation)
- options += &quot; -deprecation &quot;;
-
- if (compilerparameters.GenWarnings)
- options += &quot; -nowarn &quot;;
-
- if (compilerparameters.ClassPath == null)
- options += &quot; -classpath &quot; + compilerparameters.ClassPath;
-
- options += &quot; -encoding utf8 &quot;;
-
- //string output = &quot;&quot;;
- //string error = &quot;&quot;;
- string files = &quot;&quot;;
-
- foreach (ProjectFile finfo in p.ProjectFiles) {
- if (finfo.Subtype != Subtype.Directory) {
- switch (finfo.BuildAction) {
- case BuildAction.Compile:
- files = files + &quot; \&quot;&quot; + finfo.Name + &quot;\&quot;&quot;;
- break;
- }
- }
- }
-
- TempFileCollection tf = new TempFileCollection ();
- string args = &quot;&quot;;
-
- if (compilerparameters.Compiler == JavaCompiler.Gcj)
- args = &quot;-C &quot;;
-
- string outdir = &quot; -d &quot; + compilerparameters.OutputDirectory;
-
- //FIXME re-enable options
- //FIXME re-enable compilerPath
- if (compilerparameters.ClassPath == &quot;&quot;) {
- args += files + outdir;
- } else {
- args += &quot; -classpath &quot; + compilerparameters.ClassPath + files + outdir;
- }
- Console.WriteLine (args);
-
- StreamReader output;
- StreamReader 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 compiler, string args, TempFileCollection tf, out StreamReader output, out StreamReader error)
- {
- ProcessStartInfo si = new ProcessStartInfo (compiler, args);
- si.RedirectStandardOutput = true;
- si.RedirectStandardError = true;
- si.UseShellExecute = false;
- Process p = new Process ();
- p.StartInfo = si;
- p.Start ();
-
- IStatusBarService sbs = (IStatusBarService)ServiceManager.GetService (typeof (IStatusBarService));
- sbs.SetMessage (&quot;Compiling...&quot;);
-
- while (!p.HasExited) {
- ((SdStatusBar)sbs.ProgressMonitor).Pulse();
- while (Gtk.Application.EventsPending ())
- Gtk.Application.RunIteration ();
- System.Threading.Thread.Sleep (100);
- }
- ((SdStatusBar) sbs.ProgressMonitor).Done ();
-
- // FIXME: avoid having a full buffer
- // perhaps read one line and append parsed output
- // and then return cr at end
- output = p.StandardOutput;
- error = p.StandardError;
- p.WaitForExit ();
- }
-
- ICompilerResult ParseOutput(TempFileCollection tf, StreamReader errorStream)
- {
- string compilerOutput = &quot;&quot;;
- StreamReader sr = errorStream;
- CompilerResults cr = new CompilerResults(tf);
-
- while (true)
- {
- string next = sr.ReadLine ();
-
- if (next == null)
- break;
-
- CompilerError error = new CompilerError ();
-
- int errorCol = 0;
- string col = next.Trim ();
- if (col.Length ==1 &amp;&amp; col == &quot;^&quot;)
- errorCol = next.IndexOf (&quot;^&quot;);
-
- compilerOutput += next + &quot;\n&quot;;
-
- int index1 = next.IndexOf(&quot;.java:&quot;);
- if (index1 &lt; 0)
- continue;
-
- string s1 = next.Substring(0, index1);
- string s2 = next.Substring(index1 + 6);
- int index2 = s2.IndexOf(&quot;:&quot;);
- int line = Int32.Parse(next.Substring(index1 + 6,index2));
- //error.IsWarning = what[0] == &quot;warning&quot;;
- //error.ErrorNumber = what[what.Length - 1];
-
- error.Column = errorCol;
- error.Line = line;
- error.ErrorText = next.Substring (index1 + index2 + 7);
- error.FileName = Path.GetFullPath (next.Substring (0, index1) + &quot;.java&quot;); //Path.GetFileName(filename);
- cr.Errors.Add (error);
- }
-
- sr.Close ();
- return new DefaultCompilerResult (cr, compilerOutput);
- }
- }
-}
-
+// &lt;file&gt;
+// &lt;copyright see=&quot;<A HREF="prj:///doc/copyright.txt&quot;/">prj:///doc/copyright.txt&quot;/</A>&gt;
+// &lt;license see=&quot;<A HREF="prj:///doc/license.txt&quot;/">prj:///doc/license.txt&quot;/</A>&gt;
+// &lt;owner name=&quot;Mike Kr&#252;ger&quot; email=&quot;<A HREF="http://lists.ximian.com/mailman/listinfo/monodevelop-patches-list">mike at icsharpcode.net</A>&quot;/&gt;
+// &lt;version value=&quot;$version&quot;/&gt;
+// &lt;/file&gt;
+
+using System;
+using System.Diagnostics;
+using System.IO;
+using System.CodeDom.Compiler;
+
+using MonoDevelop.Gui.Components;
+using MonoDevelop.Services;
+using MonoDevelop.Core.Services;
+using MonoDevelop.Internal.Project;
+
+namespace JavaBinding
+{
+ public class JavaBindingCompilerServices
+ {
+ JavaProject project;
+
+ public bool CanCompile (string fileName)
+ {
+ return Path.GetExtension(fileName) == &quot;.java&quot;;
+ }
+
+ public ICompilerResult CompileFile (string filename)
+ {
+ // we really dont support compiling single files
+ throw new NotImplementedException ();
+ }
+
+ public string GetCompiledOutputName (string fileName)
+ {
+ return Path.ChangeExtension (fileName, &quot;.class&quot;);
+ }
+
+ FileUtilityService fileUtilityService = (FileUtilityService) ServiceManager.GetService(typeof(FileUtilityService));
+
+ public string GetCompiledOutputName (IProject project)
+ {
+ JavaProject p = (JavaProject) project;
+ JavaCompilerParameters compilerparameters = (JavaCompilerParameters) p.ActiveConfiguration;
+
+ return fileUtilityService.GetDirectoryNameWithSeparator (compilerparameters.OutputDirectory) + compilerparameters.OutputAssembly + &quot;.class&quot;;
+ }
+
+ string GetCompilerName (JavaCompilerParameters cp)
+ {
+ if (cp.Compiler == JavaCompiler.Gcj)
+ {
+ return &quot;gcj&quot;;
+ }
+
+ return &quot;javac&quot;;
+ }
+
+ public ICompilerResult CompileProject (IProject project)
+ {
+ this.project = (JavaProject) project;
+ JavaCompilerParameters compilerparameters = (JavaCompilerParameters) project.ActiveConfiguration;
+
+ string outdir = compilerparameters.OutputDirectory;
+ string exe = Path.Combine (outdir, compilerparameters.OutputAssembly + &quot;.class&quot;);
+ string options = &quot;&quot;;
+
+ string compiler = GetCompilerName (compilerparameters);
+
+ if (compilerparameters.Debugmode)
+ options += &quot; -g &quot;;
+ else
+ options += &quot; -g:none &quot;;
+
+ if (compilerparameters.Optimize)
+ options += &quot; -O &quot;;
+
+ if (compilerparameters.Deprecation)
+ options += &quot; -deprecation &quot;;
+
+ if (compilerparameters.GenWarnings)
+ options += &quot; -nowarn &quot;;
+
+ if (compilerparameters.ClassPath == null)
+ options += &quot; -classpath &quot; + compilerparameters.ClassPath;
+
+ options += &quot; -encoding utf8 &quot;;
+
+ string files = &quot;&quot;;
+
+ foreach (ProjectFile finfo in project.ProjectFiles) {
+ if (finfo.Subtype != Subtype.Directory) {
+ switch (finfo.BuildAction) {
+ case BuildAction.Compile:
+ files = files + &quot; \&quot;&quot; + finfo.Name + &quot;\&quot;&quot;;
+ break;
+ }
+ }
+ }
+
+ TempFileCollection tf = new TempFileCollection ();
+ string args = &quot;&quot;;
+
+ if (compilerparameters.Compiler == JavaCompiler.Gcj)
+ args = &quot;-C &quot;;
+
+ //FIXME re-enable options
+ //FIXME re-enable compilerPath
+ if (compilerparameters.ClassPath == &quot;&quot;) {
+ args += files + &quot; -d &quot; + outdir;
+ } else {
+ args += &quot; -classpath &quot; + compilerparameters.ClassPath + files + &quot; -d &quot; + outdir;
+ }
+ //Console.WriteLine (args);
+
+ StreamReader output;
+ StreamReader error;
+ DoCompilation (compiler, args, tf, out output, out error);
+ ICompilerResult cr = ParseOutput (tf, error);
+
+ return cr;
+ }
+
+ private void DoCompilation (string compiler, string args, TempFileCollection tf, out StreamReader output, out StreamReader error)
+ {
+ ProcessStartInfo si = new ProcessStartInfo (compiler, args);
+ si.RedirectStandardOutput = true;
+ si.RedirectStandardError = true;
+ si.UseShellExecute = false;
+ Process p = new Process ();
+ p.StartInfo = si;
+ p.Start ();
+
+ IStatusBarService sbs = (IStatusBarService)ServiceManager.GetService (typeof (IStatusBarService));
+ sbs.SetMessage (&quot;Compiling...&quot;);
+
+ while (!p.HasExited) {
+ ((SdStatusBar)sbs.ProgressMonitor).Pulse();
+ while (Gtk.Application.EventsPending ())
+ Gtk.Application.RunIteration ();
+ System.Threading.Thread.Sleep (100);
+ }
+
+ CompileToAssembly ();
+ ((SdStatusBar) sbs.ProgressMonitor).Done ();
+
+ // FIXME: avoid having a full buffer
+ // perhaps read one line and append parsed output
+ // and then return cr at end
+ output = p.StandardOutput;
+ error = p.StandardError;
+ }
+
+ void CompileToAssembly ()
+ {
+ JavaCompilerParameters compilerparameters = (JavaCompilerParameters) project.ActiveConfiguration;
+ string outdir = compilerparameters.OutputDirectory;
+ string outclass = Path.Combine (outdir, compilerparameters.OutputAssembly + &quot;.class&quot;);
+ string asm = Path.GetFileNameWithoutExtension (outclass);
+
+ // sadly I dont think we can specify the output .class name
+ string args = String.Format (&quot;{0} {1} -assembly:{2}&quot;, &quot;*.class&quot;, &quot;-reference:/usr/lib/IKVM.GNU.Classpath.dll&quot;, asm);
+ ProcessStartInfo si = new ProcessStartInfo (&quot;ikvmc&quot;, args);
+ si.WorkingDirectory = outdir;
+ si.RedirectStandardOutput = true;
+ si.RedirectStandardError = true;
+ si.UseShellExecute = false;
+ Process p = new Process ();
+ p.StartInfo = si;
+ p.Start ();
+
+ IStatusBarService sbs = (IStatusBarService)ServiceManager.GetService (typeof (IStatusBarService));
+ while (!p.HasExited) {
+ ((SdStatusBar)sbs.ProgressMonitor).Pulse();
+ while (Gtk.Application.EventsPending ())
+ Gtk.Application.RunIteration ();
+ System.Threading.Thread.Sleep (100);
+ }
+ }
+
+ ICompilerResult ParseOutput (TempFileCollection tf, StreamReader errorStream)
+ {
+ string compilerOutput = &quot;&quot;;
+ StreamReader sr = errorStream;
+ CompilerResults cr = new CompilerResults (tf);
+
+ while (true)
+ {
+ string next = sr.ReadLine ();
+
+ if (next == null)
+ break;
+
+ CompilerError error = new CompilerError ();
+
+ int errorCol = 0;
+ string col = next.Trim ();
+ if (col.Length == 1 &amp;&amp; col == &quot;^&quot;)
+ errorCol = next.IndexOf (&quot;^&quot;);
+
+ compilerOutput += next + &quot;\n&quot;;
+
+ int index1 = next.IndexOf (&quot;.java:&quot;);
+ if (index1 &lt; 0)
+ continue;
+
+ string s1 = next.Substring (0, index1);
+ string s2 = next.Substring (index1 + 6);
+ int index2 = s2.IndexOf (&quot;:&quot;);
+ int line = Int32.Parse (next.Substring (index1 + 6, index2));
+ //error.IsWarning = what[0] == &quot;warning&quot;;
+ //error.ErrorNumber = what[what.Length - 1];
+
+ error.Column = errorCol;
+ error.Line = line;
+ error.ErrorText = next.Substring (index1 + index2 + 7);
+ error.FileName = Path.GetFullPath (next.Substring (0, index1) + &quot;.java&quot;); //Path.GetFileName(filename);
+ cr.Errors.Add (error);
+ }
+
+ sr.Close ();
+ return new DefaultCompilerResult (cr, compilerOutput);
+ }
+ }
+}
Modified: trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/JavaBindingExecutionServices.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/JavaBindingExecutionServices.cs 2004-07-05 18:40:45 UTC (rev 1896)
+++ trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/JavaBindingExecutionServices.cs 2004-07-05 19:05:54 UTC (rev 1897)
@@ -1,115 +1,60 @@
-// &lt;file&gt;
-// &lt;copyright see=&quot;<A HREF="prj:///doc/copyright.txt&quot;/">prj:///doc/copyright.txt&quot;/</A>&gt;
-// &lt;license see=&quot;<A HREF="prj:///doc/license.txt&quot;/">prj:///doc/license.txt&quot;/</A>&gt;
-// &lt;owner name=&quot;Mike Kr&#252;ger&quot; email=&quot;<A HREF="http://lists.ximian.com/mailman/listinfo/monodevelop-patches-list">mike at icsharpcode.net</A>&quot;/&gt;
-// &lt;version value=&quot;$version&quot;/&gt;
-// &lt;/file&gt;
-
-using System;
-using System.IO;
-using System.Diagnostics;
-using System.Reflection;
-
-using MonoDevelop.Internal.Project;
-using MonoDevelop.Gui;
-using MonoDevelop.Gui.Pads;
-using MonoDevelop.Core.Services;
-
-namespace JavaBinding
-{
- /// &lt;summary&gt;
- /// This class controls the compilation of C Sharp files and C Sharp projects
- /// &lt;/summary&gt;
- public class JavaBindingExecutionServices
- {
-
- public void Execute(string filename)
- {
- string exe = Path.GetFileNameWithoutExtension(filename);
- ProcessStartInfo psi = new ProcessStartInfo(Environment.GetEnvironmentVariable(&quot;ComSpec&quot;), &quot;/c java\&quot;&quot; + &quot; &amp; pause&quot;);
- psi.WorkingDirectory = Path.GetDirectoryName(filename);
- psi.UseShellExecute = false;
- try {
- Process p = new Process();
- p.StartInfo = psi;
- p.Start();
- } catch (Exception) {
- throw new ApplicationException(&quot;Can not execute &quot; + &quot;\&quot;&quot; + exe + &quot;\&quot;\n(Try restarting MonoDevelop or manual start)&quot;);
- }
- }
-
- public void Execute(IProject project)
- {
- JavaCompilerParameters parameters = (JavaCompilerParameters)project.ActiveConfiguration;
- FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.GetService(typeof(FileUtilityService));
- string directory = fileUtilityService.GetDirectoryNameWithSeparator(((JavaCompilerParameters)project.ActiveConfiguration).OutputDirectory);
- string mainClass = ((JavaCompilerParameters) project.ActiveConfiguration).MainClass;
-
- string CurrentDir = Directory.GetCurrentDirectory();
- Directory.SetCurrentDirectory (parameters.OutputDirectory);
-
- string javaExec;
- switch (parameters.Runtime) {
- case JavaRuntime.Ikvm:
- javaExec = &quot;-e \&quot;ikvm -classpath &quot; + parameters.ClassPath + &quot; &quot; + mainClass + &quot;;read -p 'press any key to continue...' -n1\&quot;&quot;;
- break;
- // FIXME: need to both compile with ikvmc
- // and then run with mono
- case JavaRuntime.Mono:
- javaExec = &quot;-e \&quot;ikvm -classpath &quot; + parameters.ClassPath + &quot; &quot; + mainClass + &quot;;read -p 'press any key to continue...' -n1\&quot;&quot;;
- break;
- case JavaRuntime.Java:
- javaExec = &quot;-e \&quot;java -classpath &quot; + parameters.ClassPath + &quot; &quot; + mainClass + &quot;;read -p 'press any key to continue...' -n1\&quot;&quot;;
- break;
- case JavaRuntime.Gij:
- javaExec = &quot;-e \&quot;gij -classpath &quot; + parameters.ClassPath + &quot; &quot; + mainClass + &quot;;read -p 'press any key to continue...' -n1\&quot;&quot;;
- break;
- default:
- javaExec = &quot;-e \&quot;ikvm -classpath &quot; + parameters.ClassPath + &quot; &quot; + mainClass + &quot;;read -p 'press any key to continue...' -n1\&quot;&quot;;
- break;
- }
-
- ProcessStartInfo psi = new ProcessStartInfo(&quot;xterm&quot;, javaExec);
-
- try {
- psi.WorkingDirectory = Path.GetDirectoryName (directory);
- psi.UseShellExecute = false;
-
- Process p = new Process ();
- p.StartInfo = psi;
- p.Start ();
- } catch (Exception) {
- throw new ApplicationException (&quot;Can not execute &quot; + &quot;\&quot;&quot; + directory + mainClass + &quot;\&quot;\n(Try restarting MonoDevelop or start your app manually)&quot;);
- }
-
-/*
- //FIXME: find out how to set the working dir better
- TerminalPad outputPad = (TerminalPad) WorkbenchSingleton.Workbench.GetPad (typeof (TerminalPad));
- outputPad.RunCommand (&quot;cd &quot; + parameters.OutputDirectory);
-
- string runtime = &quot;ikvm&quot;; // make it project.RuntimeOptions or so
- switch (runtime) {
- // is this even supposed to work with CLI binaries?
- //case &quot;java&quot;: // use an installed jre
- // outputPad.RunCommand (&quot;java -classpath &quot; + parameters.ClassPath + &quot; &quot; + ((JavaCompilerParameters) project.ActiveConfiguration).MainClass);
- // break;
- case &quot;ikvm&quot;: // JIT to Java then JIT to mono
- outputPad.RunCommand (&quot;ikvm -classpath &quot; + parameters.ClassPath + &quot; &quot; + ((JavaCompilerParameters) project.ActiveConfiguration).MainClass);
- break;
- default: // run compiled to exe with mono
- string command = &quot;ikvmc -reference:/usr/lib/classpath.dll &quot; + ((JavaCompilerParameters) project.ActiveConfiguration).MainClass + &quot;.class &quot;;
- string[] allJars = parameters.ClassPath.Split (':');
- foreach (string jar in allJars)
- {
- if (jar != &quot;.&quot;)
- command += jar + &quot; &quot;;
- }
- outputPad.RunCommand (command);
- outputPad.RunCommand (&quot;mono &quot; + ((JavaCompilerParameters) project.ActiveConfiguration).MainClass + &quot;.exe&quot;);
- break;
- }
- outputPad.RunCommand (&quot;cd -&quot;);
-*/
- }
- }
-}
+// &lt;file&gt;
+// &lt;copyright see=&quot;<A HREF="prj:///doc/copyright.txt&quot;/">prj:///doc/copyright.txt&quot;/</A>&gt;
+// &lt;license see=&quot;<A HREF="prj:///doc/license.txt&quot;/">prj:///doc/license.txt&quot;/</A>&gt;
+// &lt;owner name=&quot;Mike Kr&#252;ger&quot; email=&quot;<A HREF="http://lists.ximian.com/mailman/listinfo/monodevelop-patches-list">mike at icsharpcode.net</A>&quot;/&gt;
+// &lt;version value=&quot;$version&quot;/&gt;
+// &lt;/file&gt;
+
+using System;
+using System.IO;
+using System.Diagnostics;
+using System.Reflection;
+
+using MonoDevelop.Internal.Project;
+using MonoDevelop.Gui;
+using MonoDevelop.Gui.Pads;
+using MonoDevelop.Core.Services;
+using MonoDevelop.Services;
+
+namespace JavaBinding
+{
+ public class JavaBindingExecutionServices
+ {
+ public void Execute (string filename)
+ {
+ throw new ApplicationException (&quot;Cannot execute a file.&quot;);
+ }
+
+ public void Execute (IProject project)
+ {
+ JavaCompilerParameters parameters = (JavaCompilerParameters) project.ActiveConfiguration;
+ string exe = ((JavaCompilerParameters) project.ActiveConfiguration).OutputAssembly;
+ exe = Path.ChangeExtension (exe, &quot;.exe&quot;);
+ exe = Path.Combine (parameters.OutputDirectory, exe);
+
+ if (!File.Exists (exe))
+ {
+ IMessageService messageService = (IMessageService) ServiceManager.GetService (typeof (IMessageService));
+ messageService.ShowError (String.Format (GettextCatalog.GetString (&quot;Error running {0}&quot;), exe));
+ return;
+ }
+
+ string javaExec = String.Format (&quot;-e \&quot;mono {0}; echo; read -p 'press any key to continue...' -n1\&quot;&quot;, exe);
+ ProcessStartInfo psi = new ProcessStartInfo (&quot;xterm&quot;, javaExec);
+
+ try
+ {
+ psi.UseShellExecute = false;
+
+ Process p = new Process ();
+ p.StartInfo = psi;
+ p.Start ();
+ p.WaitForExit ();
+ }
+ catch
+ {
+ throw new ApplicationException (String.Format (&quot;Cannot execute: {0}&quot;, exe));
+ }
+ }
+ }
+}
Modified: trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/JavaCompiler.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/JavaCompiler.cs 2004-07-05 18:40:45 UTC (rev 1896)
+++ trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/JavaCompiler.cs 2004-07-05 19:05:54 UTC (rev 1897)
@@ -8,4 +8,3 @@
Gcj,
}
}
-
Modified: trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/JavaLanguageBinding.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/JavaLanguageBinding.cs 2004-07-05 18:40:45 UTC (rev 1896)
+++ trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/JavaLanguageBinding.cs 2004-07-05 19:05:54 UTC (rev 1897)
@@ -1,101 +1,101 @@
-// &lt;file&gt;
-// &lt;copyright see=&quot;<A HREF="prj:///doc/copyright.txt&quot;/">prj:///doc/copyright.txt&quot;/</A>&gt;
-// &lt;license see=&quot;<A HREF="prj:///doc/license.txt&quot;/">prj:///doc/license.txt&quot;/</A>&gt;
-// &lt;owner name=&quot;Mike Kr&#252;ger&quot; email=&quot;<A HREF="http://lists.ximian.com/mailman/listinfo/monodevelop-patches-list">mike at icsharpcode.net</A>&quot;/&gt;
-// &lt;version value=&quot;$version&quot;/&gt;
-// &lt;/file&gt;
-
-using System;
-using System.IO;
-using System.Diagnostics;
-using System.Collections;
-using System.Reflection;
-using System.Resources;
-using System.Xml;
-
-using MonoDevelop.Internal.Project;
-using MonoDevelop.Internal.Templates;
-using MonoDevelop.Gui;
-
-namespace JavaBinding
-{
- /// &lt;summary&gt;
- /// This class describes the main functionalaty of a language binding
- /// &lt;/summary&gt;
- public class JavaLanguageBinding : ILanguageBinding
- {
- public const string LanguageName = &quot;Java&quot;;
-
- JavaBindingCompilerServices compilerServices = new JavaBindingCompilerServices();
- JavaBindingExecutionServices executionServices = new JavaBindingExecutionServices();
-
- public string Language {
- get {
- return LanguageName;
- }
- }
-
- public void Execute (string filename)
- {
- Debug.Assert(executionServices != null);
- executionServices.Execute(filename);
- }
-
- public void Execute (IProject project)
- {
- Debug.Assert (executionServices != null);
- executionServices.Execute (project);
- }
-
- public string GetCompiledOutputName(string fileName)
- {
- Debug.Assert(compilerServices != null);
- return compilerServices.GetCompiledOutputName(fileName);
- }
-
- public string GetCompiledOutputName(IProject project)
- {
- Debug.Assert(compilerServices != null);
- return compilerServices.GetCompiledOutputName(project);
- }
-
- public bool CanCompile(string fileName)
- {
- Debug.Assert(compilerServices != null);
- return compilerServices.CanCompile(fileName);
- }
-
- public ICompilerResult CompileFile(string fileName)
- {
- Debug.Assert(compilerServices != null);
- return compilerServices.CompileFile(fileName);
- }
-
- public ICompilerResult CompileProject(IProject project)
- {
- Debug.Assert(compilerServices != null);
- return compilerServices.CompileProject(project);
- }
-
- public ICompilerResult RecompileProject(IProject project)
- {
- return CompileProject(project);
- }
-
- public IProject CreateProject(ProjectCreateInformation info, XmlElement projectOptions)
- {
- return new JavaProject(info, projectOptions);
- }
-
- public void DebugProject (IProject project)
- {
- //executionManager.Debug (project);
- }
+// &lt;file&gt;
+// &lt;copyright see=&quot;<A HREF="prj:///doc/copyright.txt&quot;/">prj:///doc/copyright.txt&quot;/</A>&gt;
+// &lt;license see=&quot;<A HREF="prj:///doc/license.txt&quot;/">prj:///doc/license.txt&quot;/</A>&gt;
+// &lt;owner name=&quot;Mike Kr&#252;ger&quot; email=&quot;<A HREF="http://lists.ximian.com/mailman/listinfo/monodevelop-patches-list">mike at icsharpcode.net</A>&quot;/&gt;
+// &lt;version value=&quot;$version&quot;/&gt;
+// &lt;/file&gt;
+using System;
+using System.IO;
+using System.Diagnostics;
+using System.Collections;
+using System.Reflection;
+using System.Resources;
+using System.Xml;
+
+using MonoDevelop.Internal.Project;
+using MonoDevelop.Internal.Templates;
+using MonoDevelop.Gui;
+
+namespace JavaBinding
+{
+ /// &lt;summary&gt;
+ /// This class describes the main functionalaty of a language binding
+ /// &lt;/summary&gt;
+ public class JavaLanguageBinding : ILanguageBinding
+ {
+ public const string LanguageName = &quot;Java&quot;;
+
+ JavaBindingCompilerServices compilerServices = new JavaBindingCompilerServices();
+ JavaBindingExecutionServices executionServices = new JavaBindingExecutionServices();
+
+ public string Language {
+ get {
+ return LanguageName;
+ }
+ }
+
+ public void Execute (string filename)
+ {
+ Debug.Assert(executionServices != null);
+ executionServices.Execute(filename);
+ }
+
+ public void Execute (IProject project)
+ {
+ Debug.Assert (executionServices != null);
+ executionServices.Execute (project);
+ }
+
+ public string GetCompiledOutputName(string fileName)
+ {
+ Debug.Assert(compilerServices != null);
+ return compilerServices.GetCompiledOutputName(fileName);
+ }
+
+ public string GetCompiledOutputName(IProject project)
+ {
+ Debug.Assert(compilerServices != null);
+ return compilerServices.GetCompiledOutputName(project);
+ }
+
+ public bool CanCompile(string fileName)
+ {
+ Debug.Assert(compilerServices != null);
+ return compilerServices.CanCompile(fileName);
+ }
+
+ public ICompilerResult CompileFile(string fileName)
+ {
+ Debug.Assert(compilerServices != null);
+ return compilerServices.CompileFile(fileName);
+ }
+
+ public ICompilerResult CompileProject(IProject project)
+ {
+ Debug.Assert(compilerServices != null);
+ return compilerServices.CompileProject(project);
+ }
+
+ public ICompilerResult RecompileProject(IProject project)
+ {
+ return CompileProject(project);
+ }
+
+ public IProject CreateProject(ProjectCreateInformation info, XmlElement projectOptions)
+ {
+ return new JavaProject(info, projectOptions);
+ }
+
+ public void DebugProject (IProject project)
+ {
+ //executionManager.Debug (project);
+ }
+
public void GenerateMakefile (IProject project, Combine parentCombine)
{
throw new NotImplementedException ();
}
- }
-}
+ }
+}
Deleted: trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/JavaRuntime.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/JavaRuntime.cs 2004-07-05 18:40:45 UTC (rev 1896)
+++ trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/JavaRuntime.cs 2004-07-05 19:05:54 UTC (rev 1897)
@@ -1,13 +0,0 @@
-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
- Gij, // gcj interpreter
- }
-}
-
Modified: trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/Makefile.JavaBinding
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/Makefile.JavaBinding 2004-07-05 18:40:45 UTC (rev 1896)
+++ trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/Makefile.JavaBinding 2004-07-05 19:05:54 UTC (rev 1897)
@@ -43,21 +43,13 @@
SYSTEM_REFERENCES_CHECK = $(addsuffix .check, $(SYSTEM_REFERENCES))
-PROJECT_REFERENCES = \
-&quot;../../../Libraries/MonoDevelop.Core/MonoDevelop.Core.dll&quot; \
-&quot;../../DisplayBindings/SourceEditor/MonoDevelop.SourceEditor.dll&quot; \
-&quot;../../../Libraries/MonoDevelop.Gui.Widgets/MonoDevelop.Gui.Widgets.dll&quot; \
-&quot;../../../Main/Base/MonoDevelop.Base.dll&quot;
-
-PROJECT_REFERENCES_BUILD = $(addprefix -r:, $(PROJECT_REFERENCES))
-
MCS_OPTIONS =
all: JavaBinding.dll
JavaBinding.dll: $(SOURCES)
- mcs $(MCS_OPTIONS) -target:library -out:&quot;JavaBinding.dll&quot; $(PKG_REFERENCES_BUILD) $(PROJECT_REFERENCES_BUILD) $(SYSTEM_REFERENCES_BUILD) $(SOURCES) \
- &amp;&amp; cp &quot;JavaBinding.dll&quot; ../../../build/bin/.
+ mcs $(MCS_OPTIONS) -target:library -out:&quot;JavaBinding.dll&quot; $(PKG_REFERENCES_BUILD) $(SYSTEM_REFERENCES_BUILD) $(SOURCES) \
+ &amp;&amp; cp &quot;JavaBinding.dll&quot; ./build/bin/.
clean:
rm -f JavaBinding.dll
Modified: trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/Makefile.am
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/Makefile.am 2004-07-05 18:40:45 UTC (rev 1896)
+++ trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/Makefile.am 2004-07-05 19:05:54 UTC (rev 1897)
@@ -15,7 +15,6 @@
./JavaBindingCompilerServices.cs \
./JavaCompiler.cs \
./JavaLanguageBinding.cs \
-./JavaRuntime.cs \
./FormatingStrategy/JavaFormattingStrategy.cs \
./JavaBindingExecutionServices.cs \
./ProjectTreeBuilder/JavaNodeBuilder.cs
Modified: trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/Project/JavaCompilerParameters.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/Project/JavaCompilerParameters.cs 2004-07-05 18:40:45 UTC (rev 1896)
+++ trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/Project/JavaCompilerParameters.cs 2004-07-05 19:05:54 UTC (rev 1897)
@@ -1,164 +1,152 @@
-// &lt;file&gt;
-// &lt;copyright see=&quot;<A HREF="prj:///doc/copyright.txt&quot;/">prj:///doc/copyright.txt&quot;/</A>&gt;
-// &lt;license see=&quot;<A HREF="prj:///doc/license.txt&quot;/">prj:///doc/license.txt&quot;/</A>&gt;
-// &lt;owner name=&quot;Mike Kr&#252;ger&quot; email=&quot;<A HREF="http://lists.ximian.com/mailman/listinfo/monodevelop-patches-list">mike at icsharpcode.net</A>&quot;/&gt;
-// &lt;version value=&quot;$version&quot;/&gt;
-// &lt;/file&gt;
-
-using System;
-using System.Xml;
-using System.Diagnostics;
-
-using MonoDevelop.Internal.Project;
-
-namespace JavaBinding
-{
- /// &lt;summary&gt;
- /// This class handles project specific compiler parameters
- /// &lt;/summary&gt;
- public class JavaCompilerParameters : AbstractProjectConfiguration
- {
- [XmlNodeName(&quot;CodeGeneration&quot;)]
- class CodeGeneration
- {
- [XmlAttribute(&quot;includedebuginformation&quot;)]
- public bool debugmode = true;
-
- [XmlAttribute(&quot;deprecation&quot;)]
- public bool deprecation = true;
-
- [XmlAttribute(&quot;optimize&quot;)]
- public bool optimize = true;
-
- [XmlAttribute(&quot;mainclass&quot;)]
- public string mainclass = null;
-
- [XmlAttribute(&quot;definesymbols&quot;)]
- public string definesymbols = String.Empty;
-
- [XmlAttribute(&quot;classpath&quot;)]
- public string classpath = String.Empty;
-
- [XmlAttribute (&quot;compiler&quot;)]
- public JavaCompiler compiler = JavaCompiler.Gcj;
-
- [XmlAttribute (&quot;runtime&quot;)]
- public JavaRuntime runtime = JavaRuntime.Ikvm;
-
- [XmlAttribute(&quot;compilerpath&quot;)]
- public string compilerpath = &quot;gcj&quot;;
-
- [XmlAttribute(&quot;genwarnings&quot;)]
- public bool genwarnings = false;
- }
-
- [XmlNodeName(&quot;Execution&quot;)]
- class Execution
- {
- [XmlAttribute(&quot;consolepause&quot;)]
- public bool pauseconsoleoutput = true;
- }
-
- CodeGeneration codeGeneration = new CodeGeneration();
-
- Execution execution = new Execution();
-
- public bool GenWarnings {
- get {
- return codeGeneration.genwarnings;
- }
- set {
- codeGeneration.genwarnings = value;
- }
- }
-
- public string ClassPath {
- get {
- return codeGeneration.classpath;
- }
- set {
- codeGeneration.classpath = value;
- }
- }
-
- public JavaRuntime Runtime {
- get {
- return codeGeneration.runtime;
- }
- set {
- codeGeneration.runtime = value;
- }
- }
-
- public JavaCompiler Compiler {
- get {
- return codeGeneration.compiler;
- }
- set {
- codeGeneration.compiler = value;
- }
- }
-
- public string CompilerPath {
- get {
- return codeGeneration.compilerpath;
- }
- set {
- codeGeneration.compilerpath = value;
- }
- }
-
- public bool Debugmode {
- get {
- return codeGeneration.debugmode;
- }
- set {
- codeGeneration.debugmode = value;
- }
- }
-
- public bool Deprecation {
- get {
- return codeGeneration.deprecation;
- }
- set {
- codeGeneration.deprecation = value;
- }
- }
-
- public bool Optimize {
- get {
- return codeGeneration.optimize;
- }
- set {
- codeGeneration.optimize = value;
- }
- }
-
- public string MainClass {
- get {
- return codeGeneration.mainclass;
- }
- set {
- codeGeneration.mainclass = value;
- }
- }
-
- public bool PauseConsoleOutput {
- get {
- return execution.pauseconsoleoutput;
- }
- set {
- execution.pauseconsoleoutput = value;
- }
- }
-
- public JavaCompilerParameters()
- {
- }
- public JavaCompilerParameters(string name)
- {
- this.name = name;
- }
- }
-}
+// &lt;file&gt;
+// &lt;copyright see=&quot;<A HREF="prj:///doc/copyright.txt&quot;/">prj:///doc/copyright.txt&quot;/</A>&gt;
+// &lt;license see=&quot;<A HREF="prj:///doc/license.txt&quot;/">prj:///doc/license.txt&quot;/</A>&gt;
+// &lt;owner name=&quot;Mike Kr&#252;ger&quot; email=&quot;<A HREF="http://lists.ximian.com/mailman/listinfo/monodevelop-patches-list">mike at icsharpcode.net</A>&quot;/&gt;
+// &lt;version value=&quot;$version&quot;/&gt;
+// &lt;/file&gt;
+
+using System;
+using System.Xml;
+using System.Diagnostics;
+
+using MonoDevelop.Internal.Project;
+
+namespace JavaBinding
+{
+ /// &lt;summary&gt;
+ /// This class handles project specific compiler parameters
+ /// &lt;/summary&gt;
+ public class JavaCompilerParameters : AbstractProjectConfiguration
+ {
+ [XmlNodeName(&quot;CodeGeneration&quot;)]
+ class CodeGeneration
+ {
+ [XmlAttribute(&quot;includedebuginformation&quot;)]
+ public bool debugmode = true;
+
+ [XmlAttribute(&quot;deprecation&quot;)]
+ public bool deprecation = true;
+
+ [XmlAttribute(&quot;optimize&quot;)]
+ public bool optimize = true;
+
+ [XmlAttribute(&quot;mainclass&quot;)]
+ public string mainclass = null;
+
+ [XmlAttribute(&quot;definesymbols&quot;)]
+ public string definesymbols = String.Empty;
+
+ [XmlAttribute(&quot;classpath&quot;)]
+ public string classpath = String.Empty;
+
+ [XmlAttribute (&quot;compiler&quot;)]
+ public JavaCompiler compiler = JavaCompiler.Gcj;
+ [XmlAttribute(&quot;compilerpath&quot;)]
+ public string compilerpath = &quot;gcj&quot;;
+
+ [XmlAttribute(&quot;genwarnings&quot;)]
+ public bool genwarnings = false;
+ }
+
+ [XmlNodeName(&quot;Execution&quot;)]
+ class Execution
+ {
+ [XmlAttribute(&quot;consolepause&quot;)]
+ public bool pauseconsoleoutput = true;
+ }
+
+ CodeGeneration codeGeneration = new CodeGeneration ();
+
+ Execution execution = new Execution ();
+
+ public bool GenWarnings {
+ get {
+ return codeGeneration.genwarnings;
+ }
+ set {
+ codeGeneration.genwarnings = value;
+ }
+ }
+
+ public string ClassPath {
+ get {
+ return codeGeneration.classpath;
+ }
+ set {
+ codeGeneration.classpath = value;
+ }
+ }
+
+ public JavaCompiler Compiler {
+ get {
+ return codeGeneration.compiler;
+ }
+ set {
+ codeGeneration.compiler = value;
+ }
+ }
+
+ public string CompilerPath {
+ get {
+ return codeGeneration.compilerpath;
+ }
+ set {
+ codeGeneration.compilerpath = value;
+ }
+ }
+
+ public bool Debugmode {
+ get {
+ return codeGeneration.debugmode;
+ }
+ set {
+ codeGeneration.debugmode = value;
+ }
+ }
+
+ public bool Deprecation {
+ get {
+ return codeGeneration.deprecation;
+ }
+ set {
+ codeGeneration.deprecation = value;
+ }
+ }
+
+ public bool Optimize {
+ get {
+ return codeGeneration.optimize;
+ }
+ set {
+ codeGeneration.optimize = value;
+ }
+ }
+
+ public string MainClass {
+ get {
+ return codeGeneration.mainclass;
+ }
+ set {
+ codeGeneration.mainclass = value;
+ }
+ }
+
+ public bool PauseConsoleOutput {
+ get {
+ return execution.pauseconsoleoutput;
+ }
+ set {
+ execution.pauseconsoleoutput = value;
+ }
+ }
+
+ public JavaCompilerParameters()
+ {
+ }
+
+ public JavaCompilerParameters(string name)
+ {
+ this.name = name;
+ }
+ }
+}
Modified: trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/Project/JavaProject.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/Project/JavaProject.cs 2004-07-05 18:40:45 UTC (rev 1896)
+++ trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/Project/JavaProject.cs 2004-07-05 19:05:54 UTC (rev 1897)
@@ -1,70 +1,70 @@
-// &lt;file&gt;
-// &lt;copyright see=&quot;<A HREF="prj:///doc/copyright.txt&quot;/">prj:///doc/copyright.txt&quot;/</A>&gt;
-// &lt;license see=&quot;<A HREF="prj:///doc/license.txt&quot;/">prj:///doc/license.txt&quot;/</A>&gt;
-// &lt;owner name=&quot;Mike Kr&#195;&#188;ger&quot; email=&quot;<A HREF="http://lists.ximian.com/mailman/listinfo/monodevelop-patches-list">mike at icsharpcode.net</A>&quot;/&gt;
-// &lt;version value=&quot;$version&quot;/&gt;
-// &lt;/file&gt;
-
-using System;
-using System.IO;
-using System.Collections;
-using System.Diagnostics;
-using System.ComponentModel;
-using System.Xml;
-
-using MonoDevelop.Internal.Project;
-using MonoDevelop.Internal.Templates;
-
-namespace JavaBinding
-{
-
- /// &lt;summary&gt;
- /// This class describes a Java project and it compilation options.
- /// &lt;/summary&gt;
- public class JavaProject : AbstractProject
- {
- public override string ProjectType {
- get {
- return JavaLanguageBinding.LanguageName;
- }
- }
-
- public override IConfiguration CreateConfiguration()
- {
- return new JavaCompilerParameters();
- }
-
- public JavaProject()
- {
- }
-
- public JavaProject(ProjectCreateInformation info, XmlElement projectOptions)
- {
- if (info != null) {
- Name = info.ProjectName;
-
- Configurations.Add(CreateConfiguration(&quot;Debug&quot;));
- Configurations.Add(CreateConfiguration(&quot;Release&quot;));
-
- XmlElement el = projectOptions;
-
- foreach (JavaCompilerParameters parameter in Configurations) {
- parameter.OutputDirectory = info.BinPath;
- parameter.OutputAssembly = Name;
-
- if (el != null) {
- if (el.Attributes[&quot;MainClass&quot;] != null) {
- parameter.MainClass = el.Attributes[&quot;MainClass&quot;].InnerText;
- }
- if (el.Attributes[&quot;PauseConsoleOutput&quot;] != null) {
- parameter.PauseConsoleOutput = Boolean.Parse(el.Attributes[&quot;PauseConsoleOutput&quot;].InnerText);
- }
- if (el.Attributes[&quot;ClassPath&quot;] != null) {
- parameter.ClassPath = el.Attributes[&quot;ClassPath&quot;].InnerText;
- }
- }
- }
- }
- }
- }
-}
+// &lt;file&gt;
+// &lt;copyright see=&quot;<A HREF="prj:///doc/copyright.txt&quot;/">prj:///doc/copyright.txt&quot;/</A>&gt;
+// &lt;license see=&quot;<A HREF="prj:///doc/license.txt&quot;/">prj:///doc/license.txt&quot;/</A>&gt;
+// &lt;owner name=&quot;Mike Kr&#195;&#188;ger&quot; email=&quot;<A HREF="http://lists.ximian.com/mailman/listinfo/monodevelop-patches-list">mike at icsharpcode.net</A>&quot;/&gt;
+// &lt;version value=&quot;$version&quot;/&gt;
+// &lt;/file&gt;
+
+using System;
+using System.IO;
+using System.Collections;
+using System.Diagnostics;
+using System.ComponentModel;
+using System.Xml;
+
+using MonoDevelop.Internal.Project;
+using MonoDevelop.Internal.Templates;
+
+namespace JavaBinding
+{
+
+ /// &lt;summary&gt;
+ /// This class describes a Java project and it compilation options.
+ /// &lt;/summary&gt;
+ public class JavaProject : AbstractProject
+ {
+ public override string ProjectType {
+ get {
+ return JavaLanguageBinding.LanguageName;
+ }
+ }
+
+ public override IConfiguration CreateConfiguration()
+ {
+ return new JavaCompilerParameters();
+ }
+
+ public JavaProject()
+ {
+ }
+
+ public JavaProject(ProjectCreateInformation info, XmlElement projectOptions)
+ {
+ if (info != null) {
+ Name = info.ProjectName;
+
+ Configurations.Add(CreateConfiguration(&quot;Debug&quot;));
+ Configurations.Add(CreateConfiguration(&quot;Release&quot;));
+
+ XmlElement el = projectOptions;
+
+ foreach (JavaCompilerParameters parameter in Configurations) {
+ parameter.OutputDirectory = info.BinPath;
+ parameter.OutputAssembly = Name;
+
+ if (el != null) {
+ if (el.Attributes[&quot;MainClass&quot;] != null) {
+ parameter.MainClass = el.Attributes[&quot;MainClass&quot;].InnerText;
+ }
+ if (el.Attributes[&quot;PauseConsoleOutput&quot;] != null) {
+ parameter.PauseConsoleOutput = Boolean.Parse(el.Attributes[&quot;PauseConsoleOutput&quot;].InnerText);
+ }
+ if (el.Attributes[&quot;ClassPath&quot;] != null) {
+ parameter.ClassPath = el.Attributes[&quot;ClassPath&quot;].InnerText;
+ }
+ }
+ }
+ }
+ }
+ }
+}
Modified: trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/ProjectTreeBuilder/JavaNodeBuilder.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/ProjectTreeBuilder/JavaNodeBuilder.cs 2004-07-05 18:40:45 UTC (rev 1896)
+++ trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/ProjectTreeBuilder/JavaNodeBuilder.cs 2004-07-05 19:05:54 UTC (rev 1897)
@@ -1,146 +1,146 @@
-&#65279;// &lt;file&gt;
-// &lt;copyright see=&quot;<A HREF="prj:///doc/copyright.txt&quot;/">prj:///doc/copyright.txt&quot;/</A>&gt;
-// &lt;license see=&quot;<A HREF="prj:///doc/license.txt&quot;/">prj:///doc/license.txt&quot;/</A>&gt;
-// &lt;owner name=&quot;Mike Kr&#252;ger&quot; email=&quot;<A HREF="http://lists.ximian.com/mailman/listinfo/monodevelop-patches-list">mike at icsharpcode.net</A>&quot;/&gt;
-// &lt;version value=&quot;$version&quot;/&gt;
-// &lt;/file&gt;
-
-using System;
-using System.IO;
-using System.Diagnostics;
-using System.Collections;
-using System.Reflection;
-using System.Resources;
-using System.Xml;
-
-using MonoDevelop.Core.Properties;
-using MonoDevelop.Core.Services;
-using MonoDevelop.Internal.Project;
-using MonoDevelop.Gui;
-using MonoDevelop.Gui.Pads.ProjectBrowser;
-using MonoDevelop.Gui.Widgets;
-
-namespace JavaBinding
-{
- public class JavaNodeBuilder : IProjectNodeBuilder
- {
- FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.GetService(typeof(FileUtilityService));
- IconService iconService = (IconService)ServiceManager.GetService(typeof(IconService));
-
- public bool CanBuildProjectTree(IProject project)
- {
- return project.ProjectType == JavaLanguageBinding.LanguageName;
- }
-
- public AbstractBrowserNode BuildProjectTreeNode(IProject project)
- {
- ProjectBrowserNode projectNode = new ProjectBrowserNode(project);
-
- //projectNode.IconImage = iconService.GetImageForProjectType(project.ProjectType);
-
- // create 'empty' directories
- for (int i = 0; i &lt; project.ProjectFiles.Count; ++i) {
- if (project.ProjectFiles[i].Subtype == Subtype.Directory) {
- string directoryName = fileUtilityService.AbsoluteToRelativePath(project.BaseDirectory, project.ProjectFiles[i].Name);
-
- // if directoryname starts with ./ oder .\
- if (directoryName.StartsWith(&quot;.&quot;)) {
- directoryName = directoryName.Substring(2);
- }
-
- string parentDirectory = Path.GetFileName(directoryName);
-
- AbstractBrowserNode currentPathNode = GetPath(directoryName, projectNode, true);
-
- DirectoryNode newFolderNode = new DirectoryNode(project.ProjectFiles[i].Name);
- //newFolderNode.OpenedImage = resourceService.GetBitmap (&quot;Icons.16x16.OpenFolderBitmap&quot;);
- //newFolderNode.ClosedImage = resourceService.GetBitmap (&quot;Icons.16x16.ClosedFolderBitmap&quot;);
-
- currentPathNode.Nodes.Add(newFolderNode);
-
- }
- }
-
- // create file tree
- for (int i = 0; i &lt; project.ProjectFiles.Count; ++i) {
- if (project.ProjectFiles[i].Subtype != Subtype.Directory) {
- ProjectFile fileInformation = project.ProjectFiles[i];
-
- string relativeFile = fileUtilityService.AbsoluteToRelativePath(project.BaseDirectory, fileInformation.Name);
-
- string fileName = Path.GetFileName(fileInformation.Name);
-
- switch (fileInformation.BuildAction) {
-
- case BuildAction.Exclude:
- break;
-
- default:
- AbstractBrowserNode currentPathNode = GetPath(relativeFile, projectNode, true);
-
- AbstractBrowserNode newNode = new FileNode(fileInformation);
- newNode.ContextmenuAddinTreePath = FileNode.ProjectFileContextMenuPath;
- currentPathNode.Nodes.Add(newNode);
- break;
- }
- }
- }
-
- return projectNode;
- }
-
- AbstractBrowserNode GetNodeFromCollection (TreeNodeCollection collection, string title)
- {
- foreach (AbstractBrowserNode node in collection) {
- if (node.Text == title) {
- return node;
- }
- }
- return null;
- }
-
- public AbstractBrowserNode GetPath(string filename, AbstractBrowserNode root, bool create)
- {
- string directory = Path.GetDirectoryName(filename);
- string[] treepath = directory.Split(new char[] { Path.DirectorySeparatorChar });
- AbstractBrowserNode curpathnode = root;
-
- foreach (string path in treepath) {
- if (path.Length == 0 || path[0] == '.') {
- continue;
- }
-
- AbstractBrowserNode node = null;
- //AbstractBrowserNode node = GetNodeFromCollection(curpathnode.Nodes, path);
-
- if (node == null) {
- if (create) {
- DirectoryNode newFolderNode = new DirectoryNode(fileUtilityService.GetDirectoryNameWithSeparator(ConstructFolderName(curpathnode)) + path);
- curpathnode.Nodes.Add(newFolderNode);
- curpathnode = newFolderNode;
- continue;
- } else {
- return null;
- }
- }
- curpathnode = node;
- }
-
- return curpathnode;
- }
-
- public string ConstructFolderName(AbstractBrowserNode folderNode)
- {
- if (folderNode is DirectoryNode) {
- return ((DirectoryNode)folderNode).FolderName;
- }
-
- if (folderNode is ProjectBrowserNode) {
- return ((ProjectBrowserNode)folderNode).Project.BaseDirectory;
- }
-
- throw new ApplicationException(&quot;Folder name construction failed, got unexpected parent node :&quot; + folderNode);
- }
-
- }
-}
+&#65279;// &lt;file&gt;
+// &lt;copyright see=&quot;<A HREF="prj:///doc/copyright.txt&quot;/">prj:///doc/copyright.txt&quot;/</A>&gt;
+// &lt;license see=&quot;<A HREF="prj:///doc/license.txt&quot;/">prj:///doc/license.txt&quot;/</A>&gt;
+// &lt;owner name=&quot;Mike Kr&#252;ger&quot; email=&quot;<A HREF="http://lists.ximian.com/mailman/listinfo/monodevelop-patches-list">mike at icsharpcode.net</A>&quot;/&gt;
+// &lt;version value=&quot;$version&quot;/&gt;
+// &lt;/file&gt;
+
+using System;
+using System.IO;
+using System.Diagnostics;
+using System.Collections;
+using System.Reflection;
+using System.Resources;
+using System.Xml;
+
+using MonoDevelop.Core.Properties;
+using MonoDevelop.Core.Services;
+using MonoDevelop.Internal.Project;
+using MonoDevelop.Gui;
+using MonoDevelop.Gui.Pads.ProjectBrowser;
+using MonoDevelop.Gui.Widgets;
+
+namespace JavaBinding
+{
+ public class JavaNodeBuilder : IProjectNodeBuilder
+ {
+ FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.GetService(typeof(FileUtilityService));
+ IconService iconService = (IconService)ServiceManager.GetService(typeof(IconService));
+
+ public bool CanBuildProjectTree(IProject project)
+ {
+ return project.ProjectType == JavaLanguageBinding.LanguageName;
+ }
+
+ public AbstractBrowserNode BuildProjectTreeNode(IProject project)
+ {
+ ProjectBrowserNode projectNode = new ProjectBrowserNode(project);
+
+ //projectNode.IconImage = iconService.GetImageForProjectType(project.ProjectType);
+
+ // create 'empty' directories
+ for (int i = 0; i &lt; project.ProjectFiles.Count; ++i) {
+ if (project.ProjectFiles[i].Subtype == Subtype.Directory) {
+ string directoryName = fileUtilityService.AbsoluteToRelativePath(project.BaseDirectory, project.ProjectFiles[i].Name);
+
+ // if directoryname starts with ./ oder .\
+ if (directoryName.StartsWith(&quot;.&quot;)) {
+ directoryName = directoryName.Substring(2);
+ }
+
+ string parentDirectory = Path.GetFileName(directoryName);
+
+ AbstractBrowserNode currentPathNode = GetPath(directoryName, projectNode, true);
+
+ DirectoryNode newFolderNode = new DirectoryNode(project.ProjectFiles[i].Name);
+ //newFolderNode.OpenedImage = resourceService.GetBitmap (&quot;Icons.16x16.OpenFolderBitmap&quot;);
+ //newFolderNode.ClosedImage = resourceService.GetBitmap (&quot;Icons.16x16.ClosedFolderBitmap&quot;);
+
+ currentPathNode.Nodes.Add(newFolderNode);
+
+ }
+ }
+
+ // create file tree
+ for (int i = 0; i &lt; project.ProjectFiles.Count; ++i) {
+ if (project.ProjectFiles[i].Subtype != Subtype.Directory) {
+ ProjectFile fileInformation = project.ProjectFiles[i];
+
+ string relativeFile = fileUtilityService.AbsoluteToRelativePath(project.BaseDirectory, fileInformation.Name);
+
+ string fileName = Path.GetFileName(fileInformation.Name);
+
+ switch (fileInformation.BuildAction) {
+
+ case BuildAction.Exclude:
+ break;
+
+ default:
+ AbstractBrowserNode currentPathNode = GetPath(relativeFile, projectNode, true);
+
+ AbstractBrowserNode newNode = new FileNode(fileInformation);
+ newNode.ContextmenuAddinTreePath = FileNode.ProjectFileContextMenuPath;
+ currentPathNode.Nodes.Add(newNode);
+ break;
+ }
+ }
+ }
+
+ return projectNode;
+ }
+
+ AbstractBrowserNode GetNodeFromCollection (TreeNodeCollection collection, string title)
+ {
+ foreach (AbstractBrowserNode node in collection) {
+ if (node.Text == title) {
+ return node;
+ }
+ }
+ return null;
+ }
+
+ public AbstractBrowserNode GetPath(string filename, AbstractBrowserNode root, bool create)
+ {
+ string directory = Path.GetDirectoryName(filename);
+ string[] treepath = directory.Split(new char[] { Path.DirectorySeparatorChar });
+ AbstractBrowserNode curpathnode = root;
+
+ foreach (string path in treepath) {
+ if (path.Length == 0 || path[0] == '.') {
+ continue;
+ }
+
+ AbstractBrowserNode node = null;
+ //AbstractBrowserNode node = GetNodeFromCollection(curpathnode.Nodes, path);
+
+ if (node == null) {
+ if (create) {
+ DirectoryNode newFolderNode = new DirectoryNode(fileUtilityService.GetDirectoryNameWithSeparator(ConstructFolderName(curpathnode)) + path);
+ curpathnode.Nodes.Add(newFolderNode);
+ curpathnode = newFolderNode;
+ continue;
+ } else {
+ return null;
+ }
+ }
+ curpathnode = node;
+ }
+
+ return curpathnode;
+ }
+
+ public string ConstructFolderName(AbstractBrowserNode folderNode)
+ {
+ if (folderNode is DirectoryNode) {
+ return ((DirectoryNode)folderNode).FolderName;
+ }
+
+ if (folderNode is ProjectBrowserNode) {
+ return ((ProjectBrowserNode)folderNode).Project.BaseDirectory;
+ }
+
+ throw new ApplicationException(&quot;Folder name construction failed, got unexpected parent node :&quot; + folderNode);
+ }
+
+ }
+}
Added: trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/README
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/README 2004-07-05 18:40:45 UTC (rev 1896)
+++ trunk/MonoDevelop/Core/src/AddIns/BackendBindings/JavaBinding/README 2004-07-05 19:05:54 UTC (rev 1897)
@@ -0,0 +1,7 @@
+
+MonoDevelop's support of Java is accompished via IKVM.NET
+(see <A HREF="http://www.ikvm.net">http://www.ikvm.net</A>) and it intended to allow writing
+.NET applications and libraries in Java. With this in mind
+we will be moving to producing .NET assemblies instead of
+java class files or jars by default.
+
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="001503.html">[Monodevelop-patches-list] r1896 - in trunk/MonoDevelop/Core: . build/AddIns build/AddIns/AddIns/BackendBindings build/AddIns/AddIns/BackendBindings/templates build/AddIns/AddIns/Misc/StartPage build/data/options build/data/resources/css build/data/resources/icons gdldock/gdl gdldock/sources/gdl
</A></li>
<LI>Next message: <A HREF="001505.html">[Monodevelop-patches-list] r1898 - in trunk/MonoDevelop/Core: . src/AddIns/BackendBindings/CSharpBinding src/AddIns/BackendBindings/NemerleBinding src/Libraries/SharpRefactory
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#1504">[ date ]</a>
<a href="thread.html#1504">[ thread ]</a>
<a href="subject.html#1504">[ subject ]</a>
<a href="author.html#1504">[ author ]</a>
</LI>
</UL>
<hr>
<a href="http://lists.ximian.com/mailman/listinfo/monodevelop-patches-list">More information about the Monodevelop-patches-list
mailing list</a><br>
</body></html>