Bug 1457255 - 3. Turn Java warnings into errors; r=nalexander

Turn Java warnings into errors except for the deprecation and serial
warnings. This is done for all Gradle projects except the thirdparty
project.
This commit is contained in:
Jim Chen 2018-05-01 00:22:54 -04:00
Родитель 0ce1010182
Коммит a1549b47c7
1 изменённых файлов: 17 добавлений и 1 удалений

Просмотреть файл

@ -99,7 +99,23 @@ if ('multi' == System.env.AB_CD) {
}
afterEvaluate {
subprojects {
subprojects { project ->
if (project.name != 'thirdparty') {
tasks.withType(JavaCompile) {
// Add compiler args for all code except third-party code.
options.compilerArgs += [
// Turn on all warnings, except...
"-Xlint:all",
// Deprecation, because we do use deprecated API for compatibility.
"-Xlint:-deprecation",
// Serial, because we don't use Java serialization.
"-Xlint:-serial",
// Turn all remaining warnings into errors,
// unless marked by @SuppressWarnings.
"-Werror"]
}
}
if (!hasProperty('android')) {
return
}