-
Notifications
You must be signed in to change notification settings - Fork 16
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
Skip checks for generated code #106
Comments
Sometimes, checkers should be disabled for a particular compile task. Add a `checkerFramework` extension to each compile task which can be used for configuration. Partially fixes kelloggm#110 (task-dependent configuration) and kelloggm#106 (skip checks for autogenerated code).
Unfortunately, the proposed 'skip option' does work with protobuf generators and AutoValue. At the moment of configuration, JavaCompile task knows nothing about generated java source based on protobuf. The GenerateProtoTask links them to the JavaCompile task once the GenerateProtoTask has been executed. I did some experiments (see below). tasks.withType(JavaCompile).configureEach {
println(name)
for (src in source) {
println(src)
}
println()
} It does not print paths to the generated sources. However, the following snippet does: tasks.withType(JavaCompile).configureEach {
doFirst {
println(name)
for (src in source) {
println(src)
}
println()
}
} Adding the following snippet after checkerFramework {
skipCheckerFramework = true
} And adding the snippet above after I am not sure that I am looking for a very easy solution here. The most universal one is just to avoid ${project.buildDir}/generated/ sources at all. That should work for everything. I don't have a lot of time here. However, if you provide some tips/thoughts on how to do that I can give you a try with a pull request :-) Anyway, thanks for the attempt. |
Perhaps, if in the main |
Is there a way to skip generated code? This is useful for protobufs, autovalue, etc.
I know about -AskipDefs=. But it's a not 100% solution since much more (less) classes might be accidentally masked.
The text was updated successfully, but these errors were encountered: