And*_*eaF 4 android intellij-idea gradle
当我使用 gradle 构建项目时,我看不到任何关于已弃用方法的警告,只显示错误。
我如何设置 build.gradle 以显示所有弃用警告(不阻止构建完成)?
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:deprecation"
}
Run Code Online (Sandbox Code Playgroud)
您可以放入顶级 build.gradle :
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:deprecation"
}
}
Run Code Online (Sandbox Code Playgroud)
或在您的模块一中:
apply plugin: 'com.android.application'
android {
...
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:deprecation"
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
3749 次 |
最近记录: |