From db6349cddb828d0cf7434c0f0b59edefb192a3d2 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Sat, 5 Jun 2021 14:08:29 +0530 Subject: [PATCH] common/database: workaround androidAndroidTestRelease warnings Signed-off-by: Harsh Shandilya --- common/build.gradle.kts | 13 ++++++++++++- database/build.gradle.kts | 13 ++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/common/build.gradle.kts b/common/build.gradle.kts index bf9bc657..3afbc84b 100644 --- a/common/build.gradle.kts +++ b/common/build.gradle.kts @@ -10,6 +10,17 @@ kotlin { android() jvm("desktop") { compilations.all { kotlinOptions.jvmTarget = "11" } } sourceSets { + // Workaround for: + // + // The Kotlin source set androidAndroidTestRelease was configured but not added to any + // Kotlin compilation. You can add a source set to a target's compilation by connecting it + // with the compilation's default source set using 'dependsOn'. + // See + // https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#connecting-source-sets + // + // This workaround includes `dependsOn(androidAndroidTestRelease)` in the `androidTest` + // sourceSet. + val androidAndroidTestRelease by getting val commonMain by getting { dependencies { api(compose.runtime) @@ -21,7 +32,7 @@ kotlin { } val commonTest by getting { dependencies { implementation(kotlin("test")) } } val androidMain by getting { dependencies { implementation(libs.androidx.browser) } } - val androidTest by getting + val androidTest by getting { dependsOn(androidAndroidTestRelease) } val desktopMain by getting val desktopTest by getting } diff --git a/database/build.gradle.kts b/database/build.gradle.kts index 288df229..ca3dfd28 100644 --- a/database/build.gradle.kts +++ b/database/build.gradle.kts @@ -8,12 +8,23 @@ kotlin { android() jvm("desktop") { compilations.all { kotlinOptions.jvmTarget = "11" } } sourceSets { + // Workaround for: + // + // The Kotlin source set androidAndroidTestRelease was configured but not added to any + // Kotlin compilation. You can add a source set to a target's compilation by connecting it + // with the compilation's default source set using 'dependsOn'. + // See + // https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#connecting-source-sets + // + // This workaround includes `dependsOn(androidAndroidTestRelease)` in the `androidTest` + // sourceSet. + val androidAndroidTestRelease by getting val commonMain by getting val commonTest by getting val androidMain by getting { dependencies { implementation(libs.thirdparty.sqldelight.androidDriver) } } - val androidTest by getting + val androidTest by getting { dependsOn(androidAndroidTestRelease) } val desktopMain by getting { dependencies { implementation(libs.thirdparty.sqldelight.jvmDriver) } }