How to recompile with -Xlint:deprecation

后端 未结 4 740
自闭症患者
自闭症患者 2020-12-13 13:15

I don\'t use Android Studio but I build everything from the command line using build.gradle. I generate a Lint report like this:

./gradlew lint
         


        
4条回答
  •  生来不讨喜
    2020-12-13 13:59

    To answer my own question, you need to add the following to your project-level build.gradle file:

    allprojects {
        ...
    
        gradle.projectsEvaluated {
            tasks.withType(JavaCompile) {
                options.compilerArgs << "-Xlint:deprecation"
            }
        }   
    }
    

提交回复
热议问题