Open TWiStErRob opened 4 years ago
I found a workaround: https://github.com/TWiStErRob/repros/tree/master/parceler/fail-on-warning, but it's quite elaborate.
I like this idea. We could just change this decorator out for one that validates to an error based on an annotation processor configuration in this location: https://github.com/johncarl81/parceler/blob/master/parceler/src/main/java/org/parceler/internal/ParcelerInvocationBuilderStrategy.java#L40
Or use a validator that validates a warning to an error.
Something like dagger.moduleBindingValidation
would be nice.
Hmm, that actually gave me an idea for another workaround:
kapt {
javacOptions {
option("-Werror")
}
}
since these warnings are coming from Javac running the annotation processor on kapt stubs.
Finer control is still appreciated though. 🤓
It is possible that there are multiple annotation processors in one kapt run, and someone would want Parceler to error, but another one has to have the warning (e.g. one a project I work on DBFlow warns, and it can't be fixed); meaning -Werror
doesn't work here.
Given the following class:
I get this build output:
I'm looking for a way to make this warning an error, similar to how lint and javac and kotlinc allows me to.