2018-03-20 18:44:23 +01:00
|
|
|
apply plugin: "com.android.application"
|
|
|
|
apply plugin: "findbugs"
|
|
|
|
apply plugin: "pmd"
|
2016-08-30 01:25:43 +02:00
|
|
|
|
2018-03-20 18:44:23 +01:00
|
|
|
def ABORT_ON_CHECK_FAILURE = false
|
2015-01-07 14:00:18 +01:00
|
|
|
|
2016-08-30 01:25:43 +02:00
|
|
|
tasks.withType(Test) {
|
2018-03-20 18:44:23 +01:00
|
|
|
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-08-30 01:25:43 +02:00
|
|
|
}
|
2016-03-17 23:41:41 +01:00
|
|
|
|
2015-01-07 14:00:18 +01:00
|
|
|
android {
|
2016-08-26 23:27:53 +02:00
|
|
|
compileOptions {
|
|
|
|
// for KitKat
|
|
|
|
sourceCompatibility JavaVersion.VERSION_1_7
|
|
|
|
targetCompatibility JavaVersion.VERSION_1_7
|
|
|
|
}
|
2018-01-20 21:27:37 +01:00
|
|
|
compileSdkVersion 27
|
2018-10-28 21:31:09 +01:00
|
|
|
buildToolsVersion '28.0.3'
|
2015-01-07 14:00:18 +01:00
|
|
|
|
|
|
|
defaultConfig {
|
2016-04-29 23:24:12 +02:00
|
|
|
applicationId "nodomain.freeyourgadget.gadgetbridge"
|
2015-11-23 22:49:11 +01:00
|
|
|
minSdkVersion 19
|
2018-01-20 21:27:37 +01:00
|
|
|
targetSdkVersion 27
|
2015-12-07 18:10:00 +01:00
|
|
|
|
2018-03-20 18:44:23 +01:00
|
|
|
// Note: always bump BOTH versionCode and versionName!
|
2018-11-03 00:27:23 +01:00
|
|
|
versionName "0.31.0"
|
|
|
|
versionCode 139
|
2016-10-21 13:01:30 +02:00
|
|
|
vectorDrawables.useSupportLibrary = true
|
2015-01-07 14:00:18 +01:00
|
|
|
}
|
|
|
|
buildTypes {
|
|
|
|
release {
|
|
|
|
minifyEnabled false
|
2018-03-20 18:44:23 +01:00
|
|
|
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
|
2015-01-07 14:00:18 +01:00
|
|
|
}
|
|
|
|
}
|
2015-08-15 22:36:45 +02:00
|
|
|
|
|
|
|
lintOptions {
|
|
|
|
abortOnError ABORT_ON_CHECK_FAILURE
|
|
|
|
lintConfig file("${project.rootDir}/config/lint/lint.xml")
|
2018-03-20 18:44:23 +01:00
|
|
|
// If true, generate an HTML report (with issue explanations, sourcecode, etc)
|
2015-08-15 22:36:45 +02:00
|
|
|
htmlReport true
|
2018-03-20 18:44:23 +01:00
|
|
|
// Optional path to report (default will be lint-results.html in the builddir)
|
2015-08-15 22:36:45 +02:00
|
|
|
htmlOutput file("$project.buildDir/reports/lint/lint.html")
|
|
|
|
}
|
2015-08-22 01:08:46 +02:00
|
|
|
|
|
|
|
testOptions {
|
2018-03-22 21:01:59 +01:00
|
|
|
unitTests {
|
|
|
|
returnDefaultValues = true
|
|
|
|
includeAndroidResources = true
|
|
|
|
}
|
2015-08-22 01:08:46 +02:00
|
|
|
}
|
2015-01-07 14:00:18 +01:00
|
|
|
}
|
|
|
|
|
2016-08-26 22:27:17 +02:00
|
|
|
pmd {
|
2018-03-20 18:44:23 +01:00
|
|
|
toolVersion = "5.5.5"
|
2016-08-26 22:27:17 +02:00
|
|
|
}
|
|
|
|
|
2015-01-07 14:00:18 +01:00
|
|
|
dependencies {
|
2018-03-20 18:44:23 +01:00
|
|
|
// testImplementation "ch.qos.logback:logback-classic:1.1.3"
|
|
|
|
// testImplementation "ch.qos.logback:logback-core:1.1.3"
|
|
|
|
testImplementation "junit:junit:4.12"
|
|
|
|
testImplementation "org.mockito:mockito-core:1.10.19"
|
2018-03-22 21:01:59 +01:00
|
|
|
testImplementation "org.robolectric:robolectric:3.6.1"
|
2018-03-20 18:44:23 +01:00
|
|
|
|
|
|
|
implementation fileTree(dir: "libs", include: ["*.jar"])
|
2018-04-29 23:10:28 +02:00
|
|
|
implementation "com.android.support:appcompat-v7:27.1.1"
|
|
|
|
implementation "com.android.support:cardview-v7:27.1.1"
|
|
|
|
implementation "com.android.support:recyclerview-v7:27.1.1"
|
|
|
|
implementation "com.android.support:support-v4:27.1.1"
|
|
|
|
implementation "com.android.support:gridlayout-v7:27.1.1"
|
|
|
|
implementation "com.android.support:design:27.1.1"
|
|
|
|
implementation "com.android.support:palette-v7:27.1.1"
|
2018-03-20 18:44:23 +01:00
|
|
|
implementation("com.github.tony19:logback-android-classic:1.1.1-6") {
|
|
|
|
exclude group: "com.google.android", module: "android"
|
2017-11-14 11:01:29 +01:00
|
|
|
}
|
2018-03-20 18:44:23 +01:00
|
|
|
implementation "org.slf4j:slf4j-api:1.7.12"
|
|
|
|
implementation "com.github.Freeyourgadget:MPAndroidChart:5e5bd6c1d3e95c515d4853647ae554e48ee1d593"
|
|
|
|
implementation "com.github.pfichtner:durationformatter:0.1.1"
|
|
|
|
implementation "de.cketti.library.changelog:ckchangelog:1.2.2"
|
|
|
|
implementation "net.e175.klaus:solarpositioning:0.0.9"
|
2017-04-10 21:36:44 +02:00
|
|
|
// 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.
|
2018-03-20 18:44:23 +01:00
|
|
|
implementation "org.greenrobot:greendao:2.2.1"
|
|
|
|
implementation "org.apache.commons:commons-lang3:3.5"
|
|
|
|
implementation "org.cyanogenmod:platform.sdk:6.0"
|
2018-07-28 17:23:58 +02:00
|
|
|
implementation 'com.jaredrummler:colorpicker:1.0.2'
|
2018-03-20 18:44:23 +01:00
|
|
|
// implementation project(":DaoCore")
|
2016-03-27 22:13:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
preBuild.dependsOn(":GBDaoGenerator:genSources")
|
2018-03-20 18:44:23 +01:00
|
|
|
|
2016-03-27 22:13:06 +02:00
|
|
|
gradle.beforeProject {
|
|
|
|
preBuild.dependsOn(":GBDaoGenerator:genSources")
|
2015-01-07 14:00:18 +01:00
|
|
|
}
|
2015-08-15 22:36:45 +02:00
|
|
|
|
2018-03-20 18:44:23 +01:00
|
|
|
check.dependsOn "findbugs", "pmd", "lint"
|
2015-08-15 22:36:45 +02:00
|
|
|
|
|
|
|
task pmd(type: Pmd) {
|
|
|
|
ruleSetFiles = files("${project.rootDir}/config/pmd/pmd-ruleset.xml")
|
|
|
|
ignoreFailures = !ABORT_ON_CHECK_FAILURE
|
|
|
|
ruleSets = [
|
2018-03-20 18:44:23 +01:00
|
|
|
"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"
|
2015-08-15 22:36:45 +02:00
|
|
|
]
|
|
|
|
|
2018-03-20 18:44:23 +01:00
|
|
|
source "src"
|
|
|
|
include "**/*.java"
|
|
|
|
exclude "**/gen/**"
|
2015-08-15 22:36:45 +02:00
|
|
|
|
|
|
|
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")
|
2018-09-29 21:49:13 +02:00
|
|
|
classes = files("${project.rootDir}/app/build/intermediates/javac/release/compileReleaseJavaWithJavac/classes")
|
2018-03-20 18:44:23 +01:00
|
|
|
source = fileTree("src/main/java/")
|
2015-08-15 22:36:45 +02:00
|
|
|
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"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|