How can i Run Annotation Processor without compiling sources using javac (Java 8 can't use Apt)?
Is there any parameter for javac that could run only annotation processing without compiling all files?
What i want to do by javac:
Just find annotated elements and process them using defined annotation processor using -processor
flag
do not compile any source that doesn't have any annotation
Because i want do this on Java 8 it's impossible to use Apt for this task? Or maybe it is?
The apt
tool is not available in Java 8. Based on what is said here, porting apt
to Java 8 would not be straight-forward.
According to the javac
manual entry:
-proc: [none, only]
Controls whether annotation processing and compilation are done.
-proc:none
means that compilation takes place without annotation processing.-proc:only
means that only annotation processing is done, without any subsequent compilation.
It sounds like -proc:only
would do what you want to do. If not, then you would need to look for a 3rd-party tool, or develop a tool yourself.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With