150 lines
5 KiB
Groovy
150 lines
5 KiB
Groovy
buildscript {
|
|
repositories {
|
|
google()
|
|
mavenCentral()
|
|
}
|
|
|
|
dependencies {
|
|
classpath "org.jacoco:org.jacoco.core:0.8.10"
|
|
}
|
|
}
|
|
|
|
plugins {
|
|
id 'com.android.application'
|
|
id 'kotlin-android'
|
|
id 'kotlin-kapt'
|
|
id 'kotlin-allopen'
|
|
}
|
|
|
|
apply from: "${project.rootDir}/core/main/test_dependencies.gradle"
|
|
apply from: "${project.rootDir}/core/main/android_dependencies.gradle"
|
|
apply from: "${project.rootDir}/core/main/jacoco_global.gradle"
|
|
|
|
|
|
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) {
|
|
stringBuilder.append('NoGitSystemAvailable')
|
|
}
|
|
stringBuilder.append('-')
|
|
stringBuilder.append((new Date()).format('yyyy.MM.dd'))
|
|
stringBuilder.append('"')
|
|
return stringBuilder.toString()
|
|
}
|
|
|
|
android {
|
|
compileSdk 34
|
|
|
|
defaultConfig {
|
|
minSdkVersion 26
|
|
targetSdkVersion 29
|
|
versionCode 2
|
|
versionName "1.0.3"
|
|
buildConfigField "String", "BUILDVERSION", generateGitBuild()
|
|
}
|
|
|
|
buildFeatures {
|
|
viewBinding true
|
|
}
|
|
|
|
flavorDimensions = ["standard"]
|
|
productFlavors {
|
|
full {
|
|
isDefault = true
|
|
applicationId "info.nightscout.androidaps"
|
|
dimension "standard"
|
|
versionName version
|
|
}
|
|
pumpcontrol {
|
|
applicationId "info.nightscout.aapspumpcontrol"
|
|
dimension "standard"
|
|
versionName version + "-pumpcontrol"
|
|
}
|
|
aapsclient {
|
|
applicationId "info.nightscout.aapsclient"
|
|
dimension "standard"
|
|
versionName version + "-aapsclient"
|
|
}
|
|
aapsclient2 {
|
|
applicationId "info.nightscout.aapsclient2"
|
|
dimension "standard"
|
|
versionName version + "-aapsclient"
|
|
}
|
|
}
|
|
namespace 'app.aaps.wear'
|
|
}
|
|
|
|
allprojects {
|
|
repositories {
|
|
google()
|
|
mavenCentral()
|
|
}
|
|
apply plugin: 'jacoco'
|
|
}
|
|
|
|
|
|
dependencies {
|
|
implementation project(':shared:impl')
|
|
implementation project(':core:interfaces')
|
|
|
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
|
|
|
implementation "androidx.appcompat:appcompat:$appcompat_version"
|
|
implementation "androidx.core:core-ktx:$core_version"
|
|
implementation 'androidx.legacy:legacy-support-v13:1.0.0'
|
|
implementation "androidx.preference:preference-ktx:$preferencektx_version"
|
|
implementation 'androidx.wear:wear:1.3.0'
|
|
implementation 'androidx.wear.tiles:tiles:1.2.0'
|
|
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
|
testImplementation project(':shared:tests')
|
|
|
|
compileOnly "com.google.android.wearable:wearable:$wearable_version"
|
|
implementation "com.google.android.support:wearable:$wearable_version"
|
|
implementation "com.google.android.gms:play-services-wearable:$play_services_wearable_version"
|
|
implementation(files("${rootProject.rootDir}/core/libraries/libs/ustwo-clockwise-debug.aar"))
|
|
implementation(files("${rootProject.rootDir}/core/libraries/libs/wearpreferenceactivity-0.5.0.aar"))
|
|
implementation(files("${rootProject.rootDir}/core/libraries/libs/hellocharts-library-1.5.8.aar"))
|
|
|
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
|
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
|
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-guava:$coroutines_version"
|
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-play-services:$coroutines_version"
|
|
implementation "org.jetbrains.kotlinx:kotlinx-datetime:$kotlinx_datetime_version"
|
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
|
|
|
// for old fashioned support-app version
|
|
implementation "com.google.dagger:dagger:$dagger_version"
|
|
implementation "com.google.dagger:dagger-android:$dagger_version"
|
|
implementation "com.google.dagger:dagger-android-support:$dagger_version"
|
|
|
|
kapt "com.google.dagger:dagger-android-processor:$dagger_version"
|
|
kapt "com.google.dagger:dagger-compiler:$dagger_version"
|
|
}
|
|
repositories {
|
|
mavenCentral()
|
|
}
|
|
|
|
// This is necessary to prevent Gradle build errors like:
|
|
//
|
|
// Duplicate class androidx.lifecycle.ViewModelLazy found in modules jetified-lifecycle-viewmodel-ktx-2.3.1-runtime (androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1) and lifecycle-viewmodel-2.5.0-runtime (androidx.lifecycle:lifecycle-viewmodel:2.5.0)
|
|
//
|
|
// By explicitly adding these dependencies, the jetifier
|
|
// is forced to use the correct lifecycle version instead
|
|
// of automatically picking 2.3.1.
|
|
//
|
|
// See: https://stackoverflow.com/a/69832319/560774
|
|
configurations {
|
|
all {
|
|
exclude group: 'androidx.lifecycle', module: 'lifecycle-viewmodel-ktx'
|
|
}
|
|
}
|