Skip to content

Instantly share code, notes, and snippets.

@RyanMagnusson
Forked from PaulRashidi/build.gradle
Created March 28, 2018 21:22
Show Gist options
  • Save RyanMagnusson/f0d1a5d30d97518a311e6699caad57e5 to your computer and use it in GitHub Desktop.
Save RyanMagnusson/f0d1a5d30d97518a311e6699caad57e5 to your computer and use it in GitHub Desktop.
Android Gradle deprecation flag for java compilation
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
// Add this snippet to main project build file like this.
allprojects {
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment