I use Gradle to build my Java project with the following settings to treat warnings as errors:
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Werror"
}
Now we would like to work on some experimental research stuff in a certain class (let's call it Experimental.java) which throws some warnings (warning: XYZ is internal proprietary API and may be removed in a future release). This leads to the problem that the whole project does not build.
Can we exclude a certain class from being checked based on -Werror (i.e., "don't check Experimental.java")? Or can we tell -Werror to ignore a certain warning (i.e., "don't treat internal proprietary API warning as error")? We don't want to turn off -Werror completely, other classes should still be treated that way.