From 4d572dc266c1cc20a106fe8ce7d95cc36acea907 Mon Sep 17 00:00:00 2001 From: Travis Wyatt Date: Tue, 21 Nov 2023 23:58:17 -0800 Subject: [PATCH] Use default hierarchy template --- axis/build.gradle.kts | 27 +++---------- box/build.gradle.kts | 64 ++++++++----------------------- color/build.gradle.kts | 19 +-------- compose/build.gradle.kts | 30 ++++++--------- element-view/build.gradle.kts | 41 ++++++-------------- element/build.gradle.kts | 25 ++---------- hierarchy/build.gradle.kts | 19 +-------- interpolate/build.gradle.kts | 29 +++----------- kanvas/build.gradle.kts | 61 ++++++----------------------- sample/build.gradle.kts | 72 ++++++++++++----------------------- scale/build.gradle.kts | 31 ++++----------- selection/build.gradle.kts | 27 +++---------- shape/build.gradle.kts | 25 ++---------- time/build.gradle.kts | 25 ++---------- 14 files changed, 113 insertions(+), 382 deletions(-) diff --git a/axis/build.gradle.kts b/axis/build.gradle.kts index 29a3cb3f..858078e6 100644 --- a/axis/build.gradle.kts +++ b/axis/build.gradle.kts @@ -23,30 +23,13 @@ kotlin { iosArm64() sourceSets { - val commonMain by getting { - dependencies { - api(projects.scale) - api(projects.selection) - } + commonMain.dependencies { + api(projects.scale) + api(projects.selection) } - val commonTest by getting { - dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - } - } - - val jvmTest by getting { - dependencies { - implementation(kotlin("test-junit")) - } - } - - val jsTest by getting { - dependencies { - implementation(kotlin("test-js")) - } + commonTest.dependencies { + implementation(kotlin("test")) } } } diff --git a/box/build.gradle.kts b/box/build.gradle.kts index f2094857..09bc960c 100644 --- a/box/build.gradle.kts +++ b/box/build.gradle.kts @@ -16,59 +16,25 @@ kotlin { iosArm64() sourceSets { - val commonMain by getting { - dependencies { - api(projects.axis) - api(projects.color) - api(projects.element) - api(projects.hierarchy) - api(projects.interpolate) - api(projects.kanvas) - api(projects.scale) - api(projects.selection) - api(projects.shape) - api(projects.time) - } + commonMain.dependencies { + api(projects.axis) + api(projects.color) + api(projects.element) + api(projects.hierarchy) + api(projects.interpolate) + api(projects.kanvas) + api(projects.scale) + api(projects.selection) + api(projects.shape) + api(projects.time) } - val commonTest by getting { - dependencies { - implementation(kotlin("reflect")) - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - } + androidMain.dependencies { + api(projects.elementView) } - val androidMain by getting { - dependencies { - api(projects.elementView) - } - } - - val androidUnitTest by getting { - dependencies { - implementation(kotlin("test-junit")) - implementation(libs.androidx.test) - implementation(libs.robolectric) - } - } - - val jvmTest by getting { - dependencies { - implementation(kotlin("test-junit")) - } - } - - val jsMain by getting { - dependencies { - api(projects.elementView) - } - } - - val jsTest by getting { - dependencies { - implementation(kotlin("test-js")) - } + jsMain.dependencies { + api(projects.elementView) } } } diff --git a/color/build.gradle.kts b/color/build.gradle.kts index 9b6c2073..a3da495a 100644 --- a/color/build.gradle.kts +++ b/color/build.gradle.kts @@ -24,23 +24,8 @@ kotlin { iosArm64() sourceSets { - val commonTest by getting { - dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - } - } - - val jvmTest by getting { - dependencies { - implementation(kotlin("test-junit")) - } - } - - val jsTest by getting { - dependencies { - implementation(kotlin("test-js")) - } + commonTest.dependencies { + implementation(kotlin("test")) } } } diff --git a/compose/build.gradle.kts b/compose/build.gradle.kts index 42528058..d71dffdc 100644 --- a/compose/build.gradle.kts +++ b/compose/build.gradle.kts @@ -14,29 +14,23 @@ kotlin { explicitApi() jvmToolchain(libs.versions.jvm.toolchain.get().toInt()) - androidTarget() { publishAllLibraryVariants() } + androidTarget().publishAllLibraryVariants() jvm("desktop") sourceSets { - val commonMain by getting { - dependencies { - api(projects.kanvas) - api(projects.element) - api(compose.runtime) - api(compose.foundation) - api(compose.material) - implementation(libs.datetime) - } + commonMain.dependencies { + api(projects.kanvas) + api(projects.element) + api(compose.runtime) + api(compose.foundation) + api(compose.material) + implementation(libs.datetime) } - val commonTest by getting { - dependencies { - implementation(kotlin("test")) - } + commonTest.dependencies { + implementation(kotlin("test")) } - val desktopMain by getting { - dependencies { - api(compose.preview) - } + getByName("desktopMain").dependencies { + api(compose.preview) } } } diff --git a/element-view/build.gradle.kts b/element-view/build.gradle.kts index ac031a3b..a48df35e 100644 --- a/element-view/build.gradle.kts +++ b/element-view/build.gradle.kts @@ -14,41 +14,24 @@ kotlin { js().browser() sourceSets { - val commonMain by getting { - dependencies { - api(projects.element) - api(libs.coroutines.core) - } + commonMain.dependencies { + api(projects.element) + api(libs.coroutines.core) } - val commonTest by getting { - dependencies { - implementation(kotlin("reflect")) - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - } + commonTest.dependencies { + implementation(kotlin("test")) } - val androidMain by getting { - dependencies { - implementation(libs.androidx.appcompat) - implementation(libs.androidx.lifecycle.runtime) - implementation(libs.coroutines.android) - } + androidMain.dependencies { + implementation(libs.androidx.appcompat) + implementation(libs.androidx.lifecycle.runtime) + implementation(libs.coroutines.android) } - val androidUnitTest by getting { - dependencies { - implementation(kotlin("test-junit")) - implementation(libs.androidx.test) - implementation(libs.robolectric) - } - } - - val jsTest by getting { - dependencies { - implementation(kotlin("test-js")) - } + getByName("androidUnitTest").dependencies { + implementation(libs.androidx.test) + implementation(libs.robolectric) } } } diff --git a/element/build.gradle.kts b/element/build.gradle.kts index 7d66c064..1d8ba39f 100644 --- a/element/build.gradle.kts +++ b/element/build.gradle.kts @@ -23,29 +23,12 @@ kotlin { iosArm64() sourceSets { - val commonMain by getting { - dependencies { - api(projects.kanvas) - } + commonMain.dependencies { + api(projects.kanvas) } - val commonTest by getting { - dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - } - } - - val jvmTest by getting { - dependencies { - implementation(kotlin("test-junit")) - } - } - - val jsTest by getting { - dependencies { - implementation(kotlin("test-js")) - } + commonTest.dependencies { + implementation(kotlin("test")) } } } diff --git a/hierarchy/build.gradle.kts b/hierarchy/build.gradle.kts index d4236b9f..db69b5eb 100644 --- a/hierarchy/build.gradle.kts +++ b/hierarchy/build.gradle.kts @@ -23,23 +23,8 @@ kotlin { iosArm64() sourceSets { - val commonTest by getting { - dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - } - } - - val jvmTest by getting { - dependencies { - implementation(kotlin("test-junit")) - } - } - - val jsTest by getting { - dependencies { - implementation(kotlin("test-js")) - } + commonTest.dependencies { + implementation(kotlin("test")) } } } diff --git a/interpolate/build.gradle.kts b/interpolate/build.gradle.kts index 26fc45ac..b0798b2c 100644 --- a/interpolate/build.gradle.kts +++ b/interpolate/build.gradle.kts @@ -23,31 +23,14 @@ kotlin { iosArm64() sourceSets { - val commonMain by getting { - dependencies { - api(projects.kanvas) - api(libs.datetime) - implementation(projects.time) - } + commonMain.dependencies { + api(projects.kanvas) + api(libs.datetime) + implementation(projects.time) } - val commonTest by getting { - dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - } - } - - val jvmTest by getting { - dependencies { - implementation(kotlin("test-junit")) - } - } - - val jsTest by getting { - dependencies { - implementation(kotlin("test-js")) - } + commonTest.dependencies { + implementation(kotlin("test")) } } } diff --git a/kanvas/build.gradle.kts b/kanvas/build.gradle.kts index 17520441..36af102f 100644 --- a/kanvas/build.gradle.kts +++ b/kanvas/build.gradle.kts @@ -29,62 +29,23 @@ kotlin { languageSettings.optIn("kotlinx.cinterop.ExperimentalForeignApi") } - val commonMain by getting { - dependencies { - api(projects.color) - } + commonMain.dependencies { + api(projects.color) } - val commonTest by getting { - dependencies { - implementation(kotlin("reflect")) - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - } + commonTest.dependencies { + implementation(kotlin("test")) } - val androidMain by getting { - dependencies { - implementation(libs.androidx.appcompat) - implementation(libs.androidx.lifecycle.runtime) - implementation(libs.coroutines.android) - } + androidMain.dependencies { + implementation(libs.androidx.appcompat) + implementation(libs.androidx.lifecycle.runtime) + implementation(libs.coroutines.android) } - val androidUnitTest by getting { - dependencies { - implementation(kotlin("test-junit")) - implementation(libs.androidx.test) - implementation(libs.robolectric) - } - } - - val jvmTest by getting { - dependencies { - implementation(kotlin("test-junit")) - } - } - - val jsTest by getting { - dependencies { - implementation(kotlin("test-js")) - } - } - - val nativeDarwinMain by creating { - dependsOn(commonMain) - } - - val iosArm64Main by getting { - dependsOn(nativeDarwinMain) - } - - val macosArm64Main by getting { - dependsOn(nativeDarwinMain) - } - - val macosX64Main by getting { - dependsOn(nativeDarwinMain) + getByName("androidUnitTest").dependencies { + implementation(libs.androidx.test) + implementation(libs.robolectric) } } } diff --git a/sample/build.gradle.kts b/sample/build.gradle.kts index b46f953c..b5ff2cbd 100644 --- a/sample/build.gradle.kts +++ b/sample/build.gradle.kts @@ -18,62 +18,38 @@ kotlin { } sourceSets { - val commonMain by getting { - dependencies { - implementation(projects.box) - implementation(kotlin("stdlib")) - implementation(libs.coroutines.core) - implementation(libs.datetime) - } + commonMain.dependencies { + implementation(projects.box) + implementation(libs.coroutines.core) + implementation(libs.datetime) } - val commonTest by getting { - dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - } + commonTest.dependencies { + implementation(kotlin("test")) } - val androidMain by getting { - dependencies { - implementation(projects.compose) - implementation(libs.androidx.activity.compose) - implementation(libs.androidx.appcompat) - implementation(libs.androidx.lifecycle.runtime) - implementation(libs.coroutines.android) - implementation(libs.material) - implementation(compose.foundation) - implementation(compose.preview) - implementation(compose.runtime) - implementation(compose.ui) - } + androidMain.dependencies { + implementation(projects.compose) + implementation(libs.androidx.activity.compose) + implementation(libs.androidx.appcompat) + implementation(libs.androidx.lifecycle.runtime) + implementation(libs.coroutines.android) + implementation(libs.material) + implementation(compose.foundation) + implementation(compose.preview) + implementation(compose.runtime) + implementation(compose.ui) } - val androidUnitTest by getting { - dependencies { - implementation(kotlin("test-junit")) - } + getByName("desktopMain").dependencies { + implementation(projects.compose) + implementation(compose.desktop.currentOs) + implementation(compose.preview) } - val desktopMain by getting { - dependencies { - implementation(projects.compose) - implementation(compose.desktop.currentOs) - implementation(compose.preview) - } - } - - val jsMain by getting { - dependencies { - implementation(libs.coroutines.js) - implementation(compose.web.core) // required because of the compose plugin, but unused. - } - } - - val jsTest by getting { - dependencies { - implementation(kotlin("test-js")) - } + jsMain.dependencies { + implementation(libs.coroutines.js) + implementation(compose.web.core) // required because of the compose plugin, but unused. } } } diff --git a/scale/build.gradle.kts b/scale/build.gradle.kts index d2a53584..7315fced 100644 --- a/scale/build.gradle.kts +++ b/scale/build.gradle.kts @@ -23,32 +23,15 @@ kotlin { iosArm64() sourceSets { - val commonMain by getting { - dependencies { - api(projects.interpolate) - api(projects.kanvas) - api(projects.time) - api(libs.datetime) - } + commonMain.dependencies { + api(projects.interpolate) + api(projects.kanvas) + api(projects.time) + api(libs.datetime) } - val commonTest by getting { - dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - } - } - - val jvmTest by getting { - dependencies { - implementation(kotlin("test-junit")) - } - } - - val jsTest by getting { - dependencies { - implementation(kotlin("test-js")) - } + commonTest.dependencies { + implementation(kotlin("test")) } } } diff --git a/selection/build.gradle.kts b/selection/build.gradle.kts index 4a5321a1..fbf87908 100644 --- a/selection/build.gradle.kts +++ b/selection/build.gradle.kts @@ -23,30 +23,13 @@ kotlin { iosArm64() sourceSets { - val commonMain by getting { - dependencies { - api(projects.element) - } + commonMain.dependencies { + api(projects.element) } - val commonTest by getting { - dependencies { - implementation(libs.coroutines.test) - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - } - } - - val jvmTest by getting { - dependencies { - implementation(kotlin("test-junit")) - } - } - - val jsTest by getting { - dependencies { - implementation(kotlin("test-js")) - } + commonTest.dependencies { + implementation(libs.coroutines.test) + implementation(kotlin("test")) } } } diff --git a/shape/build.gradle.kts b/shape/build.gradle.kts index 7d66c064..1d8ba39f 100644 --- a/shape/build.gradle.kts +++ b/shape/build.gradle.kts @@ -23,29 +23,12 @@ kotlin { iosArm64() sourceSets { - val commonMain by getting { - dependencies { - api(projects.kanvas) - } + commonMain.dependencies { + api(projects.kanvas) } - val commonTest by getting { - dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - } - } - - val jvmTest by getting { - dependencies { - implementation(kotlin("test-junit")) - } - } - - val jsTest by getting { - dependencies { - implementation(kotlin("test-js")) - } + commonTest.dependencies { + implementation(kotlin("test")) } } } diff --git a/time/build.gradle.kts b/time/build.gradle.kts index bc4e67a9..5bad3713 100644 --- a/time/build.gradle.kts +++ b/time/build.gradle.kts @@ -23,29 +23,12 @@ kotlin { iosArm64() sourceSets { - val commonMain by getting { - dependencies { - api(libs.datetime) - } + commonMain.dependencies { + api(libs.datetime) } - val commonTest by getting { - dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - } - } - - val jvmTest by getting { - dependencies { - implementation(kotlin("test-junit")) - } - } - - val jsTest by getting { - dependencies { - implementation(kotlin("test-js")) - } + commonTest.dependencies { + implementation(kotlin("test")) } } }