wear gradle -> kts

This commit is contained in:
Milos Kozak 2023-10-19 22:48:49 +02:00
parent 7e8b88b495
commit 741f3a9202
51 changed files with 219 additions and 265 deletions

View file

@ -1,7 +1,6 @@
import java.io.ByteArrayOutputStream import java.io.ByteArrayOutputStream
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Date import java.util.Date
import kotlin.io.println
plugins { plugins {
id("com.android.application") id("com.android.application")
@ -13,8 +12,6 @@ plugins {
} }
apply(from = "${project.rootDir}/core/main/jacoco_global.gradle") apply(from = "${project.rootDir}/core/main/jacoco_global.gradle")
apply(from = "${project.rootDir}/core/main/test_dependencies.gradle")
repositories { repositories {
mavenCentral() mavenCentral()

View file

@ -42,6 +42,7 @@ object Libs {
const val lifecycleViewmodel = "androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2" const val lifecycleViewmodel = "androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2"
const val fragment = "androidx.fragment:fragment-ktx:1.6.1" const val fragment = "androidx.fragment:fragment-ktx:1.6.1"
const val navigationFragment = "androidx.navigation:navigation-fragment-ktx:2.7.4" const val navigationFragment = "androidx.navigation:navigation-fragment-ktx:2.7.4"
const val legacySupport = "androidx.legacy:legacy-support-v13:1.0.0"
object Work { object Work {

View file

@ -22,6 +22,10 @@ android {
isMinifyEnabled = false isMinifyEnabled = false
setProguardFiles(listOf(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")) setProguardFiles(listOf(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"))
} }
named("debug") {
enableUnitTestCoverage = true
enableAndroidTestCoverage = true
}
} }
compileOptions { compileOptions {

View file

@ -6,9 +6,9 @@ plugins {
android { android {
compileSdk = Versions.compileSdk compileSdk = Versions.compileSdk
defaultConfig { defaultConfig {
minSdk = 28 minSdk = Versions.minSdk
@Suppress("DEPRECATION") @Suppress("DEPRECATION")
targetSdk = 28 targetSdk = Versions.targetSdk
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
} }
@ -18,6 +18,10 @@ android {
isMinifyEnabled = false isMinifyEnabled = false
setProguardFiles(listOf(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")) setProguardFiles(listOf(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"))
} }
named("debug") {
enableUnitTestCoverage = true
enableAndroidTestCoverage = true
}
} }
sourceSets { sourceSets {

View file

@ -0,0 +1,53 @@
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
plugins {
id("com.android.application")
id("kotlin-android")
}
dependencies {
testImplementation(Libs.Kotlin.test)
testImplementation(Libs.JUnit.jupiter)
testImplementation(Libs.JUnit.jupiterApi)
testImplementation(Libs.json)
testImplementation(Libs.Mockito.jupiter)
testImplementation(Libs.Mockito.kotlin)
testImplementation(Libs.jodaTime)
testImplementation(Libs.Google.truth)
testImplementation(Libs.jsonAssert)
androidTestImplementation(Libs.AndroidX.Test.espressoCore)
androidTestImplementation(Libs.AndroidX.Test.extKtx)
androidTestImplementation(Libs.AndroidX.Test.rules)
//androidTestImplementation(Libs.AndroidX.Test.uiAutomator)
}
tasks.withType<Test> {
// use to display stdout in travis
testLogging {
// set options for log level LIFECYCLE
events = setOf(
TestLogEvent.FAILED,
TestLogEvent.STARTED,
TestLogEvent.SKIPPED,
TestLogEvent.STANDARD_OUT
)
exceptionFormat = TestExceptionFormat.FULL
useJUnitPlatform()
}
}
tasks.withType<Test>().configureEach {
maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1)
forkEvery = 20
}
android {
testOptions {
unitTests {
isReturnDefaultValues = true
isIncludeAndroidResources = true
}
}
}

View file

@ -5,7 +5,7 @@ plugins {
id("kotlin-parcelize") id("kotlin-parcelize")
id("kotlinx-serialization") id("kotlinx-serialization")
id("android-module-dependencies") id("android-module-dependencies")
id("test-dependencies") id("test-module-dependencies")
} }
apply(from = "${project.rootDir}/core/main/jacoco_global.gradle") apply(from = "${project.rootDir}/core/main/jacoco_global.gradle")

View file

@ -5,7 +5,7 @@ plugins {
id("kotlin-parcelize") id("kotlin-parcelize")
id("android-module-dependencies") id("android-module-dependencies")
id("all-open-dependencies") id("all-open-dependencies")
id("test-dependencies") id("test-module-dependencies")
} }
apply(from = "${project.rootDir}/core/main/jacoco_global.gradle") apply(from = "${project.rootDir}/core/main/jacoco_global.gradle")

View file

@ -93,10 +93,3 @@ def setupAndroidReporting() {
} }
} }
android {
buildTypes {
debug {
testCoverageEnabled true
}
}
}

View file

@ -1,40 +0,0 @@
dependencies {
//testImplementation "junit:junit:$junit_version"
testImplementation 'org.jetbrains.kotlin:kotlin-test:1.9.10'
testImplementation "org.junit.jupiter:junit-jupiter:$junit_jupiter_version"
testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_jupiter_version"
testImplementation "org.json:json:$json_version"
testImplementation "org.mockito:mockito-junit-jupiter:$mockito_version"
testImplementation "org.mockito.kotlin:mockito-kotlin:4.1.0"
testImplementation "joda-time:joda-time:$jodatime_version"
testImplementation 'com.google.truth:truth:1.1.5'
testImplementation "org.skyscreamer:jsonassert:1.5.0"
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
androidTestImplementation "androidx.test.ext:junit-ktx:$androidx_junit_version"
androidTestImplementation "androidx.test:rules:$androidx_rules_version"
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
}
tasks.matching { it instanceof Test }.all {
//testLogging.events = ["failed", "skipped", "started"]
// use to display stdout in travis
testLogging.events = ["failed", "skipped", "started", "standard_out"]
testLogging.exceptionFormat = "full"
useJUnitPlatform()
}
android {
testOptions {
unitTests {
returnDefaultValues = true
includeAndroidResources = true
all {
maxParallelForks = 10
forkEvery = 20
}
}
}
}

View file

@ -3,7 +3,7 @@ plugins {
id("kotlin-android") id("kotlin-android")
id("kotlinx-serialization") id("kotlinx-serialization")
id("android-module-dependencies") id("android-module-dependencies")
id("test-dependencies") id("test-module-dependencies")
} }
android { android {

View file

@ -5,7 +5,7 @@ plugins {
id("kotlin-allopen") id("kotlin-allopen")
id("android-module-dependencies") id("android-module-dependencies")
id("all-open-dependencies") id("all-open-dependencies")
id("test-dependencies") id("test-module-dependencies")
} }
apply(from = "${project.rootDir}/core/main/jacoco_global.gradle") apply(from = "${project.rootDir}/core/main/jacoco_global.gradle")

View file

@ -3,7 +3,7 @@ plugins {
id("kotlin-android") id("kotlin-android")
id("kotlin-kapt") id("kotlin-kapt")
id("android-module-dependencies") id("android-module-dependencies")
id("test-dependencies") id("test-module-dependencies")
} }
apply(from = "${project.rootDir}/core/main/jacoco_global.gradle") apply(from = "${project.rootDir}/core/main/jacoco_global.gradle")

View file

@ -3,7 +3,7 @@ plugins {
id("kotlin-android") id("kotlin-android")
id("kotlin-kapt") id("kotlin-kapt")
id("android-module-dependencies") id("android-module-dependencies")
id("test-dependencies") id("test-module-dependencies")
} }
android { android {

View file

@ -4,7 +4,7 @@ plugins {
id("kotlin-kapt") id("kotlin-kapt")
id("kotlin-allopen") id("kotlin-allopen")
id("android-module-dependencies") id("android-module-dependencies")
id("test-dependencies") id("test-module-dependencies")
} }
apply(from = "${project.rootDir}/core/main/jacoco_global.gradle") apply(from = "${project.rootDir}/core/main/jacoco_global.gradle")

View file

@ -4,7 +4,7 @@ plugins {
id("kotlin-kapt") id("kotlin-kapt")
id("android-module-dependencies") id("android-module-dependencies")
id("all-open-dependencies") id("all-open-dependencies")
id("test-dependencies") id("test-module-dependencies")
} }
apply(from = "${project.rootDir}/core/main/jacoco_global.gradle") apply(from = "${project.rootDir}/core/main/jacoco_global.gradle")

View file

@ -3,7 +3,7 @@ plugins {
id("kotlin-android") id("kotlin-android")
id("kotlin-kapt") id("kotlin-kapt")
id("android-module-dependencies") id("android-module-dependencies")
id("test-dependencies") id("test-module-dependencies")
} }
apply(from = "${project.rootDir}/core/main/jacoco_global.gradle") apply(from = "${project.rootDir}/core/main/jacoco_global.gradle")

View file

@ -3,7 +3,7 @@ plugins {
id("kotlin-android") id("kotlin-android")
id("kotlin-kapt") id("kotlin-kapt")
id("android-module-dependencies") id("android-module-dependencies")
id("test-dependencies") id("test-module-dependencies")
} }
apply(from = "${project.rootDir}/core/main/jacoco_global.gradle") apply(from = "${project.rootDir}/core/main/jacoco_global.gradle")

View file

@ -3,7 +3,7 @@ plugins {
id("kotlin-android") id("kotlin-android")
id("kotlin-kapt") id("kotlin-kapt")
id("android-module-dependencies") id("android-module-dependencies")
id("test-dependencies") id("test-module-dependencies")
} }
apply(from = "${project.rootDir}/core/main/jacoco_global.gradle") apply(from = "${project.rootDir}/core/main/jacoco_global.gradle")

View file

@ -4,7 +4,7 @@ plugins {
id("kotlin-kapt") id("kotlin-kapt")
id("kotlin-parcelize") id("kotlin-parcelize")
id("android-module-dependencies") id("android-module-dependencies")
id("test-dependencies") id("test-module-dependencies")
} }
apply(from = "${project.rootDir}/core/main/jacoco_global.gradle") apply(from = "${project.rootDir}/core/main/jacoco_global.gradle")

View file

@ -3,7 +3,7 @@ plugins {
id("kotlin-android") id("kotlin-android")
id("kotlin-kapt") id("kotlin-kapt")
id("android-module-dependencies") id("android-module-dependencies")
id("test-dependencies") id("test-module-dependencies")
id("all-open-dependencies") id("all-open-dependencies")
} }

View file

@ -3,7 +3,7 @@ plugins {
id("kotlin-android") id("kotlin-android")
id("kotlin-kapt") id("kotlin-kapt")
id("android-module-dependencies") id("android-module-dependencies")
id("test-dependencies") id("test-module-dependencies")
} }
apply(from = "${project.rootDir}/core/main/jacoco_global.gradle") apply(from = "${project.rootDir}/core/main/jacoco_global.gradle")

View file

@ -3,7 +3,7 @@ plugins {
id("kotlin-android") id("kotlin-android")
id("kotlin-kapt") id("kotlin-kapt")
id("android-module-dependencies") id("android-module-dependencies")
id("test-dependencies") id("test-module-dependencies")
} }
apply(from = "${project.rootDir}/core/main/jacoco_global.gradle") apply(from = "${project.rootDir}/core/main/jacoco_global.gradle")

View file

@ -3,7 +3,7 @@ plugins {
id("kotlin-android") id("kotlin-android")
id("kotlin-kapt") id("kotlin-kapt")
id("android-module-dependencies") id("android-module-dependencies")
id("test-dependencies") id("test-module-dependencies")
} }
apply(from = "${project.rootDir}/core/main/jacoco_global.gradle") apply(from = "${project.rootDir}/core/main/jacoco_global.gradle")

View file

@ -3,7 +3,7 @@ plugins {
id("kotlin-android") id("kotlin-android")
id("kotlin-kapt") id("kotlin-kapt")
id("android-module-dependencies") id("android-module-dependencies")
id("test-dependencies") id("test-module-dependencies")
} }
apply(from = "${project.rootDir}/core/main/jacoco_global.gradle") apply(from = "${project.rootDir}/core/main/jacoco_global.gradle")

View file

@ -3,7 +3,7 @@ plugins {
id("kotlin-android") id("kotlin-android")
id("kotlin-kapt") id("kotlin-kapt")
id("android-module-dependencies") id("android-module-dependencies")
id("test-dependencies") id("test-module-dependencies")
} }
apply(from = "${project.rootDir}/core/main/jacoco_global.gradle") apply(from = "${project.rootDir}/core/main/jacoco_global.gradle")

View file

@ -3,7 +3,7 @@ plugins {
id("kotlin-android") id("kotlin-android")
id("kotlin-kapt") id("kotlin-kapt")
id("android-module-dependencies") id("android-module-dependencies")
id("test-dependencies") id("test-module-dependencies")
} }
apply(from = "${project.rootDir}/core/main/jacoco_global.gradle") apply(from = "${project.rootDir}/core/main/jacoco_global.gradle")

View file

@ -3,7 +3,7 @@ plugins {
id("kotlin-android") id("kotlin-android")
id("kotlin-kapt") id("kotlin-kapt")
id("android-module-dependencies") id("android-module-dependencies")
id("test-dependencies") id("test-module-dependencies")
} }
apply(from = "${project.rootDir}/core/main/jacoco_global.gradle") apply(from = "${project.rootDir}/core/main/jacoco_global.gradle")

View file

@ -3,7 +3,7 @@ plugins {
id("kotlin-android") id("kotlin-android")
id("kotlin-kapt") id("kotlin-kapt")
id("android-module-dependencies") id("android-module-dependencies")
id("test-dependencies") id("test-module-dependencies")
} }
apply(from = "${project.rootDir}/core/main/jacoco_global.gradle") apply(from = "${project.rootDir}/core/main/jacoco_global.gradle")

View file

@ -2,7 +2,7 @@ plugins {
id("com.android.library") id("com.android.library")
id("kotlin-android") id("kotlin-android")
id("android-module-dependencies") id("android-module-dependencies")
id("test-dependencies") id("test-module-dependencies")
} }
apply(from = "${project.rootDir}/core/main/jacoco_global.gradle") apply(from = "${project.rootDir}/core/main/jacoco_global.gradle")

View file

@ -3,7 +3,7 @@ plugins {
id("kotlin-android") id("kotlin-android")
id("kotlin-kapt") id("kotlin-kapt")
id("android-module-dependencies") id("android-module-dependencies")
id("test-dependencies") id("test-module-dependencies")
} }
apply(from = "${project.rootDir}/core/main/jacoco_global.gradle") apply(from = "${project.rootDir}/core/main/jacoco_global.gradle")

View file

@ -3,7 +3,7 @@ plugins {
id("kotlin-android") id("kotlin-android")
id("kotlin-kapt") id("kotlin-kapt")
id("android-module-dependencies") id("android-module-dependencies")
id("test-dependencies") id("test-module-dependencies")
} }
apply(from = "${project.rootDir}/core/main/jacoco_global.gradle") apply(from = "${project.rootDir}/core/main/jacoco_global.gradle")

View file

@ -3,7 +3,7 @@ plugins {
id("kotlin-android") id("kotlin-android")
id("kotlin-kapt") id("kotlin-kapt")
id("android-module-dependencies") id("android-module-dependencies")
id("test-dependencies") id("test-module-dependencies")
} }
apply(from = "${project.rootDir}/core/main/jacoco_global.gradle") apply(from = "${project.rootDir}/core/main/jacoco_global.gradle")

View file

@ -3,7 +3,7 @@ plugins {
id("kotlin-android") id("kotlin-android")
id("kotlin-kapt") id("kotlin-kapt")
id("android-module-dependencies") id("android-module-dependencies")
id("test-dependencies") id("test-module-dependencies")
} }
apply(from = "${project.rootDir}/core/main/jacoco_global.gradle") apply(from = "${project.rootDir}/core/main/jacoco_global.gradle")

View file

@ -3,7 +3,7 @@ plugins {
id("kotlin-android") id("kotlin-android")
id("kotlin-kapt") id("kotlin-kapt")
id("android-module-dependencies") id("android-module-dependencies")
id("test-dependencies") id("test-module-dependencies")
} }
apply(from = "${project.rootDir}/core/main/jacoco_global.gradle") apply(from = "${project.rootDir}/core/main/jacoco_global.gradle")

View file

@ -3,7 +3,7 @@ plugins {
id("kotlin-android") id("kotlin-android")
id("kotlin-kapt") id("kotlin-kapt")
id("android-module-dependencies") id("android-module-dependencies")
id("test-dependencies") id("test-module-dependencies")
} }
apply(from = "${project.rootDir}/core/main/jacoco_global.gradle") apply(from = "${project.rootDir}/core/main/jacoco_global.gradle")

