Skip to content

Instantly share code, notes, and snippets.

@alexandrepossebom
Created November 13, 2014 12:24
Show Gist options
  • Save alexandrepossebom/d80d3d9835a4c9f60340 to your computer and use it in GitHub Desktop.
Save alexandrepossebom/d80d3d9835a4c9f60340 to your computer and use it in GitHub Desktop.
Gradle with static analysis tools (PMD,Findbugs,Lint) to use with Jenkins CI
apply plugin: 'com.android.application'
apply plugin: 'pmd'
apply plugin: 'findbugs'
android {
compileSdkVersion 21
buildToolsVersion "19.1.0"
defaultConfig {
applicationId "com.possebom.coritibawidget"
minSdkVersion 14
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
abortOnError false
}
}
task findbugs(type: FindBugs) {
ignoreFailures = true
classes = fileTree('build/intermediates/classes')
source = fileTree('src/main/java/')
classpath = files()
effort = 'max'
excludeFilter = file("../findbugs/exclude.xml")
reports {
xml.enabled = true
html.enabled = false
}
}
task pmd(type: Pmd) {
ignoreFailures = true
ruleSets = ["java-basic","java-android", "java-braces", "java-strings", "java-design", "java-unusedcode","java-unnecessary","java-optimizations","java-naming"]
source = fileTree('src/main/java/')
reports {
xml.enabled = true
html.enabled = false
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.0'
compile 'com.jakewharton:butterknife:6.0.0'
compile 'com.koushikdutta.androidasync:AndroidAsync:1.0.0'
}
<FindBugsFilter>
<Match>
<Class name="~.*R\$.*"/>
</Match>
</FindBugsFilter>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment