2015-01-07 14:00:18 +01:00
|
|
|
apply plugin: 'com.android.application'
|
2015-08-15 22:36:45 +02:00
|
|
|
apply plugin: 'findbugs'
|
|
|
|
apply plugin: 'pmd'
|
|
|
|
|
|
|
|
def ABORT_ON_CHECK_FAILURE=false
|
2015-01-07 14:00:18 +01:00
|
|
|
|
|
|
|
android {
|
2015-08-29 00:12:51 +02:00
|
|
|
compileSdkVersion 23
|
2015-11-01 23:32:43 +01:00
|
|
|
buildToolsVersion "23.0.2"
|
2015-01-07 14:00:18 +01:00
|
|
|
|
|
|
|
defaultConfig {
|
|
|
|
applicationId "nodomain.freeyourgadget.gadgetbridge"
|
2015-11-23 22:49:11 +01:00
|
|
|
minSdkVersion 19
|
2015-08-29 00:12:51 +02:00
|
|
|
targetSdkVersion 23
|
2015-12-07 18:10:00 +01:00
|
|
|
|
|
|
|
// note: always bump BOTH versionCode and versionName!
|
2015-12-08 18:35:45 +01:00
|
|
|
versionName "0.6.9"
|
|
|
|
versionCode 35
|
2015-01-07 14:00:18 +01:00
|
|
|
}
|
|
|
|
buildTypes {
|
|
|
|
release {
|
|
|
|
minifyEnabled false
|
|
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
|
|
}
|
|
|
|
}
|
2015-08-15 22:36:45 +02:00
|
|
|
|
|
|
|
lintOptions {
|
|
|
|
abortOnError ABORT_ON_CHECK_FAILURE
|
|
|
|
lintConfig file("${project.rootDir}/config/lint/lint.xml")
|
|
|
|
|
|
|
|
// if true, generate an HTML report (with issue explanations, sourcecode, etc)
|
|
|
|
htmlReport true
|
|
|
|
// optional path to report (default will be lint-results.html in the builddir)
|
|
|
|
htmlOutput file("$project.buildDir/reports/lint/lint.html")
|
|
|
|
}
|
2015-08-22 01:08:46 +02:00
|
|
|
|
|
|
|
testOptions {
|
|
|
|
unitTests.returnDefaultValues = true
|
|
|
|
}
|
2015-01-07 14:00:18 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2015-08-22 01:08:46 +02:00
|
|
|
testCompile 'junit:junit:4.12'
|
|
|
|
testCompile "org.mockito:mockito-core:1.9.5"
|
|
|
|
|
2015-01-07 14:00:18 +01:00
|
|
|
compile fileTree(dir: 'libs', include: ['*.jar'])
|
2015-11-23 21:38:09 +01:00
|
|
|
compile 'com.android.support:appcompat-v7:23.1.1'
|
|
|
|
compile 'com.android.support:support-v4:23.1.1'
|
2015-10-26 22:55:24 +01:00
|
|
|
compile 'com.github.tony19:logback-android-classic:1.1.1-4'
|
2015-05-13 23:15:20 +02:00
|
|
|
compile 'org.slf4j:slf4j-api:1.7.7'
|
2015-11-13 23:57:04 +01:00
|
|
|
compile 'com.github.PhilJay:MPAndroidChart:v2.1.6'
|
2015-07-20 23:11:16 +02:00
|
|
|
compile 'com.github.pfichtner:durationformatter:0.1.1'
|
2015-01-07 14:00:18 +01:00
|
|
|
}
|
2015-08-15 22:36:45 +02:00
|
|
|
|
|
|
|
check.dependsOn 'findbugs', 'pmd', 'lint'
|
|
|
|
|
|
|
|
task pmd(type: Pmd) {
|
|
|
|
ruleSetFiles = files("${project.rootDir}/config/pmd/pmd-ruleset.xml")
|
|
|
|
ignoreFailures = !ABORT_ON_CHECK_FAILURE
|
|
|
|
ruleSets = [
|
|
|
|
'java-android',
|
|
|
|
'java-basic',
|
|
|
|
'java-braces',
|
|
|
|
'java-clone',
|
|
|
|
'java-codesize',
|
|
|
|
'java-controversial',
|
|
|
|
'java-coupling',
|
|
|
|
'java-design',
|
|
|
|
'java-empty',
|
|
|
|
'java-finalizers',
|
|
|
|
'java-imports',
|
|
|
|
'java-junit',
|
|
|
|
'java-optimizations',
|
|
|
|
'java-strictexception',
|
|
|
|
'java-strings',
|
|
|
|
'java-sunsecure',
|
|
|
|
'java-typeresolution',
|
|
|
|
'java-unnecessary',
|
|
|
|
'java-unusedcode'
|
|
|
|
]
|
|
|
|
|
|
|
|
source 'src'
|
|
|
|
include '**/*.java'
|
|
|
|
exclude '**/gen/**'
|
|
|
|
|
|
|
|
reports {
|
|
|
|
xml.enabled = false
|
|
|
|
html.enabled = true
|
|
|
|
xml {
|
|
|
|
destination "$project.buildDir/reports/pmd/pmd.xml"
|
|
|
|
}
|
|
|
|
html {
|
|
|
|
destination "$project.buildDir/reports/pmd/pmd.html"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
task findbugs(type: FindBugs) {
|
|
|
|
ignoreFailures = !ABORT_ON_CHECK_FAILURE
|
|
|
|
effort = "default"
|
|
|
|
reportLevel = "medium"
|
|
|
|
excludeFilter = new File("${project.rootDir}/config/findbugs/findbugs-filter.xml")
|
|
|
|
classes = files("${project.rootDir}/app/build/intermediates/classes")
|
|
|
|
source = fileTree('src/main/java/')
|
|
|
|
classpath = files()
|
|
|
|
reports {
|
|
|
|
xml.enabled = false
|
|
|
|
html.enabled = true
|
|
|
|
xml {
|
|
|
|
destination "$project.buildDir/reports/findbugs/findbugs-output.xml"
|
|
|
|
}
|
|
|
|
html {
|
|
|
|
destination "$project.buildDir/reports/findbugs/findbugs-output.html"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|