View file

@ -3,7 +3,7 @@ plugins {
id("kotlin-android") id("kotlin-android")
id("kotlin-kapt") id("kotlin-kapt")
id("android-module-dependencies") id("android-module-dependencies")
id("test-dependencies") id("test-module-dependencies")
} }
apply(from = "${project.rootDir}/core/main/jacoco_global.gradle") apply(from = "${project.rootDir}/core/main/jacoco_global.gradle")

View file

@ -3,7 +3,7 @@ plugins {
id("kotlin-android") id("kotlin-android")
id("kotlin-kapt") id("kotlin-kapt")
id("android-module-dependencies") id("android-module-dependencies")
id("test-dependencies") id("test-module-dependencies")
} }
apply(from = "${project.rootDir}/core/main/jacoco_global.gradle") apply(from = "${project.rootDir}/core/main/jacoco_global.gradle")

View file

@ -3,7 +3,7 @@ plugins {
id("kotlin-android") id("kotlin-android")
id("kotlin-kapt") id("kotlin-kapt")
id("android-module-dependencies") id("android-module-dependencies")
id("test-dependencies") id("test-module-dependencies")
} }
apply(from = "${project.rootDir}/core/main/jacoco_global.gradle") apply(from = "${project.rootDir}/core/main/jacoco_global.gradle")

View file

@ -3,7 +3,7 @@ plugins {
id("kotlin-android") id("kotlin-android")
id("kotlin-kapt") id("kotlin-kapt")
id("android-module-dependencies") id("android-module-dependencies")
id("test-dependencies") id("test-module-dependencies")
} }
apply(from = "${project.rootDir}/core/main/jacoco_global.gradle") apply(from = "${project.rootDir}/core/main/jacoco_global.gradle")

View file

@ -3,7 +3,7 @@ plugins {
id("kotlin-android") id("kotlin-android")
id("kotlin-kapt") id("kotlin-kapt")
id("android-module-dependencies") id("android-module-dependencies")
id("test-dependencies") id("test-module-dependencies")
} }
apply(from = "${project.rootDir}/core/main/jacoco_global.gradle") apply(from = "${project.rootDir}/core/main/jacoco_global.gradle")

View file

@ -3,7 +3,7 @@ plugins {
id("kotlin-android") id("kotlin-android")
id("kotlin-kapt") id("kotlin-kapt")
id("android-module-dependencies") id("android-module-dependencies")
id("test-dependencies") id("test-module-dependencies")
} }
apply(from = "${project.rootDir}/core/main/jacoco_global.gradle") apply(from = "${project.rootDir}/core/main/jacoco_global.gradle")

View file

@ -3,7 +3,7 @@ plugins {
id("kotlin-android") id("kotlin-android")
id("kotlin-kapt") id("kotlin-kapt")
id("android-module-dependencies") id("android-module-dependencies")
id("test-dependencies") id("test-module-dependencies")
} }
apply(from = "${project.rootDir}/core/main/jacoco_global.gradle") apply(from = "${project.rootDir}/core/main/jacoco_global.gradle")

View file

@ -3,7 +3,7 @@ plugins {
id("kotlin-android") id("kotlin-android")
id("kotlin-kapt") id("kotlin-kapt")
id("android-module-dependencies") id("android-module-dependencies")
id("test-dependencies") id("test-module-dependencies")
} }
apply(from = "${project.rootDir}/core/main/jacoco_global.gradle") apply(from = "${project.rootDir}/core/main/jacoco_global.gradle")

View file

@ -3,7 +3,7 @@ plugins {
id("kotlin-android") id("kotlin-android")
id("kotlin-kapt") id("kotlin-kapt")
id("android-module-dependencies") id("android-module-dependencies")
id("test-dependencies") id("test-module-dependencies")
} }
apply(from = "${project.rootDir}/core/main/jacoco_global.gradle") apply(from = "${project.rootDir}/core/main/jacoco_global.gradle")

View file

