Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage of "proc:only" flag possible? #181

Open
Chessray opened this issue Nov 22, 2019 · 0 comments
Open

Usage of "proc:only" flag possible? #181

Chessray opened this issue Nov 22, 2019 · 0 comments
Labels

Comments

@Chessray
Copy link

Hi,

I just stumbled on this amazing project, but must be missing something quite basic:

So I've written an AnnotationProcessor that generates a Java output file. The idea is to replace a whole bunch of (so far) handwritten files which are virtually identical except for one import (let's not go into the details, I've just started). So my simple test idea was to use one of those existing files as expected generated output. But what happens is that the tool tries to compile the generated file - which fails due to the missing imports. I don't want to copy half of our sourcecode around, I'd be happy if it ran only the annotation processor.

I tried this:
final Compilation compilation = javac().withProcessors(processor).withOptions("-proc:only") .compile(JavaFileObjects.forResource("AnnotatedResource.java"));

But it's still telling me:
java.lang.IllegalStateException: compilation failed, so generated files are unavailable. Compilation produced the following diagnostics: /SOURCE_OUTPUT/<path/to/generated/file> etc.

What am I doing wrong?

@cgdecker cgdecker added the P3 label Dec 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants