Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jdt-dev] How to detect or compile classes using the class I am compiling?

This is done by the Java builder. You should use the java builder instead of the java compiler only.
Or you can rewrite a builder which will do what you want.

Olivier


From: Morten Kjetland <mbk@xxxxxxxxxxxx>
To: jdt-dev@xxxxxxxxxxx
Date: 2011-03-07 08:44
Subject: [jdt-dev] How to detect or compile classes using the class I am        compiling?
Sent by: jdt-dev-bounces@xxxxxxxxxxx





Hi,

I have some code that compiles Java classes (from source) using org.eclipse.jdt.internal.compiler.Compiler.

It works just fine, but the following does not work:

If Class A uses class B, then the first time I compile A, then B gets compiled.
But if I choose to recompile B, then A will not get recompiled.

This results in for instance methodNotFound when A is calling a method in B that no longer exists.

I want to
a) detect that B is used by A, so I can manually recompile A when B is recompiled
b) or, make the compiler automatically recompile A when recompiling B.

This will result in a compiler-error when compiling A instead of runtime error when calling A.

I am using org.eclipse.jdt.internal.compiler.Compiler standalone in a custom Java project.

Does anyone have any ideas about how I can achieve this?

Regards,
Morten Kjetland_______________________________________________
jdt-dev mailing list
jdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jdt-dev



Back to the top