@ -1,174 +0,0 @@
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath "org.jacoco:org.jacoco.core:0.8.11"
}
}
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/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 {
namespace 'app.aaps.wear'
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"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main {
jniLibs.srcDirs = ['src/main/jniLibs']
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
lint {
checkReleaseBuilds false
disable 'MissingTranslation'
disable 'ExtraTranslation'
}
}
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'
}
}

116
wear/build.gradle.kts Normal file
View file

@ -0,0 +1,116 @@
import java.io.ByteArrayOutputStream
import java.text.SimpleDateFormat
import java.util.Date
plugins {
id("com.android.application")
id("kotlin-android")
id("kotlin-kapt")
id("android-app-dependencies")
id("test-app-dependencies")
}
apply(from = "${project.rootDir}/core/main/jacoco_global.gradle")
repositories {
google()
mavenCentral()
}
fun generateGitBuild(): String {
val stringBuilder: StringBuilder = StringBuilder()
try {
val stdout = ByteArrayOutputStream()
exec {
commandLine("git", "describe", "--always")
standardOutput = stdout
}
val commitObject = stdout.toString().trim()
stringBuilder.append(commitObject)
} catch (ignored: Exception) {
stringBuilder.append("NoGitSystemAvailable")
}
return stringBuilder.toString()
}
fun generateDate(): String {
val stringBuilder: StringBuilder = StringBuilder()
// showing only date prevents app to rebuild everytime
stringBuilder.append(SimpleDateFormat("yyyy.MM.dd").format(Date()))
return stringBuilder.toString()
}
android {
namespace = "app.aaps.wear"
defaultConfig {
minSdk = Versions.wearMinSdk
targetSdk = Versions.wearTargetSdk
buildConfigField("String", "BUILDVERSION", "\"${generateGitBuild()}-${generateDate()}\"")
}
flavorDimensions.add("standard")
productFlavors {
create("full") {
isDefault = true
applicationId = "info.nightscout.androidaps"
dimension = "standard"
versionName = Versions.appVersion
}
create("pumpcontrol") {
applicationId = "info.nightscout.aapspumpcontrol"
dimension = "standard"
versionName = Versions.appVersion + "-pumpcontrol"
}
create("aapsclient") {
applicationId = "info.nightscout.aapsclient"
dimension = "standard"
versionName = Versions.appVersion + "-aapsclient"
}
create("aapsclient2") {
applicationId = "info.nightscout.aapsclient2"
dimension = "standard"
versionName = Versions.appVersion + "-aapsclient2"
}
}
}
allprojects {
repositories {
}
}
dependencies {
implementation(project(":shared:impl"))
implementation(project(":core:interfaces"))
implementation(Libs.AndroidX.appCompat)
implementation(Libs.AndroidX.core)
implementation(Libs.AndroidX.legacySupport)
implementation(Libs.AndroidX.preference)
implementation(Libs.AndroidX.Wear.wear)
implementation(Libs.AndroidX.Wear.tiles)
implementation(Libs.AndroidX.constraintLayout)
testImplementation(project(":shared:tests"))
compileOnly(Libs.Google.Android.Wearable.wearable)
implementation(Libs.Google.Android.Wearable.wearableSupport)
implementation(Libs.Google.Android.PlayServices.wearable)
implementation(files("${rootDir}/wear/libs/ustwo-clockwise-debug.aar"))
implementation(files("${rootDir}/wear/libs/wearpreferenceactivity-0.5.0.aar"))
implementation(files("${rootDir}/wear/libs/hellocharts-library-1.5.8.aar"))
implementation(Libs.KotlinX.coroutinesCore)
implementation(Libs.KotlinX.coroutinesAndroid)
implementation(Libs.KotlinX.coroutinesGuava)
implementation(Libs.KotlinX.coroutinesPlayServices)
implementation(Libs.KotlinX.datetime)
implementation(Libs.Kotlin.stdlibJdk8)
kapt(Libs.Dagger.androidProcessor)
kapt(Libs.Dagger.compiler)
}

View file

@ -3,7 +3,7 @@ plugins {
id("kotlin-android") id("kotlin-android")
id("kotlin-kapt") id("kotlin-kapt")
id("android-module-dependencies") id("android-module-dependencies")
id("test-dependencies") id("test-module-dependencies")
} }
apply(from = "${project.rootDir}/core/main/jacoco_global.gradle") apply(from = "${project.rootDir}/core/main/jacoco_global.gradle")