Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jdt-core-dev] about eclipse Java compiler

Hi, eclipse.

I want to use eclipse Java compiler with other software like ant
instead of SUN's compiler. I investigated how I can do. Finally I
found org.eclipse.jdt.internal.compiler.batch.Main is useful to do it.
But some of features aren't enough.

	- can't distinguish wheather compiling is success or not.
	- constructor and compile(String[] argv) method isn't public.

So, I wrote a patch briefly. Could you commit it?

regards,

Takashi Okamoto


--- org/eclipse/jdt/internal/compiler/batch/Main.java.orig	Mon Apr  1 00:19:51 2002
+++ org/eclipse/jdt/internal/compiler/batch/Main.java	Mon Apr  1 00:23:58 2002
@@ -79,7 +79,7 @@
 
 	private boolean proceed = true;
 
-	protected Main(PrintWriter writer, boolean systemExitWhenFinished) {
+	public Main(PrintWriter writer, boolean systemExitWhenFinished) {
 
 		this.out = writer;
 		this.systemExitWhenFinished = systemExitWhenFinished;
@@ -138,7 +138,7 @@
 	/*
 	 *  Low-level API performing the actual compilation
 	 */
-	protected void compile(String[] argv) {
+	public boolean compile(String[] argv) {
 
 		// decode command line arguments
 		try {
@@ -249,6 +249,11 @@
 			if (this.log != null) {
 				out.close();
 			}
+		}
+		if (globalErrorsCount == 0) {
+			return true;
+		} else {
+			return false;
 		}
 	}


Back to the top