1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-04 17:27:24 +01:00
Gadgetbridge/app/build.gradle

158 lines
4.9 KiB
Groovy
Raw Normal View History

2015-01-07 14:00:18 +01:00
apply plugin: 'com.android.application'
apply plugin: 'findbugs'
apply plugin: 'pmd'
def ABORT_ON_CHECK_FAILURE=false
2015-01-07 14:00:18 +01:00
tasks.withType(Test) {
systemProperty 'MiFirmwareDir', System.getProperty('MiFirmwareDir', null)
systemProperty 'logback.configurationFile', System.getProperty('user.dir', null) + '/app/src/main/assets/logback.xml'
systemProperty 'GB_LOGFILES_DIR', java.nio.file.Files.createTempDirectory('gblog').toString();
}
2016-03-17 23:41:41 +01:00
2015-01-07 14:00:18 +01:00
android {
compileOptions {
// for KitKat
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
compileSdkVersion 25
buildToolsVersion '26.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
targetSdkVersion 25
2015-12-07 18:10:00 +01:00
// note: always bump BOTH versionCode and versionName!
2018-01-20 14:21:08 +01:00
versionName "0.24.1"
versionCode 118
vectorDrawables.useSupportLibrary = true
2015-01-07 14:00:18 +01:00
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
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")
}
testOptions {
unitTests.returnDefaultValues = true
}
2015-01-07 14:00:18 +01:00
}
pmd {
2017-04-08 23:59:00 +02:00
toolVersion = '5.5.5'
}
2015-01-07 14:00:18 +01:00
dependencies {
// testCompile 'ch.qos.logback:logback-classic:1.1.3'
// testCompile 'ch.qos.logback:logback-core:1.1.3'
testCompile 'junit:junit:4.12'
2017-11-14 12:55:02 +01:00
testCompile "org.mockito:mockito-core:1.10.19"
testCompile "org.robolectric:robolectric:3.5.1"
2015-01-07 14:00:18 +01:00
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.4.0'
compile 'com.android.support:cardview-v7:25.4.0'
compile 'com.android.support:recyclerview-v7:25.4.0'
compile 'com.android.support:support-v4:25.4.0'
compile 'com.android.support:gridlayout-v7:25.4.0'
compile 'com.android.support:design:25.4.0'
compile 'com.android.support:palette-v7:25.4.0'
compile('com.github.tony19:logback-android-classic:1.1.1-6') {
exclude group: 'com.google.android', module: 'android'
}
2017-11-14 12:55:02 +01:00
compile 'org.slf4j:slf4j-api:1.7.12'
compile 'com.github.Freeyourgadget:MPAndroidChart:40c924deab89945a2c7820f51c2fed8b1b803cb4'
compile 'com.github.pfichtner:durationformatter:0.1.1'
compile 'de.cketti.library.changelog:ckchangelog:1.2.2'
compile 'net.e175.klaus:solarpositioning:0.0.9'
// use pristine greendao instead of our custom version, since our custom jitpack-packaged
// version contains way too much and our custom patches are in the generator only.
compile 'org.greenrobot:greendao:2.2.1'
2017-04-08 23:36:16 +02:00
compile 'org.apache.commons:commons-lang3:3.5'
compile 'org.cyanogenmod:platform.sdk:6.0'
// compile project(":DaoCore")
2016-03-27 22:13:06 +02:00
}
preBuild.dependsOn(":GBDaoGenerator:genSources")
gradle.beforeProject {
preBuild.dependsOn(":GBDaoGenerator:genSources")
2015-01-07 14:00:18 +01: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"
}
}
}