Our old code bases use deprecated and unchecked APIs from time to time, and we get these in the output:
Note: C:\path\to\MyClass.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Ok, so how do I recompile with with -Xlint:unchecked from the command line, without changing build.gradle? Many other answers show how to fix it by adding this to build.gradle (or similar to build.gradle.kts):
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
but that requires editing files (creating git diffs) and is just a pain in the... Is there some way, environment variable, command-line option or something to add compiler args without touching the build.gradle* files?