AndroidAPS/app/build.gradle

274 lines
9.6 KiB
Groovy
Raw Normal View History

2016-06-24 17:48:11 +02:00
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
2018-01-10 23:31:31 +01:00
jcenter()
2016-06-24 17:48:11 +02:00
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
2018-01-10 23:31:31 +01:00
classpath 'com.dicedmelon.gradle:jacoco-android:0.1.2'
2016-06-24 17:48:11 +02:00
}
}
2018-01-13 21:34:38 +01:00
apply plugin: "com.android.application"
apply plugin: "io.fabric"
apply plugin: "jacoco-android"
2018-01-24 21:54:24 +01:00
apply plugin: 'com.jakewharton.butterknife'
2018-01-13 21:34:38 +01:00
ext {
supportLibraryVersion = "27.1.0"
2018-01-13 21:34:38 +01:00
ormLiteVersion = "4.46"
powermockVersion = "1.7.3"
dexmakerVersion = "1.2"
2018-04-02 22:43:20 +02:00
butterknifeVersion = "8.8.1"
2018-01-13 21:34:38 +01:00
}
2016-06-24 17:48:11 +02:00
repositories {
maven { url 'https://maven.fabric.io/public' }
2018-03-26 13:25:53 +02:00
jcenter { url "https://jcenter.bintray.com/" }
2016-06-24 17:48:11 +02:00
}
def generateGitBuild = { ->
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append('"')
try {
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'describe', '--always'
standardOutput = stdout
}
String commitObject = stdout.toString().trim()
stringBuilder.append(commitObject)
} catch (ignored) {
2016-11-08 22:55:08 +01:00
stringBuilder.append('NoGitSystemAvailable')
}
stringBuilder.append('-')
2018-05-13 12:32:45 +02:00
stringBuilder.append((new Date()).format('yyyy.MM.dd-HH:mm'))
stringBuilder.append('"')
return stringBuilder.toString()
}
2016-06-04 17:28:05 +02:00
2018-04-20 17:27:31 +02:00
tasks.matching { it instanceof Test }.all {
2018-04-11 16:23:35 +02:00
testLogging.events = ["failed", "skipped", "started"]
testLogging.exceptionFormat = "full"
}
2016-06-04 17:28:05 +02:00
android {
compileSdkVersion 27
2016-06-04 17:28:05 +02:00
defaultConfig {
applicationId "info.nightscout.androidaps"
minSdkVersion 21
2018-04-04 21:38:44 +02:00
targetSdkVersion 25
2017-10-15 02:52:57 +02:00
multiDexEnabled true
2017-06-04 22:37:58 +02:00
versionCode 1500
2018-07-31 22:08:35 +02:00
version "2.0c-dev"
2017-02-23 20:00:33 +01:00
buildConfigField "String", "VERSION", '"' + version + '"'
buildConfigField "String", "BUILDVERSION", generateGitBuild()
2018-03-31 15:00:32 +02:00
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
2017-09-13 00:35:03 +02:00
ndk {
moduleName "BleCommandUtil"
}
2016-06-04 17:28:05 +02:00
}
2016-10-21 22:16:20 +02:00
lintOptions {
// TODO remove once wear dependency com.google.android.gms:play-services-wearable:7.3.0
// has been upgraded (requiring significant code changes), which currently fails release
// build with a deprecation warning
2018-04-04 21:38:44 +02:00
abortOnError false
// (disabled entirely to avoid reports on the error, which would still be displayed
// and it's easy to overlook that it's ignored)
checkReleaseBuilds false
2016-10-21 22:16:20 +02:00
disable 'MissingTranslation'
2018-01-11 14:14:53 +01:00
disable 'ExtraTranslation'
2016-10-21 22:16:20 +02:00
}
2016-06-04 17:28:05 +02:00
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
2018-01-10 23:31:31 +01:00
debug {
2018-04-20 17:27:31 +02:00
testCoverageEnabled(project.hasProperty('coverage') ? true : false)
2018-01-10 23:31:31 +01:00
}
2016-06-04 17:28:05 +02:00
}
2016-07-15 23:53:14 +02:00
productFlavors {
2017-10-12 18:24:48 +02:00
flavorDimensions "standard"
2017-02-10 16:53:39 +01:00
full {
2016-11-26 05:31:23 +01:00
dimension "standard"
2017-02-23 20:00:33 +01:00
resValue "string", "app_name", "AndroidAPS"
versionName version
manifestPlaceholders = [
2018-06-14 19:43:16 +02:00
appIcon: "@mipmap/ic_launcher",
appIconRound: "@mipmap/ic_launcher_round"
]
buildConfigField "boolean", "APS", "true"
buildConfigField "boolean", "PUMPDRIVERS", "true"
2017-02-23 20:00:33 +01:00
buildConfigField "boolean", "NSCLIENTOLNY", "false"
2017-11-29 16:07:26 +01:00
buildConfigField "boolean", "G5UPLOADER", "false"
2018-01-14 17:11:39 +01:00
buildConfigField "boolean", "PUMPCONTROL", "false"
2016-09-05 09:11:30 +02:00
}
2017-02-23 20:00:33 +01:00
pumpcontrol {
2016-11-26 05:31:23 +01:00
dimension "standard"
2017-02-23 20:00:33 +01:00
resValue "string", "app_name", "AndroidAPS"
versionName version
manifestPlaceholders = [
2018-06-14 19:43:16 +02:00
appIcon: "@mipmap/blueowl",
appIconRound: "@null"
]
2016-07-15 23:53:14 +02:00
buildConfigField "boolean", "APS", "false"
2017-02-23 20:00:33 +01:00
buildConfigField "boolean", "PUMPDRIVERS", "true"
buildConfigField "boolean", "NSCLIENTOLNY", "false"
2017-11-29 16:07:26 +01:00
buildConfigField "boolean", "G5UPLOADER", "false"
2018-01-14 17:11:39 +01:00
buildConfigField "boolean", "PUMPCONTROL", "true"
2016-07-15 23:53:14 +02:00
}
2017-02-23 20:00:33 +01:00
nsclient {
2016-11-26 05:31:23 +01:00
dimension "standard"
2017-02-23 20:00:33 +01:00
resValue "string", "app_name", "NSClient"
versionName version + "-nsclient"
manifestPlaceholders = [
2018-06-14 19:43:16 +02:00
appIcon: "@mipmap/yellowowl",
appIconRound: "@null"
]
2017-02-23 20:00:33 +01:00
buildConfigField "boolean", "APS", "false"
buildConfigField "boolean", "PUMPDRIVERS", "false"
buildConfigField "boolean", "NSCLIENTOLNY", "true"
2017-11-29 16:07:26 +01:00
buildConfigField "boolean", "G5UPLOADER", "false"
2018-01-14 17:11:39 +01:00
buildConfigField "boolean", "PUMPCONTROL", "false"
2017-11-29 16:07:26 +01:00
}
g5uploader {
dimension "standard"
resValue "string", "app_name", "NSClient"
versionName version + "-nsclient"
manifestPlaceholders = [
2018-06-14 19:43:16 +02:00
appIcon: "@mipmap/yellowowl",
appIconRound: "@null"
]
2017-11-29 16:07:26 +01:00
buildConfigField "boolean", "APS", "false"
buildConfigField "boolean", "PUMPDRIVERS", "false"
buildConfigField "boolean", "NSCLIENTOLNY", "false"
buildConfigField "boolean", "G5UPLOADER", "true"
2018-01-14 17:11:39 +01:00
buildConfigField "boolean", "PUMPCONTROL", "false"
2016-07-15 23:53:14 +02:00
}
}
2018-02-15 21:00:09 +01:00
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
testOptions {
unitTests.returnDefaultValues = true
2018-03-31 15:00:32 +02:00
unitTests.includeAndroidResources = true
2018-02-15 21:00:09 +01:00
}
2018-08-01 23:03:01 +02:00
useLibrary "org.apache.http.legacy"
2018-04-20 17:27:31 +02:00
}
2016-06-04 17:28:05 +02:00
2017-01-29 13:00:21 +01:00
allprojects {
repositories {
jcenter()
flatDir {
dirs 'libs'
}
}
}
2018-03-30 21:26:07 +02:00
configurations {
libs
}
2016-06-04 17:28:05 +02:00
dependencies {
2017-10-12 18:01:10 +02:00
wearApp project(':wear')
2018-03-30 21:26:07 +02:00
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation("com.crashlytics.sdk.android:crashlytics:2.6.7@aar") {
2016-07-02 23:58:57 +02:00
transitive = true;
}
2018-03-30 21:26:07 +02:00
implementation("com.crashlytics.sdk.android:answers:1.3.12@aar") {
2017-03-02 23:08:40 +01:00
transitive = true;
}
libs "MilosKozak:danars-support-lib:master@zip"
2017-01-29 13:00:21 +01:00
2018-03-30 21:26:07 +02:00
implementation "com.android.support:appcompat-v7:${supportLibraryVersion}"
implementation "com.android.support:support-v13:${supportLibraryVersion}"
2018-03-30 21:26:07 +02:00
implementation "com.android.support:support-v4:${supportLibraryVersion}"
implementation "com.android.support:cardview-v7:${supportLibraryVersion}"
implementation "com.android.support:recyclerview-v7:${supportLibraryVersion}"
implementation "com.android.support:gridlayout-v7:${supportLibraryVersion}"
implementation "com.android.support:design:${supportLibraryVersion}"
implementation "com.android.support:percent:${supportLibraryVersion}"
implementation "com.wdullaer:materialdatetimepicker:2.3.0"
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation "com.squareup:otto:1.3.7"
implementation "com.j256.ormlite:ormlite-core:${ormLiteVersion}"
implementation "com.j256.ormlite:ormlite-android:${ormLiteVersion}"
implementation("com.github.tony19:logback-android-classic:1.1.1-6") {
2018-01-13 21:34:38 +01:00
exclude group: "com.google.android", module: "android"
2016-12-27 16:21:04 +01:00
}
2018-03-30 21:26:07 +02:00
implementation "org.apache.commons:commons-lang3:3.6"
implementation "org.slf4j:slf4j-api:1.7.12"
implementation "com.jjoe64:graphview:4.0.1"
implementation "com.joanzapata.iconify:android-iconify-fontawesome:2.1.1"
implementation "com.google.android.gms:play-services-wearable:7.5.0"
implementation(name: "android-edittext-validator-v1.3.4-mod", ext: "aar")
implementation(name: "sightparser-release", ext: "aar")
2018-01-24 15:18:31 +01:00
2018-03-30 21:26:07 +02:00
implementation("com.google.android:flexbox:0.3.0") {
2018-01-13 21:34:38 +01:00
exclude group: "com.android.support"
2017-06-30 17:43:10 +02:00
}
2018-05-02 18:49:40 +02:00
implementation("io.socket:socket.io-client:1.0.0") {
2017-02-17 13:18:36 +01:00
// excluding org.json which is provided by Android
2018-01-13 21:34:38 +01:00
exclude group: "org.json", module: "json"
2017-02-17 13:18:36 +01:00
}
2018-03-30 21:26:07 +02:00
implementation "com.google.code.gson:gson:2.7"
implementation "com.google.guava:guava:20.0"
2018-01-13 21:34:38 +01:00
2018-03-30 21:26:07 +02:00
implementation "net.danlew:android.joda:2.9.9.1"
implementation "uk.com.robust-it:cloning:1.9.9"
2018-01-13 21:34:38 +01:00
2018-03-30 21:26:07 +02:00
implementation 'org.mozilla:rhino:1.7.7.2'
2018-02-04 07:27:02 +01:00
2018-04-02 22:43:20 +02:00
implementation "com.jakewharton:butterknife:${butterknifeVersion}"
annotationProcessor "com.jakewharton:butterknife-compiler:${butterknifeVersion}"
2018-01-24 21:54:24 +01:00
2018-03-30 21:26:07 +02:00
testImplementation "junit:junit:4.12"
testImplementation "org.json:json:20140107"
testImplementation "org.mockito:mockito-core:2.7.22"
testImplementation "org.powermock:powermock-api-mockito2:${powermockVersion}"
testImplementation "org.powermock:powermock-module-junit4-rule-agent:${powermockVersion}"
testImplementation "org.powermock:powermock-module-junit4-rule:${powermockVersion}"
testImplementation "org.powermock:powermock-module-junit4:${powermockVersion}"
testImplementation "joda-time:joda-time:2.9.4.2"
testImplementation "com.google.truth:truth:0.39"
testImplementation 'org.robolectric:robolectric:3.8'
testImplementation "org.skyscreamer:jsonassert:1.5.0"
2017-01-29 13:00:21 +01:00
2018-03-30 21:26:07 +02:00
androidTestImplementation "org.mockito:mockito-core:2.7.22"
androidTestImplementation "com.google.dexmaker:dexmaker:${dexmakerVersion}"
androidTestImplementation "com.google.dexmaker:dexmaker-mockito:${dexmakerVersion}"
2017-07-21 16:49:43 +02:00
}
task unzip(type: Copy) {
2018-04-20 17:27:31 +02:00
def zipPath = configurations.libs.find { it.name.startsWith("danars") }
def zipFile = file(zipPath)
def outputDir = file("${buildDir}/unpacked/dist")
from zipTree(zipFile)
into outputDir
2018-02-01 21:11:28 +01:00
}
2018-02-01 21:11:28 +01:00
task copyLibs(dependsOn: unzip, type: Copy) {
2018-02-01 21:25:37 +01:00
def src = file("${buildDir}/unpacked/dist/danars-support-lib-master")
2018-02-01 21:11:28 +01:00
def target = file("src/main/jniLibs/")
from src
into target
}
task full_clean(type: Delete) {
delete file("src/main/jniLibs")
}
clean.dependsOn full_clean
2018-04-20 17:27:31 +02:00
preBuild.dependsOn copyLibs