I am writing annotation processor for my android project and I test it using google compile-testing.
It all works fine except that I am able to test apt plugnin argument to my annotation processor.
My annotation processor has this option that I want to test:
@Override
public Set<String> getSupportedOptions() {
Set<String> options = new HashSet<>();
options.add("generated_class_suffix");
return options;
}
I do not seem to get how I can pass this options to compile-testing library to test it. I tried withCompilerOptions
as follows:
assertAbout(javaSource())
.that(source)
.withCompilerOptions("saver_suffix")
.processedWith(new CodegenProcessor())
.compilesWithoutError()
.and()
.generatesSources(generated);
but it gives me following error:
java.lang.IllegalArgumentException: invalid flag: saver_suffix
I am not sure how to pass the option.