1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-27 11:05:49 +01:00
Gadgetbridge/app/build.gradle

221 lines
6.7 KiB
Groovy
Raw Normal View History

import com.github.spotbugs.SpotBugsTask
import java.nio.file.Files
apply plugin: "com.android.application"
apply plugin: "com.github.spotbugs"
apply plugin: "pmd"
apply plugin: 'com.google.protobuf'
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", 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 29
buildToolsVersion '30.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 29
multiDexEnabled true
2015-12-07 18:10:00 +01:00
// Note: always bump BOTH versionCode and versionName!
2021-12-11 22:02:51 +01:00
versionName "0.63.1"
versionCode 207
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
2015-01-07 14:00:18 +01:00
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
2015-01-07 14:00:18 +01: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")
}
testOptions {
2018-03-22 21:01:59 +01:00
unitTests {
returnDefaultValues = true
includeAndroidResources = true
}
}
2021-08-16 12:36:14 +02:00
externalNativeBuild {
cmake {
path "src/main/c/CMakeLists.txt"
version "3.10.2"
}
}
sourceSets {
main {
jniLibs.srcDirs = ['libs'] // where libs is the name of the directory!
}
}
2015-01-07 14:00:18 +01:00
}
pmd {
toolVersion = "5.5.5"
}
2015-01-07 14:00:18 +01:00
dependencies {
// testImplementation "ch.qos.logback:logback-classic:1.1.3"
// testImplementation "ch.qos.logback:logback-core:1.1.3"
2020-11-05 12:16:34 +01:00
implementation 'com.android.support.constraint:constraint-layout:2.0.4'
testImplementation "junit:junit:4.12"
testImplementation "org.mockito:mockito-core:1.10.19"
2019-05-25 00:07:21 +02:00
testImplementation "org.robolectric:robolectric:4.2.1"
2020-10-12 16:14:21 +02:00
testImplementation "com.google.code.gson:gson:2.8.6"
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "androidx.appcompat:appcompat:1.3.1"
implementation "androidx.preference:preference:1.1.1"
implementation "androidx.cardview:cardview:1.0.0"
implementation "androidx.recyclerview:recyclerview:1.2.1"
implementation "androidx.legacy:legacy-support-v4:1.0.0"
implementation "androidx.gridlayout:gridlayout:1.0.0"
implementation "androidx.multidex:multidex:2.0.1"
implementation "androidx.palette:palette:1.0.0"
implementation "com.google.android.material:material:1.4.0"
implementation 'com.google.android.flexbox:flexbox:3.0.0'
implementation "com.google.code.gson:gson:2.8.6"
2021-04-30 12:21:49 +02:00
implementation "no.nordicsemi.android:dfu:1.11.1"
implementation("com.github.tony19:logback-android-classic:1.1.1-6") {
exclude group: "com.google.android", module: "android"
}
2021-02-04 20:22:38 +01:00
implementation "org.slf4j:slf4j-api:1.7.24"
implementation "com.github.PhilJay:MPAndroidChart:v3.1.0"
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"
// 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.
implementation "org.greenrobot:greendao:2.2.1"
2019-05-23 22:02:25 +02:00
implementation "org.apache.commons:commons-lang3:3.7"
implementation "org.cyanogenmod:platform.sdk:6.0"
implementation 'com.jaredrummler:colorpicker:1.0.2'
// implementation project(":DaoCore")
implementation 'com.github.wax911:android-emojify:0.1.7'
implementation 'com.google.protobuf:protobuf-lite:3.0.1'
implementation "androidx.multidex:multidex:2.0.1"
2016-03-27 22:13:06 +02:00
}
preBuild.dependsOn(":GBDaoGenerator:genSources")
2016-03-27 22:13:06 +02:00
gradle.beforeProject {
preBuild.dependsOn(":GBDaoGenerator:genSources")
2015-01-07 14:00:18 +01:00
}
check.dependsOn "spotbugsMain", "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 {
2019-05-23 22:02:25 +02:00
destination file("$project.buildDir/reports/pmd/pmd.xml")
}
html {
2019-05-23 22:02:25 +02:00
destination file("$project.buildDir/reports/pmd/pmd.html")
}
}
}
// this is just for spotbugs to let the plugin create the task
sourceSets {
main {
main.java.srcDirs += "${protobuf.generatedFilesBaseDir}/main/javalite"
}
}
spotbugs {
toolVersion = "3.1.12"
ignoreFailures = !ABORT_ON_CHECK_FAILURE
effort = "default"
reportLevel = "medium"
}
tasks.withType(SpotBugsTask) {
source = fileTree('src/main/java')
classes = files("${project.rootDir}/app/build/intermediates/javac/debug/classes")
excludeFilter = new File("${project.rootDir}/config/findbugs/findbugs-filter.xml")
reports {
xml.enabled = false
html.enabled = true
xml {
destination file ("$project.buildDir/reports/spotbugs/spotbugs-output.xml")
}
html {
destination file ("$project.buildDir/reports/spotbugs/spotbugs-output.html")
}
}
}
protobuf {
protoc {
artifact = 'com.google.protobuf:protoc:3.0.0'
}
plugins {
javalite {
artifact = 'com.google.protobuf:protoc-gen-javalite:3.0.0'
}
}
generateProtoTasks {
all().each { task ->
task.builtins {
remove java
}
task.plugins {
javalite { }
}
}
}
}