#826 -Adding checkstyle to TestApp build process.

This commit is contained in:
Brad Leege
2015-02-09 17:51:46 -08:00
parent 9c5f1c0608
commit c7d4f7d256
2 changed files with 206 additions and 1 deletions

View File

@@ -8,6 +8,7 @@ buildscript {
}
apply plugin: 'com.android.application'
apply plugin: 'checkstyle'
task accessToken {
def rawDir = new File("app/src/main/res/raw")
@@ -55,6 +56,7 @@ android {
lintOptions {
checkAllWarnings true
disable 'UnusedAttribute'
abortOnError false
//disable 'IconDensities'
}
@@ -67,9 +69,27 @@ android {
}
dependencies {
compile project(':lib')
compile(project(':lib')) {
transitive = true
}
compile 'com.android.support:support-annotations:21.0.0'
compile 'com.android.support:support-v4:21.0.3'
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.mapzen.android:lost:0.2'
}
checkstyle {
configFile project.file('../checks.xml')
showViolations true
}
android.applicationVariants.all { variant ->
def name = variant.buildType.name
def checkstyle = project.tasks.create "checkstyle${name.capitalize()}", Checkstyle
checkstyle.dependsOn variant.javaCompile
checkstyle.source variant.javaCompile.source
checkstyle.classpath = project.fileTree(variant.javaCompile.destinationDir)
checkstyle.exclude('**/BuildConfig.java')
checkstyle.exclude('**/R.java')
project.tasks.getByName("check").dependsOn checkstyle
}