зеркало из https://github.com/mono/mail-archives.git
2686 строки
93 KiB
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 <<A HREF="http://lists.ximian.com/mailman/listinfo/monodevelop-patches-list">jluke at cfl.rr.com</A>>
|
||
|
+
|
||
|
+ * *.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 <<A HREF="http://lists.ximian.com/mailman/listinfo/monodevelop-patches-list">jluke at cfl.rr.com</A>>
|
||
|
|
||
|
* 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 @@
|
||
|
-// <file>
|
||
|
-// <copyright see="<A HREF="prj:///doc/copyright.txt"/">prj:///doc/copyright.txt"/</A>>
|
||
|
-// <license see="<A HREF="prj:///doc/license.txt"/">prj:///doc/license.txt"/</A>>
|
||
|
-// <owner name="Mike Krüger" email="<A HREF="http://lists.ximian.com/mailman/listinfo/monodevelop-patches-list">mike at icsharpcode.net</A>"/>
|
||
|
-// <version value="$version"/>
|
||
|
-// </file>
|
||
|
-
|
||
|
-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
|
||
|
-{
|
||
|
- /// <summary>
|
||
|
- /// This class handles the auto and smart indenting in the textbuffer while
|
||
|
- /// you type.
|
||
|
- /// </summary>
|
||
|
- public class JavaFormattingStrategy : DefaultFormattingStrategy
|
||
|
- {
|
||
|
- public JavaFormattingStrategy()
|
||
|
- {
|
||
|
- }
|
||
|
-
|
||
|
- /// <summary>
|
||
|
- /// Define Java specific smart indenting for a line :)
|
||
|
- /// </summary>
|
||
|
- protected override int SmartIndentLine(IFormattableDocument d, int lineNr)
|
||
|
- {
|
||
|
- if (lineNr > 0) {
|
||
|
- string lineAboveText = d.GetLineAsString (lineNr - 1);
|
||
|
- string trimlineAboveText = lineAboveText.Trim ();
|
||
|
- string curLineText = d.GetLineAsString (lineNr);
|
||
|
- string trimcurLineText = curLineText.Trim ();
|
||
|
-
|
||
|
- if (lineAboveText.EndsWith(")") && curLineText.StartsWith("{")) {
|
||
|
- string indentation = GetIndentation(d, lineNr - 1);
|
||
|
- d.ReplaceLine (lineNr, indentation + curLineText);
|
||
|
- return indentation.Length;
|
||
|
- }
|
||
|
-
|
||
|
- if (curLineText.StartsWith("}")) { // indent closing bracket.
|
||
|
- int openLine;
|
||
|
- int closingBracketOffset = d.GetClosingBraceForLine (lineNr, out openLine);
|
||
|
- if (closingBracketOffset == -1) { // no closing bracket found -> autoindent
|
||
|
- return AutoIndentLine(d, lineNr);
|
||
|
- }
|
||
|
-
|
||
|
- string indentation = GetIndentation (d, lineNr - 1);
|
||
|
-
|
||
|
- d.ReplaceLine (lineNr, indentation + curLineText);
|
||
|
- return indentation.Length;
|
||
|
- }
|
||
|
-
|
||
|
- if (lineAboveText.EndsWith(";")) { // expression ended, reset to valid indent.
|
||
|
- int openLine;
|
||
|
- int closingBracketOffset = d.GetClosingBraceForLine (lineNr, out openLine);
|
||
|
- if (closingBracketOffset == -1) { // no closing bracket found -> 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("switch")) {
|
||
|
- if (lineAboveText.StartsWith("break;") ||
|
||
|
- lineAboveText.StartsWith("goto") ||
|
||
|
- lineAboveText.StartsWith("return")) {
|
||
|
- } else {
|
||
|
- indentation += d.IndentString;
|
||
|
- }
|
||
|
- }
|
||
|
- indentation += d.IndentString;
|
||
|
-
|
||
|
- d.ReplaceLine (lineNr, indentation + curLineText);
|
||
|
- return indentation.Length;
|
||
|
- }
|
||
|
-
|
||
|
- if (lineAboveText.EndsWith("{") || // indent opening bracket.
|
||
|
- lineAboveText.EndsWith(":") || // indent case xyz:
|
||
|
- (lineAboveText.EndsWith(")") && // indent single line if, for ... etc
|
||
|
- (lineAboveText.StartsWith("if") ||
|
||
|
- lineAboveText.StartsWith("while") ||
|
||
|
- lineAboveText.StartsWith("for"))) ||
|
||
|
- lineAboveText.EndsWith("else")) {
|
||
|
- 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 < lineAboveText.Length; ++i) { // search for a ( bracket that isn't closed
|
||
|
- switch (lineAboveText[i]) {
|
||
|
- case '(':
|
||
|
- bracketPos.Add(i);
|
||
|
- break;
|
||
|
- case ')':
|
||
|
- if (bracketPos.Count > 0) {
|
||
|
- bracketPos.RemoveAt(bracketPos.Count - 1);
|
||
|
- }
|
||
|
- break;
|
||
|
- }
|
||
|
- }
|
||
|
- if (bracketPos.Count > 0) {
|
||
|
- int bracketIndex = (int)bracketPos[bracketPos.Count - 1];
|
||
|
- string indentation = GetIndentation (d, lineNr - 1);
|
||
|
-
|
||
|
- for (int i = 0; i <= bracketIndex; ++i) { // insert enough spaces to match
|
||
|
- indentation += " "; // 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 < text.Length; ++i) {
|
||
|
- switch (text[i]) {
|
||
|
- case '\r':
|
||
|
- case '\n':
|
||
|
- lineComment = false;
|
||
|
- break;
|
||
|
- case '/':
|
||
|
- if (blockComment) {
|
||
|
- Debug.Assert(i > 0);
|
||
|
- if (text[i - 1] == '*') {
|
||
|
- blockComment = false;
|
||
|
- }
|
||
|
- }
|
||
|
- if (!inString && !inChar && i + 1 < text.Length) {
|
||
|
- if (!blockComment && text[i + 1] == '/') {
|
||
|
- lineComment = true;
|
||
|
- }
|
||
|
- if (!lineComment && text[i + 1] == '*') {
|
||
|
- blockComment = true;
|
||
|
- }
|
||
|
- }
|
||
|
- break;
|
||
|
- case '"':
|
||
|
- 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 > 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 <= 0) {
|
||
|
- return IndentLine(d, lineNr);
|
||
|
- }
|
||
|
-
|
||
|
- if (d.AutoInsertCurlyBracket) {
|
||
|
- string oldLineText = d.GetLineAsString (lineNr - 1);
|
||
|
- if (oldLineText.EndsWith ("{") && NeedCurlyBracket (d.TextContent)) {
|
||
|
- d.Insert (cursorOffset, "\n}");
|
||
|
- IndentLine(d, lineNr + 1);
|
||
|
- }
|
||
|
- }
|
||
|
-
|
||
|
- string lineAboveText = d.GetLineAsString (lineNr - 1);
|
||
|
-
|
||
|
-
|
||
|
-#if NON_PORTABLE_CODE
|
||
|
- if (lineAbove.HighlightSpanStack != null && lineAbove.HighlightSpanStack.Count > 0) {
|
||
|
- if (!((Span)lineAbove.HighlightSpanStack.Peek()).StopEOL) { // case for /* style comments
|
||
|
- int index = lineAboveText.IndexOf("/*");
|
||
|
-
|
||
|
- if (index > 0) {
|
||
|
- string indentation = GetIndentation(d, lineNr - 1);
|
||
|
- for (int i = indentation.Length; i < index; ++ i) {
|
||
|
- indentation += ' ';
|
||
|
- }
|
||
|
- d.Document.Replace(curLine.Offset, cursorOffset - curLine.Offset, indentation + " * ");
|
||
|
- return indentation.Length + 3;
|
||
|
- }
|
||
|
-
|
||
|
- index = lineAboveText.IndexOf("*");
|
||
|
- if (index > 0) {
|
||
|
- string indentation = GetIndentation(d, lineNr - 1);
|
||
|
- for (int i = indentation.Length; i < index; ++ i) {
|
||
|
- indentation += ' ';
|
||
|
- }
|
||
|
- d.Document.Replace(curLine.Offset, cursorOffset - curLine.Offset, indentation + "* ");
|
||
|
- return indentation.Length + 2;
|
||
|
- }
|
||
|
- }
|
||
|
- }
|
||
|
-#endif
|
||
|
- return IndentLine(d, lineNr);
|
||
|
- }
|
||
|
- return 0;
|
||
|
- }
|
||
|
- }
|
||
|
-}
|
||
|
+// <file>
|
||
|
+// <copyright see="<A HREF="prj:///doc/copyright.txt"/">prj:///doc/copyright.txt"/</A>>
|
||
|
+// <license see="<A HREF="prj:///doc/license.txt"/">prj:///doc/license.txt"/</A>>
|
||
|
+// <owner name="Mike Krüger" email="<A HREF="http://lists.ximian.com/mailman/listinfo/monodevelop-patches-list">mike at icsharpcode.net</A>"/>
|
||
|
+// <version value="$version"/>
|
||
|
+// </file>
|
||
|
+
|
||
|
+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
|
||
|
+{
|
||
|
+ /// <summary>
|
||
|
+ /// This class handles the auto and smart indenting in the textbuffer while
|
||
|
+ /// you type.
|
||
|
+ /// </summary>
|
||
|
+ public class JavaFormattingStrategy : DefaultFormattingStrategy
|
||
|
+ {
|
||
|
+ public JavaFormattingStrategy()
|
||
|
+ {
|
||
|
+ }
|
||
|
+
|
||
|
+ /// <summary>
|
||
|
+ /// Define Java specific smart indenting for a line :)
|
||
|
+ /// </summary>
|
||
|
+ protected override int SmartIndentLine(IFormattableDocument d, int lineNr)
|
||
|
+ {
|
||
|
+ if (lineNr > 0) {
|
||
|
+ string lineAboveText = d.GetLineAsString (lineNr - 1);
|
||
|
+ string trimlineAboveText = lineAboveText.Trim ();
|
||
|
+ string curLineText = d.GetLineAsString (lineNr);
|
||
|
+ string trimcurLineText = curLineText.Trim ();
|
||
|
+
|
||
|
+ if (lineAboveText.EndsWith(")") && curLineText.StartsWith("{")) {
|
||
|
+ string indentation = GetIndentation(d, lineNr - 1);
|
||
|
+ d.ReplaceLine (lineNr, indentation + curLineText);
|
||
|
+ return indentation.Length;
|
||
|
+ }
|
||
|
+
|
||
|
+ if (curLineText.StartsWith("}")) { // indent closing bracket.
|
||
|
+ int openLine;
|
||
|
+ int closingBracketOffset = d.GetClosingBraceForLine (lineNr, out openLine);
|
||
|
+ if (closingBracketOffset == -1) { // no closing bracket found -> autoindent
|
||
|
+ return AutoIndentLine(d, lineNr);
|
||
|
+ }
|
||
|
+
|
||
|
+ string indentation = GetIndentation (d, lineNr - 1);
|
||
|
+
|
||
|
+ d.ReplaceLine (lineNr, indentation + curLineText);
|
||
|
+ return indentation.Length;
|
||
|
+ }
|
||
|
+
|
||
|
+ if (lineAboveText.EndsWith(";")) { // expression ended, reset to valid indent.
|
||
|
+ int openLine;
|
||
|
+ int closingBracketOffset = d.GetClosingBraceForLine (lineNr, out openLine);
|
||
|
+ if (closingBracketOffset == -1) { // no closing bracket found -> 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("switch")) {
|
||
|
+ if (lineAboveText.StartsWith("break;") ||
|
||
|
+ lineAboveText.StartsWith("goto") ||
|
||
|
+ lineAboveText.StartsWith("return")) {
|
||
|
+ } else {
|
||
|
+ indentation += d.IndentString;
|
||
|
+ }
|
||
|
+ }
|
||
|
+ indentation += d.IndentString;
|
||
|
+
|
||
|
+ d.ReplaceLine (lineNr, indentation + curLineText);
|
||
|
+ return indentation.Length;
|
||
|
+ }
|
||
|
+
|
||
|
+ if (lineAboveText.EndsWith("{") || // indent opening bracket.
|
||
|
+ lineAboveText.EndsWith(":") || // indent case xyz:
|
||
|
+ (lineAboveText.EndsWith(")") && // indent single line if, for ... etc
|
||
|
+ (lineAboveText.StartsWith("if") ||
|
||
|
+ lineAboveText.StartsWith("while") ||
|
||
|
+ lineAboveText.StartsWith("for"))) ||
|
||
|
+ lineAboveText.EndsWith("else")) {
|
||
|
+ 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 < lineAboveText.Length; ++i) { // search for a ( bracket that isn't closed
|
||
|
+ switch (lineAboveText[i]) {
|
||
|
+ case '(':
|
||
|
+ bracketPos.Add(i);
|
||
|
+ break;
|
||
|
+ case ')':
|
||
|
+ if (bracketPos.Count > 0) {
|
||
|
+ bracketPos.RemoveAt(bracketPos.Count - 1);
|
||
|
+ }
|
||
|
+ break;
|
||
|
+ }
|
||
|
+ }
|
||
|
+ if (bracketPos.Count > 0) {
|
||
|
+ int bracketIndex = (int)bracketPos[bracketPos.Count - 1];
|
||
|
+ string indentation = GetIndentation (d, lineNr - 1);
|
||
|
+
|
||
|
+ for (int i = 0; i <= bracketIndex; ++i) { // insert enough spaces to match
|
||
|
+ indentation += " "; // 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 < text.Length; ++i) {
|
||
|
+ switch (text[i]) {
|
||
|
+ case '\r':
|
||
|
+ case '\n':
|
||
|
+ lineComment = false;
|
||
|
+ break;
|
||
|
+ case '/':
|
||
|
+ if (blockComment) {
|
||
|
+ Debug.Assert(i > 0);
|
||
|
+ if (text[i - 1] == '*') {
|
||
|
+ blockComment = false;
|
||
|
+ }
|
||
|
+ }
|
||
|
+ if (!inString && !inChar && i + 1 < text.Length) {
|
||
|
+ if (!blockComment && text[i + 1] == '/') {
|
||
|
+ lineComment = true;
|
||
|
+ }
|
||
|
+ if (!lineComment && text[i + 1] == '*') {
|
||
|
+ blockComment = true;
|
||
|
+ }
|
||
|
+ }
|
||
|
+ break;
|
||
|
+ case '"':
|
||
|
+ 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 > 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 <= 0) {
|
||
|
+ return IndentLine(d, lineNr);
|
||
|
+ }
|
||
|
+
|
||
|
+ if (d.AutoInsertCurlyBracket) {
|
||
|
+ string oldLineText = d.GetLineAsString (lineNr - 1);
|
||
|
+ if (oldLineText.EndsWith ("{") && NeedCurlyBracket (d.TextContent)) {
|
||
|
+ d.Insert (cursorOffset, "\n}");
|
||
|
+ IndentLine(d, lineNr + 1);
|
||
|
+ }
|
||
|
+ }
|
||
|
+
|
||
|
+ string lineAboveText = d.GetLineAsString (lineNr - 1);
|
||
|
+
|
||
|
+
|
||
|
+#if NON_PORTABLE_CODE
|
||
|
+ if (lineAbove.HighlightSpanStack != null && lineAbove.HighlightSpanStack.Count > 0) {
|
||
|
+ if (!((Span)lineAbove.HighlightSpanStack.Peek()).StopEOL) { // case for /* style comments
|
||
|
+ int index = lineAboveText.IndexOf("/*");
|
||
|
+
|
||
|
+ if (index > 0) {
|
||
|
+ string indentation = GetIndentation(d, lineNr - 1);
|
||
|
+ for (int i = indentation.Length; i < index; ++ i) {
|
||
|
+ indentation += ' ';
|
||
|
+ }
|
||
|
+ d.Document.Replace(curLine.Offset, cursorOffset - curLine.Offset, indentation + " * ");
|
||
|
+ return indentation.Length + 3;
|
||
|
+ }
|
||
|
+
|
||
|
+ index = lineAboveText.IndexOf("*");
|
||
|
+ if (index > 0) {
|
||
|
+ string indentation = GetIndentation(d, lineNr - 1);
|
||
|
+ for (int i = indentation.Length; i < index; ++ i) {
|
||
|
+ indentation += ' ';
|
||
|
+ }
|
||
|
+ d.Document.Replace(curLine.Offset, cursorOffset - curLine.Offset, indentation + "* ");
|
||
|
+ 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 @@
|
||
|
-// <file>
|
||
|
-// <copyright see="<A HREF="prj:///doc/copyright.txt"/">prj:///doc/copyright.txt"/</A>>
|
||
|
-// <license see="<A HREF="prj:///doc/license.txt"/">prj:///doc/license.txt"/</A>>
|
||
|
-// <owner name="Mike Krüger" email="<A HREF="http://lists.ximian.com/mailman/listinfo/monodevelop-patches-list">mike at icsharpcode.net</A>"/>
|
||
|
-// <version value="$version"/>
|
||
|
-// </file>
|
||
|
-
|
||
|
-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 ("Enable debug"));
|
||
|
- private CheckButton checkDeprecation = new CheckButton (GettextCatalog.GetString ("Deprecated"));
|
||
|
- private CheckButton checkOptimize = new CheckButton (GettextCatalog.GetString ("Enable optimizations"));
|
||
|
- private CheckButton checkWarnings = new CheckButton (GettextCatalog.GetString ("Generate Warnings"));
|
||
|
-
|
||
|
- // compiler chooser
|
||
|
- private RadioButton javac = new RadioButton ("javac");
|
||
|
- private RadioButton gcj;
|
||
|
-
|
||
|
- // runtime chooser
|
||
|
- private RadioButton ikvm = new RadioButton ("ikvm");
|
||
|
- private RadioButton mono;
|
||
|
- private RadioButton java;
|
||
|
- private 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("Config");
|
||
|
-
|
||
|
- 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 ("Browse"))) {
|
||
|
-
|
||
|
- 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 = "javac";
|
||
|
- else
|
||
|
- compilerPath.Text = "gcj";
|
||
|
- }
|
||
|
-
|
||
|
- private void InitializeComponent()
|
||
|
- {
|
||
|
- gcj = new RadioButton (javac, "gcj");
|
||
|
- gcj.Toggled += OnCompilerToggled;
|
||
|
- javac.Toggled += OnCompilerToggled;
|
||
|
-
|
||
|
- mono = new RadioButton (ikvm, "mono");
|
||
|
- mono.Sensitive = false;
|
||
|
- java = new RadioButton (ikvm, "java");
|
||
|
- //java.Sensitive = false;
|
||
|
- gij = new RadioButton (ikvm, "gij");
|
||
|
-
|
||
|
- runtimeLabel.Markup = String.Format ("<b>{0}</b>", GettextCatalog.GetString ("Runtime"));
|
||
|
-
|
||
|
- this.browseButton = new Button ("_Browse");
|
||
|
- this.browseButton.Clicked += new EventHandler (SelectFolder);
|
||
|
- labelOutput.Markup = String.Format ("<b>{0}</b>", GettextCatalog.GetString ("Output path"));
|
||
|
- this.outputAssembly = new Entry ();
|
||
|
- titleLabel.Markup = String.Format ("<b>{0}</b>", GettextCatalog.GetString ("Output Assembly"));
|
||
|
- labelWarnings.Markup = String.Format ("<b>{0}</b>", GettextCatalog.GetString ("Warnings and Errors"));
|
||
|
-
|
||
|
- labelCompiler.Markup = String.Format ("<b>{0}</b>", GettextCatalog.GetString ("Compiler"));
|
||
|
- labelClasspath.Markup = String.Format ("<b>{0}</b>", GettextCatalog.GetString ("Classpath"));
|
||
|
- labelMainClass.Markup = String.Format ("<b>{0}</b>", GettextCatalog.GetString ("Main Class"));
|
||
|
- }
|
||
|
- }
|
||
|
-}
|
||
|
+// <file>
|
||
|
+// <copyright see="<A HREF="prj:///doc/copyright.txt"/">prj:///doc/copyright.txt"/</A>>
|
||
|
+// <license see="<A HREF="prj:///doc/license.txt"/">prj:///doc/license.txt"/</A>>
|
||
|
+// <owner name="Mike Krüger" email="<A HREF="http://lists.ximian.com/mailman/listinfo/monodevelop-patches-list">mike at icsharpcode.net</A>"/>
|
||
|
+// <version value="$version"/>
|
||
|
+// </file>
|
||
|
+
|
||
|
+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 ("Enable debug"));
|
||
|
+ private CheckButton checkDeprecation = new CheckButton (GettextCatalog.GetString ("Deprecated"));
|
||
|
+ private CheckButton checkOptimize = new CheckButton (GettextCatalog.GetString ("Enable optimizations"));
|
||
|
+ private CheckButton checkWarnings = new CheckButton (GettextCatalog.GetString ("Generate Warnings"));
|
||
|
+
|
||
|
+ // compiler chooser
|
||
|
+ private RadioButton javac = new RadioButton ("javac");
|
||
|
+ private RadioButton gcj;
|
||
|
+
|
||
|
+ 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("Config");
|
||
|
+
|
||
|
+ 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 ("Browse"))) {
|
||
|
+
|
||
|
+ 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 = "javac";
|
||
|
+ else
|
||
|
+ compilerPath.Text = "gcj";
|
||
|
+ }
|
||
|
+
|
||
|
+ private void InitializeComponent()
|
||
|
+ {
|
||
|
+ gcj = new RadioButton (javac, "gcj");
|
||
|
+ gcj.Toggled += OnCompilerToggled;
|
||
|
+ javac.Toggled += OnCompilerToggled;
|
||
|
+
|
||
|
+ this.browseButton = new Button ("_Browse");
|
||
|
+ this.browseButton.Clicked += new EventHandler (SelectFolder);
|
||
|
+ labelOutput.Markup = String.Format ("<b>{0}</b>", GettextCatalog.GetString ("Output path"));
|
||
|
+ this.outputAssembly = new Entry ();
|
||
|
+ titleLabel.Markup = String.Format ("<b>{0}</b>", GettextCatalog.GetString ("Output Assembly"));
|
||
|
+ labelWarnings.Markup = String.Format ("<b>{0}</b>", GettextCatalog.GetString ("Warnings and Errors"));
|
||
|
+
|
||
|
+ labelCompiler.Markup = String.Format ("<b>{0}</b>", GettextCatalog.GetString ("Compiler"));
|
||
|
+ labelClasspath.Markup = String.Format ("<b>{0}</b>", GettextCatalog.GetString ("Classpath"));
|
||
|
+ labelMainClass.Markup = String.Format ("<b>{0}</b>", GettextCatalog.GetString ("Main Class"));
|
||
|
+ }
|
||
|
+ }
|
||
|
+}
|
||
|
|
||
|
Modified: trunk/MonoDevelop/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 @@
|
||
|
-// <file>
|
||
|
-// <copyright see="<A HREF="prj:///doc/copyright.txt"/">prj:///doc/copyright.txt"/</A>>
|
||
|
-// <license see="<A HREF="prj:///doc/license.txt"/">prj:///doc/license.txt"/</A>>
|
||
|
-// <owner name="Mike Krüger" email="<A HREF="http://lists.ximian.com/mailman/listinfo/monodevelop-patches-list">mike at icsharpcode.net</A>"/>
|
||
|
-// <version value="$version"/>
|
||
|
-// </file>
|
||
|
-
|
||
|
-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
|
||
|
-{
|
||
|
- /// <summary>
|
||
|
- /// This class controls the compilation of C Sharp files and C Sharp projects
|
||
|
- /// </summary>
|
||
|
- public class JavaBindingCompilerServices
|
||
|
- {
|
||
|
- public bool CanCompile(string fileName)
|
||
|
- {
|
||
|
- return Path.GetExtension(fileName) == ".java";
|
||
|
- }
|
||
|
-
|
||
|
- public ICompilerResult CompileFile(string filename)
|
||
|
- {
|
||
|
- string options = "";
|
||
|
-
|
||
|
- JavaCompilerParameters cparam = new JavaCompilerParameters();
|
||
|
-
|
||
|
- if (cparam.Debugmode) {
|
||
|
- options += " -g ";
|
||
|
- } else {
|
||
|
- options += " -g:none ";
|
||
|
- }
|
||
|
-
|
||
|
- if (cparam.Optimize) {
|
||
|
- options += " -O ";
|
||
|
- }
|
||
|
-
|
||
|
- if (cparam.GenWarnings) {
|
||
|
- options += " -nowarn ";
|
||
|
- }
|
||
|
- options += " -encoding utf8 ";
|
||
|
-
|
||
|
- TempFileCollection tf = new TempFileCollection();
|
||
|
- // FIXME
|
||
|
- string compiler = "javac";
|
||
|
- string args = filename + " -classpath " + 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, ".class");
|
||
|
- }
|
||
|
-
|
||
|
- 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 + ".class";
|
||
|
- return exe;
|
||
|
- }
|
||
|
-
|
||
|
- string GetCompilerName (JavaCompilerParameters cp)
|
||
|
- {
|
||
|
- if (cp.Compiler == JavaCompiler.Gcj)
|
||
|
- {
|
||
|
- return "gcj"; // compile to bytecode
|
||
|
- }
|
||
|
-
|
||
|
- return "javac";
|
||
|
- }
|
||
|
-
|
||
|
- public ICompilerResult CompileProject(IProject project)
|
||
|
- {
|
||
|
- JavaProject p = (JavaProject)project;
|
||
|
- JavaCompilerParameters compilerparameters = (JavaCompilerParameters)p.ActiveConfiguration;
|
||
|
-
|
||
|
- string exe = fileUtilityService.GetDirectoryNameWithSeparator(compilerparameters.OutputDirectory) + compilerparameters.OutputAssembly + ".class";
|
||
|
- string options = "";
|
||
|
-
|
||
|
- string compiler = GetCompilerName (compilerparameters);
|
||
|
-
|
||
|
- if (compilerparameters.Debugmode)
|
||
|
- options += " -g ";
|
||
|
- else
|
||
|
- options += " -g:none ";
|
||
|
-
|
||
|
- if (compilerparameters.Optimize)
|
||
|
- options += " -O ";
|
||
|
-
|
||
|
- if (compilerparameters.Deprecation)
|
||
|
- options += " -deprecation ";
|
||
|
-
|
||
|
- if (compilerparameters.GenWarnings)
|
||
|
- options += " -nowarn ";
|
||
|
-
|
||
|
- if (compilerparameters.ClassPath == null)
|
||
|
- options += " -classpath " + compilerparameters.ClassPath;
|
||
|
-
|
||
|
- options += " -encoding utf8 ";
|
||
|
-
|
||
|
- //string output = "";
|
||
|
- //string error = "";
|
||
|
- string files = "";
|
||
|
-
|
||
|
- foreach (ProjectFile finfo in p.ProjectFiles) {
|
||
|
- if (finfo.Subtype != Subtype.Directory) {
|
||
|
- switch (finfo.BuildAction) {
|
||
|
- case BuildAction.Compile:
|
||
|
- files = files + " \"" + finfo.Name + "\"";
|
||
|
- break;
|
||
|
- }
|
||
|
- }
|
||
|
- }
|
||
|
-
|
||
|
- TempFileCollection tf = new TempFileCollection ();
|
||
|
- string args = "";
|
||
|
-
|
||
|
- if (compilerparameters.Compiler == JavaCompiler.Gcj)
|
||
|
- args = "-C ";
|
||
|
-
|
||
|
- string outdir = " -d " + compilerparameters.OutputDirectory;
|
||
|
-
|
||
|
- //FIXME re-enable options
|
||
|
- //FIXME re-enable compilerPath
|
||
|
- if (compilerparameters.ClassPath == "") {
|
||
|
- args += files + outdir;
|
||
|
- } else {
|
||
|
- args += " -classpath " + 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 ("Compiling...");
|
||
|
-
|
||
|
- 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 = "";
|
||
|
- 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 && col == "^")
|
||
|
- errorCol = next.IndexOf ("^");
|
||
|
-
|
||
|
- compilerOutput += next + "\n";
|
||
|
-
|
||
|
- int index1 = next.IndexOf(".java:");
|
||
|
- if (index1 < 0)
|
||
|
- continue;
|
||
|
-
|
||
|
- string s1 = next.Substring(0, index1);
|
||
|
- string s2 = next.Substring(index1 + 6);
|
||
|
- int index2 = s2.IndexOf(":");
|
||
|
- int line = Int32.Parse(next.Substring(index1 + 6,index2));
|
||
|
- //error.IsWarning = what[0] == "warning";
|
||
|
- //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) + ".java"); //Path.GetFileName(filename);
|
||
|
- cr.Errors.Add (error);
|
||
|
- }
|
||
|
-
|
||
|
- sr.Close ();
|
||
|
- return new DefaultCompilerResult (cr, compilerOutput);
|
||
|
- }
|
||
|
- }
|
||
|
-}
|
||
|
-
|
||
|
+// <file>
|
||
|
+// <copyright see="<A HREF="prj:///doc/copyright.txt"/">prj:///doc/copyright.txt"/</A>>
|
||
|
+// <license see="<A HREF="prj:///doc/license.txt"/">prj:///doc/license.txt"/</A>>
|
||
|
+// <owner name="Mike Krüger" email="<A HREF="http://lists.ximian.com/mailman/listinfo/monodevelop-patches-list">mike at icsharpcode.net</A>"/>
|
||
|
+// <version value="$version"/>
|
||
|
+// </file>
|
||
|
+
|
||
|
+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) == ".java";
|
||
|
+ }
|
||
|
+
|
||
|
+ public ICompilerResult CompileFile (string filename)
|
||
|
+ {
|
||
|
+ // we really dont support compiling single files
|
||
|
+ throw new NotImplementedException ();
|
||
|
+ }
|
||
|
+
|
||
|
+ public string GetCompiledOutputName (string fileName)
|
||
|
+ {
|
||
|
+ return Path.ChangeExtension (fileName, ".class");
|
||
|
+ }
|
||
|
+
|
||
|
+ 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 + ".class";
|
||
|
+ }
|
||
|
+
|
||
|
+ string GetCompilerName (JavaCompilerParameters cp)
|
||
|
+ {
|
||
|
+ if (cp.Compiler == JavaCompiler.Gcj)
|
||
|
+ {
|
||
|
+ return "gcj";
|
||
|
+ }
|
||
|
+
|
||
|
+ return "javac";
|
||
|
+ }
|
||
|
+
|
||
|
+ 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 + ".class");
|
||
|
+ string options = "";
|
||
|
+
|
||
|
+ string compiler = GetCompilerName (compilerparameters);
|
||
|
+
|
||
|
+ if (compilerparameters.Debugmode)
|
||
|
+ options += " -g ";
|
||
|
+ else
|
||
|
+ options += " -g:none ";
|
||
|
+
|
||
|
+ if (compilerparameters.Optimize)
|
||
|
+ options += " -O ";
|
||
|
+
|
||
|
+ if (compilerparameters.Deprecation)
|
||
|
+ options += " -deprecation ";
|
||
|
+
|
||
|
+ if (compilerparameters.GenWarnings)
|
||
|
+ options += " -nowarn ";
|
||
|
+
|
||
|
+ if (compilerparameters.ClassPath == null)
|
||
|
+ options += " -classpath " + compilerparameters.ClassPath;
|
||
|
+
|
||
|
+ options += " -encoding utf8 ";
|
||
|
+
|
||
|
+ string files = "";
|
||
|
+
|
||
|
+ foreach (ProjectFile finfo in project.ProjectFiles) {
|
||
|
+ if (finfo.Subtype != Subtype.Directory) {
|
||
|
+ switch (finfo.BuildAction) {
|
||
|
+ case BuildAction.Compile:
|
||
|
+ files = files + " \"" + finfo.Name + "\"";
|
||
|
+ break;
|
||
|
+ }
|
||
|
+ }
|
||
|
+ }
|
||
|
+
|
||
|
+ TempFileCollection tf = new TempFileCollection ();
|
||
|
+ string args = "";
|
||
|
+
|
||
|
+ if (compilerparameters.Compiler == JavaCompiler.Gcj)
|
||
|
+ args = "-C ";
|
||
|
+
|
||
|
+ //FIXME re-enable options
|
||
|
+ //FIXME re-enable compilerPath
|
||
|
+ if (compilerparameters.ClassPath == "") {
|
||
|
+ args += files + " -d " + outdir;
|
||
|
+ } else {
|
||
|
+ args += " -classpath " + compilerparameters.ClassPath + files + " -d " + 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 ("Compiling...");
|
||
|
+
|
||
|
+ 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 + ".class");
|
||
|
+ string asm = Path.GetFileNameWithoutExtension (outclass);
|
||
|
+
|
||
|
+ // sadly I dont think we can specify the output .class name
|
||
|
+ string args = String.Format ("{0} {1} -assembly:{2}", "*.class", "-reference:/usr/lib/IKVM.GNU.Classpath.dll", asm);
|
||
|
+ ProcessStartInfo si = new ProcessStartInfo ("ikvmc", 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 = "";
|
||
|
+ 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 && col == "^")
|
||
|
+ errorCol = next.IndexOf ("^");
|
||
|
+
|
||
|
+ compilerOutput += next + "\n";
|
||
|
+
|
||
|
+ int index1 = next.IndexOf (".java:");
|
||
|
+ if (index1 < 0)
|
||
|
+ continue;
|
||
|
+
|
||
|
+ string s1 = next.Substring (0, index1);
|
||
|
+ string s2 = next.Substring (index1 + 6);
|
||
|
+ int index2 = s2.IndexOf (":");
|
||
|
+ int line = Int32.Parse (next.Substring (index1 + 6, index2));
|
||
|
+ //error.IsWarning = what[0] == "warning";
|
||
|
+ //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) + ".java"); //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 @@
|
||
|
-// <file>
|
||
|
-// <copyright see="<A HREF="prj:///doc/copyright.txt"/">prj:///doc/copyright.txt"/</A>>
|
||
|
-// <license see="<A HREF="prj:///doc/license.txt"/">prj:///doc/license.txt"/</A>>
|
||
|
-// <owner name="Mike Krüger" email="<A HREF="http://lists.ximian.com/mailman/listinfo/monodevelop-patches-list">mike at icsharpcode.net</A>"/>
|
||
|
-// <version value="$version"/>
|
||
|
-// </file>
|
||
|
-
|
||
|
-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
|
||
|
-{
|
||
|
- /// <summary>
|
||
|
- /// This class controls the compilation of C Sharp files and C Sharp projects
|
||
|
- /// </summary>
|
||
|
- public class JavaBindingExecutionServices
|
||
|
- {
|
||
|
-
|
||
|
- public void Execute(string filename)
|
||
|
- {
|
||
|
- string exe = Path.GetFileNameWithoutExtension(filename);
|
||
|
- ProcessStartInfo psi = new ProcessStartInfo(Environment.GetEnvironmentVariable("ComSpec"), "/c java\"" + " & pause");
|
||
|
- psi.WorkingDirectory = Path.GetDirectoryName(filename);
|
||
|
- psi.UseShellExecute = false;
|
||
|
- try {
|
||
|
- Process p = new Process();
|
||
|
- p.StartInfo = psi;
|
||
|
- p.Start();
|
||
|
- } catch (Exception) {
|
||
|
- throw new ApplicationException("Can not execute " + "\"" + exe + "\"\n(Try restarting MonoDevelop or manual start)");
|
||
|
- }
|
||
|
- }
|
||
|
-
|
||
|
- 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 = "-e \"ikvm -classpath " + parameters.ClassPath + " " + mainClass + ";read -p 'press any key to continue...' -n1\"";
|
||
|
- break;
|
||
|
- // FIXME: need to both compile with ikvmc
|
||
|
- // and then run with mono
|
||
|
- case JavaRuntime.Mono:
|
||
|
- javaExec = "-e \"ikvm -classpath " + parameters.ClassPath + " " + mainClass + ";read -p 'press any key to continue...' -n1\"";
|
||
|
- break;
|
||
|
- case JavaRuntime.Java:
|
||
|
- javaExec = "-e \"java -classpath " + parameters.ClassPath + " " + mainClass + ";read -p 'press any key to continue...' -n1\"";
|
||
|
- break;
|
||
|
- case JavaRuntime.Gij:
|
||
|
- javaExec = "-e \"gij -classpath " + parameters.ClassPath + " " + mainClass + ";read -p 'press any key to continue...' -n1\"";
|
||
|
- break;
|
||
|
- default:
|
||
|
- javaExec = "-e \"ikvm -classpath " + parameters.ClassPath + " " + mainClass + ";read -p 'press any key to continue...' -n1\"";
|
||
|
- break;
|
||
|
- }
|
||
|
-
|
||
|
- ProcessStartInfo psi = new ProcessStartInfo("xterm", javaExec);
|
||
|
-
|
||
|
- try {
|
||
|
- psi.WorkingDirectory = Path.GetDirectoryName (directory);
|
||
|
- psi.UseShellExecute = false;
|
||
|
-
|
||
|
- Process p = new Process ();
|
||
|
- p.StartInfo = psi;
|
||
|
- p.Start ();
|
||
|
- } catch (Exception) {
|
||
|
- throw new ApplicationException ("Can not execute " + "\"" + directory + mainClass + "\"\n(Try restarting MonoDevelop or start your app manually)");
|
||
|
- }
|
||
|
-
|
||
|
-/*
|
||
|
- //FIXME: find out how to set the working dir better
|
||
|
- TerminalPad outputPad = (TerminalPad) WorkbenchSingleton.Workbench.GetPad (typeof (TerminalPad));
|
||
|
- outputPad.RunCommand ("cd " + parameters.OutputDirectory);
|
||
|
-
|
||
|
- string runtime = "ikvm"; // make it project.RuntimeOptions or so
|
||
|
- switch (runtime) {
|
||
|
- // is this even supposed to work with CLI binaries?
|
||
|
- //case "java": // use an installed jre
|
||
|
- // outputPad.RunCommand ("java -classpath " + parameters.ClassPath + " " + ((JavaCompilerParameters) project.ActiveConfiguration).MainClass);
|
||
|
- // break;
|
||
|
- case "ikvm": // JIT to Java then JIT to mono
|
||
|
- outputPad.RunCommand ("ikvm -classpath " + parameters.ClassPath + " " + ((JavaCompilerParameters) project.ActiveConfiguration).MainClass);
|
||
|
- break;
|
||
|
- default: // run compiled to exe with mono
|
||
|
- string command = "ikvmc -reference:/usr/lib/classpath.dll " + ((JavaCompilerParameters) project.ActiveConfiguration).MainClass + ".class ";
|
||
|
- string[] allJars = parameters.ClassPath.Split (':');
|
||
|
- foreach (string jar in allJars)
|
||
|
- {
|
||
|
- if (jar != ".")
|
||
|
- command += jar + " ";
|
||
|
- }
|
||
|
- outputPad.RunCommand (command);
|
||
|
- outputPad.RunCommand ("mono " + ((JavaCompilerParameters) project.ActiveConfiguration).MainClass + ".exe");
|
||
|
- break;
|
||
|
- }
|
||
|
- outputPad.RunCommand ("cd -");
|
||
|
-*/
|
||
|
- }
|
||
|
- }
|
||
|
-}
|
||
|
+// <file>
|
||
|
+// <copyright see="<A HREF="prj:///doc/copyright.txt"/">prj:///doc/copyright.txt"/</A>>
|
||
|
+// <license see="<A HREF="prj:///doc/license.txt"/">prj:///doc/license.txt"/</A>>
|
||
|
+// <owner name="Mike Krüger" email="<A HREF="http://lists.ximian.com/mailman/listinfo/monodevelop-patches-list">mike at icsharpcode.net</A>"/>
|
||
|
+// <version value="$version"/>
|
||
|
+// </file>
|
||
|
+
|
||
|
+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 ("Cannot execute a file.");
|
||
|
+ }
|
||
|
+
|
||
|
+ public void Execute (IProject project)
|
||
|
+ {
|
||
|
+ JavaCompilerParameters parameters = (JavaCompilerParameters) project.ActiveConfiguration;
|
||
|
+ string exe = ((JavaCompilerParameters) project.ActiveConfiguration).OutputAssembly;
|
||
|
+ exe = Path.ChangeExtension (exe, ".exe");
|
||
|
+ exe = Path.Combine (parameters.OutputDirectory, exe);
|
||
|
+
|
||
|
+ if (!File.Exists (exe))
|
||
|
+ {
|
||
|
+ IMessageService messageService = (IMessageService) ServiceManager.GetService (typeof (IMessageService));
|
||
|
+ messageService.ShowError (String.Format (GettextCatalog.GetString ("Error running {0}"), exe));
|
||
|
+ return;
|
||
|
+ }
|
||
|
+
|
||
|
+ string javaExec = String.Format ("-e \"mono {0}; echo; read -p 'press any key to continue...' -n1\"", exe);
|
||
|
+ ProcessStartInfo psi = new ProcessStartInfo ("xterm", javaExec);
|
||
|
+
|
||
|
+ try
|
||
|
+ {
|
||
|
+ psi.UseShellExecute = false;
|
||
|
+
|
||
|
+ Process p = new Process ();
|
||
|
+ p.StartInfo = psi;
|
||
|
+ p.Start ();
|
||
|
+ p.WaitForExit ();
|
||
|
+ }
|
||
|
+ catch
|
||
|
+ {
|
||
|
+ throw new ApplicationException (String.Format ("Cannot execute: {0}", 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 @@
|
||
|
-// <file>
|
||
|
-// <copyright see="<A HREF="prj:///doc/copyright.txt"/">prj:///doc/copyright.txt"/</A>>
|
||
|
-// <license see="<A HREF="prj:///doc/license.txt"/">prj:///doc/license.txt"/</A>>
|
||
|
-// <owner name="Mike Krüger" email="<A HREF="http://lists.ximian.com/mailman/listinfo/monodevelop-patches-list">mike at icsharpcode.net</A>"/>
|
||
|
-// <version value="$version"/>
|
||
|
-// </file>
|
||
|
-
|
||
|
-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
|
||
|
-{
|
||
|
- /// <summary>
|
||
|
- /// This class describes the main functionalaty of a language binding
|
||
|
- /// </summary>
|
||
|
- public class JavaLanguageBinding : ILanguageBinding
|
||
|
- {
|
||
|
- public const string LanguageName = "Java";
|
||
|
-
|
||
|
- 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);
|
||
|
- }
|
||
|
+// <file>
|
||
|
+// <copyright see="<A HREF="prj:///doc/copyright.txt"/">prj:///doc/copyright.txt"/</A>>
|
||
|
+// <license see="<A HREF="prj:///doc/license.txt"/">prj:///doc/license.txt"/</A>>
|
||
|
+// <owner name="Mike Krüger" email="<A HREF="http://lists.ximian.com/mailman/listinfo/monodevelop-patches-list">mike at icsharpcode.net</A>"/>
|
||
|
+// <version value="$version"/>
|
||
|
+// </file>
|
||
|
|
||
|
+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
|
||
|
+{
|
||
|
+ /// <summary>
|
||
|
+ /// This class describes the main functionalaty of a language binding
|
||
|
+ /// </summary>
|
||
|
+ public class JavaLanguageBinding : ILanguageBinding
|
||
|
+ {
|
||
|
+ public const string LanguageName = "Java";
|
||
|
+
|
||
|
+ 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 = \
|
||
|
-"../../../Libraries/MonoDevelop.Core/MonoDevelop.Core.dll" \
|
||
|
-"../../DisplayBindings/SourceEditor/MonoDevelop.SourceEditor.dll" \
|
||
|
-"../../../Libraries/MonoDevelop.Gui.Widgets/MonoDevelop.Gui.Widgets.dll" \
|
||
|
-"../../../Main/Base/MonoDevelop.Base.dll"
|
||
|
-
|
||
|
-PROJECT_REFERENCES_BUILD = $(addprefix -r:, $(PROJECT_REFERENCES))
|
||
|
-
|
||
|
MCS_OPTIONS =
|
||
|
|
||
|
all: JavaBinding.dll
|
||
|
|
||
|
JavaBinding.dll: $(SOURCES)
|
||
|
- mcs $(MCS_OPTIONS) -target:library -out:"JavaBinding.dll" $(PKG_REFERENCES_BUILD) $(PROJECT_REFERENCES_BUILD) $(SYSTEM_REFERENCES_BUILD) $(SOURCES) \
|
||
|
- && cp "JavaBinding.dll" ../../../build/bin/.
|
||
|
+ mcs $(MCS_OPTIONS) -target:library -out:"JavaBinding.dll" $(PKG_REFERENCES_BUILD) $(SYSTEM_REFERENCES_BUILD) $(SOURCES) \
|
||
|
+ && cp "JavaBinding.dll" ./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 @@
|
||
|
-// <file>
|
||
|
-// <copyright see="<A HREF="prj:///doc/copyright.txt"/">prj:///doc/copyright.txt"/</A>>
|
||
|
-// <license see="<A HREF="prj:///doc/license.txt"/">prj:///doc/license.txt"/</A>>
|
||
|
-// <owner name="Mike Krüger" email="<A HREF="http://lists.ximian.com/mailman/listinfo/monodevelop-patches-list">mike at icsharpcode.net</A>"/>
|
||
|
-// <version value="$version"/>
|
||
|
-// </file>
|
||
|
-
|
||
|
-using System;
|
||
|
-using System.Xml;
|
||
|
-using System.Diagnostics;
|
||
|
-
|
||
|
-using MonoDevelop.Internal.Project;
|
||
|
-
|
||
|
-namespace JavaBinding
|
||
|
-{
|
||
|
- /// <summary>
|
||
|
- /// This class handles project specific compiler parameters
|
||
|
- /// </summary>
|
||
|
- public class JavaCompilerParameters : AbstractProjectConfiguration
|
||
|
- {
|
||
|
- [XmlNodeName("CodeGeneration")]
|
||
|
- class CodeGeneration
|
||
|
- {
|
||
|
- [XmlAttribute("includedebuginformation")]
|
||
|
- public bool debugmode = true;
|
||
|
-
|
||
|
- [XmlAttribute("deprecation")]
|
||
|
- public bool deprecation = true;
|
||
|
-
|
||
|
- [XmlAttribute("optimize")]
|
||
|
- public bool optimize = true;
|
||
|
-
|
||
|
- [XmlAttribute("mainclass")]
|
||
|
- public string mainclass = null;
|
||
|
-
|
||
|
- [XmlAttribute("definesymbols")]
|
||
|
- public string definesymbols = String.Empty;
|
||
|
-
|
||
|
- [XmlAttribute("classpath")]
|
||
|
- public string classpath = String.Empty;
|
||
|
-
|
||
|
- [XmlAttribute ("compiler")]
|
||
|
- public JavaCompiler compiler = JavaCompiler.Gcj;
|
||
|
-
|
||
|
- [XmlAttribute ("runtime")]
|
||
|
- public JavaRuntime runtime = JavaRuntime.Ikvm;
|
||
|
-
|
||
|
- [XmlAttribute("compilerpath")]
|
||
|
- public string compilerpath = "gcj";
|
||
|
-
|
||
|
- [XmlAttribute("genwarnings")]
|
||
|
- public bool genwarnings = false;
|
||
|
- }
|
||
|
-
|
||
|
- [XmlNodeName("Execution")]
|
||
|
- class Execution
|
||
|
- {
|
||
|
- [XmlAttribute("consolepause")]
|
||
|
- 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;
|
||
|
- }
|
||
|
- }
|
||
|
-}
|
||
|
+// <file>
|
||
|
+// <copyright see="<A HREF="prj:///doc/copyright.txt"/">prj:///doc/copyright.txt"/</A>>
|
||
|
+// <license see="<A HREF="prj:///doc/license.txt"/">prj:///doc/license.txt"/</A>>
|
||
|
+// <owner name="Mike Krüger" email="<A HREF="http://lists.ximian.com/mailman/listinfo/monodevelop-patches-list">mike at icsharpcode.net</A>"/>
|
||
|
+// <version value="$version"/>
|
||
|
+// </file>
|
||
|
+
|
||
|
+using System;
|
||
|
+using System.Xml;
|
||
|
+using System.Diagnostics;
|
||
|
+
|
||
|
+using MonoDevelop.Internal.Project;
|
||
|
+
|
||
|
+namespace JavaBinding
|
||
|
+{
|
||
|
+ /// <summary>
|
||
|
+ /// This class handles project specific compiler parameters
|
||
|
+ /// </summary>
|
||
|
+ public class JavaCompilerParameters : AbstractProjectConfiguration
|
||
|
+ {
|
||
|
+ [XmlNodeName("CodeGeneration")]
|
||
|
+ class CodeGeneration
|
||
|
+ {
|
||
|
+ [XmlAttribute("includedebuginformation")]
|
||
|
+ public bool debugmode = true;
|
||
|
+
|
||
|
+ [XmlAttribute("deprecation")]
|
||
|
+ public bool deprecation = true;
|
||
|
+
|
||
|
+ [XmlAttribute("optimize")]
|
||
|
+ public bool optimize = true;
|
||
|
+
|
||
|
+ [XmlAttribute("mainclass")]
|
||
|
+ public string mainclass = null;
|
||
|
+
|
||
|
+ [XmlAttribute("definesymbols")]
|
||
|
+ public string definesymbols = String.Empty;
|
||
|
+
|
||
|
+ [XmlAttribute("classpath")]
|
||
|
+ public string classpath = String.Empty;
|
||
|
+
|
||
|
+ [XmlAttribute ("compiler")]
|
||
|
+ public JavaCompiler compiler = JavaCompiler.Gcj;
|
||
|
+ [XmlAttribute("compilerpath")]
|
||
|
+ public string compilerpath = "gcj";
|
||
|
+
|
||
|
+ [XmlAttribute("genwarnings")]
|
||
|
+ public bool genwarnings = false;
|
||
|
+ }
|
||
|
+
|
||
|
+ [XmlNodeName("Execution")]
|
||
|
+ class Execution
|
||
|
+ {
|
||
|
+ [XmlAttribute("consolepause")]
|
||
|
+ 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 @@
|
||
|
-// <file>
|
||
|
-// <copyright see="<A HREF="prj:///doc/copyright.txt"/">prj:///doc/copyright.txt"/</A>>
|
||
|
-// <license see="<A HREF="prj:///doc/license.txt"/">prj:///doc/license.txt"/</A>>
|
||
|
-// <owner name="Mike Krüger" email="<A HREF="http://lists.ximian.com/mailman/listinfo/monodevelop-patches-list">mike at icsharpcode.net</A>"/>
|
||
|
-// <version value="$version"/>
|
||
|
-// </file>
|
||
|
-
|
||
|
-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
|
||
|
-{
|
||
|
-
|
||
|
- /// <summary>
|
||
|
- /// This class describes a Java project and it compilation options.
|
||
|
- /// </summary>
|
||
|
- 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("Debug"));
|
||
|
- Configurations.Add(CreateConfiguration("Release"));
|
||
|
-
|
||
|
- XmlElement el = projectOptions;
|
||
|
-
|
||
|
- foreach (JavaCompilerParameters parameter in Configurations) {
|
||
|
- parameter.OutputDirectory = info.BinPath;
|
||
|
- parameter.OutputAssembly = Name;
|
||
|
-
|
||
|
- if (el != null) {
|
||
|
- if (el.Attributes["MainClass"] != null) {
|
||
|
- parameter.MainClass = el.Attributes["MainClass"].InnerText;
|
||
|
- }
|
||
|
- if (el.Attributes["PauseConsoleOutput"] != null) {
|
||
|
- parameter.PauseConsoleOutput = Boolean.Parse(el.Attributes["PauseConsoleOutput"].InnerText);
|
||
|
- }
|
||
|
- if (el.Attributes["ClassPath"] != null) {
|
||
|
- parameter.ClassPath = el.Attributes["ClassPath"].InnerText;
|
||
|
- }
|
||
|
- }
|
||
|
- }
|
||
|
- }
|
||
|
- }
|
||
|
- }
|
||
|
-}
|
||
|
+// <file>
|
||
|
+// <copyright see="<A HREF="prj:///doc/copyright.txt"/">prj:///doc/copyright.txt"/</A>>
|
||
|
+// <license see="<A HREF="prj:///doc/license.txt"/">prj:///doc/license.txt"/</A>>
|
||
|
+// <owner name="Mike Krüger" email="<A HREF="http://lists.ximian.com/mailman/listinfo/monodevelop-patches-list">mike at icsharpcode.net</A>"/>
|
||
|
+// <version value="$version"/>
|
||
|
+// </file>
|
||
|
+
|
||
|
+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
|
||
|
+{
|
||
|
+
|
||
|
+ /// <summary>
|
||
|
+ /// This class describes a Java project and it compilation options.
|
||
|
+ /// </summary>
|
||
|
+ 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("Debug"));
|
||
|
+ Configurations.Add(CreateConfiguration("Release"));
|
||
|
+
|
||
|
+ XmlElement el = projectOptions;
|
||
|
+
|
||
|
+ foreach (JavaCompilerParameters parameter in Configurations) {
|
||
|
+ parameter.OutputDirectory = info.BinPath;
|
||
|
+ parameter.OutputAssembly = Name;
|
||
|
+
|
||
|
+ if (el != null) {
|
||
|
+ if (el.Attributes["MainClass"] != null) {
|
||
|
+ parameter.MainClass = el.Attributes["MainClass"].InnerText;
|
||
|
+ }
|
||
|
+ if (el.Attributes["PauseConsoleOutput"] != null) {
|
||
|
+ parameter.PauseConsoleOutput = Boolean.Parse(el.Attributes["PauseConsoleOutput"].InnerText);
|
||
|
+ }
|
||
|
+ if (el.Attributes["ClassPath"] != null) {
|
||
|
+ parameter.ClassPath = el.Attributes["ClassPath"].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 @@
|
||
|
-// <file>
|
||
|
-// <copyright see="<A HREF="prj:///doc/copyright.txt"/">prj:///doc/copyright.txt"/</A>>
|
||
|
-// <license see="<A HREF="prj:///doc/license.txt"/">prj:///doc/license.txt"/</A>>
|
||
|
-// <owner name="Mike Krüger" email="<A HREF="http://lists.ximian.com/mailman/listinfo/monodevelop-patches-list">mike at icsharpcode.net</A>"/>
|
||
|
-// <version value="$version"/>
|
||
|
-// </file>
|
||
|
-
|
||
|
-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 < 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(".")) {
|
||
|
- 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 ("Icons.16x16.OpenFolderBitmap");
|
||
|
- //newFolderNode.ClosedImage = resourceService.GetBitmap ("Icons.16x16.ClosedFolderBitmap");
|
||
|
-
|
||
|
- currentPathNode.Nodes.Add(newFolderNode);
|
||
|
-
|
||
|
- }
|
||
|
- }
|
||
|
-
|
||
|
- // create file tree
|
||
|
- for (int i = 0; i < 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("Folder name construction failed, got unexpected parent node :" + folderNode);
|
||
|
- }
|
||
|
-
|
||
|
- }
|
||
|
-}
|
||
|
+// <file>
|
||
|
+// <copyright see="<A HREF="prj:///doc/copyright.txt"/">prj:///doc/copyright.txt"/</A>>
|
||
|
+// <license see="<A HREF="prj:///doc/license.txt"/">prj:///doc/license.txt"/</A>>
|
||
|
+// <owner name="Mike Krüger" email="<A HREF="http://lists.ximian.com/mailman/listinfo/monodevelop-patches-list">mike at icsharpcode.net</A>"/>
|
||
|
+// <version value="$version"/>
|
||
|
+// </file>
|
||
|
+
|
||
|
+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 < 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(".")) {
|
||
|
+ 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 ("Icons.16x16.OpenFolderBitmap");
|
||
|
+ //newFolderNode.ClosedImage = resourceService.GetBitmap ("Icons.16x16.ClosedFolderBitmap");
|
||
|
+
|
||
|
+ currentPathNode.Nodes.Add(newFolderNode);
|
||
|
+
|
||
|
+ }
|
||
|
+ }
|
||
|
+
|
||
|
+ // create file tree
|
||
|
+ for (int i = 0; i < 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("Folder name construction failed, got unexpected parent node :" + 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>
|