In my application I have a library developed by a 3rd party that unfortunately contains quite a few lint and javac warnings. I'd like to ignore both these types of warnings since they can't be fixed by our team and they are polluting our build logs. I have tried adding the following to the libraries build.gradle file:
In the android block
lintOptions {
ignoreWarnings = true
}
I also added the following to the end of the build.gradle file:
afterEvaluate {
tasks.withType(JavaCompile) {
it.options.compilerArgs << "-Xlint:none" << "-nowarn"
}
}
Unfortunately, whenever ":compileDebugJavaWithJavac" runs, it still outputs the warnings from this project. What am I doing wrong?
EDIT Here is the build.gradle file in its entirety
apply plugin: 'com.android.library'
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
}
android {
compileSdkVersion 21
buildToolsVersion "23.0.2"
lintOptions {
abortOnError false // true by default
checkAllWarnings false
checkReleaseBuilds false
ignoreWarnings true // false by default
quiet true // false by default
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
// Move the tests to tests/java, tests/res, etc...
instrumentTest.setRoot('tests')
// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
}
afterEvaluate {
tasks.withType(JavaCompile) {
it.options.compilerArgs << "-Xlint:none" << "-nowarn"
}
}
The following is an example of the warnings I am getting that I want to eliminate:
warning: [unchecked] unchecked call to isAssignableFrom(Class) as a member of the raw type Class if (type.isAssignableFrom(throwables[i].getClass()))