Skip to content

Commit

Permalink
Use default hierarchy template
Browse files Browse the repository at this point in the history
  • Loading branch information
twyatt committed Nov 22, 2023
1 parent ba4a66e commit 91aab9d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 172 deletions.
112 changes: 20 additions & 92 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,115 +8,43 @@ plugins {
id("com.vanniktech.maven.publish")
}

/* ```
* common
* |-- js
* |-- android
* '-- apple
* |-- ios
* '-- macos
* ```
*/
kotlin {
explicitApi()
jvmToolchain(libs.versions.jvm.toolchain.get().toInt())

androidTarget().publishAllLibraryVariants()
js().browser()
iosX64()
macosArm64()
iosArm64()
iosSimulatorArm64()
iosX64()
js().browser()
macosArm64()
macosX64()

sourceSets {
val commonMain by getting {
dependencies {
api(project(":exceptions"))
api(libs.kotlinx.coroutines.core)
api(libs.uuid)
implementation(libs.tuulbox.collections)
}
}

val commonTest by getting {
dependencies {
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
implementation(libs.tuulbox.logging)
implementation(libs.kotlinx.coroutines.test)
}
}

val jsTest by getting {
dependencies {
implementation(kotlin("test-js"))
}
}

val androidMain by getting {
dependencies {
api(libs.kotlinx.coroutines.android)
implementation(libs.androidx.core)
implementation(libs.androidx.startup)
commonMain.dependencies {
api(project(":exceptions"))
api(libs.kotlinx.coroutines.core)
api(libs.uuid)
implementation(libs.tuulbox.collections)

// Workaround for AtomicFU plugin not automatically adding JVM dependency for Android.
// https://github.com/Kotlin/kotlinx-atomicfu/issues/145
implementation(libs.atomicfu)

implementation(libs.tuulbox.coroutines)
}
}

val androidUnitTest by getting {
dependencies {
implementation(kotlin("test-junit"))
}
}

val appleMain by creating {
dependsOn(commonMain)
commonTest.dependencies {
implementation(kotlin("test"))
implementation(libs.tuulbox.logging)
implementation(libs.kotlinx.coroutines.test)
}

val appleTest by creating
androidMain.dependencies {
api(libs.kotlinx.coroutines.android)
implementation(libs.androidx.core)
implementation(libs.androidx.startup)

val macosX64Main by getting {
dependsOn(appleMain)
}
// Workaround for AtomicFU plugin not automatically adding JVM dependency for Android.
// https://github.com/Kotlin/kotlinx-atomicfu/issues/145
implementation(libs.atomicfu)

val macosX64Test by getting {
dependsOn(appleTest)
}

val macosArm64Main by getting {
dependsOn(appleMain)
}

val macosArm64Test by getting {
dependsOn(appleTest)
}

val iosX64Main by getting {
dependsOn(appleMain)
}

val iosX64Test by getting {
dependsOn(appleTest)
}

val iosArm64Main by getting {
dependsOn(appleMain)
}

val iosArm64Test by getting {
dependsOn(appleTest)
}

val iosSimulatorArm64Main by getting {
dependsOn(appleMain)
}
val iosSimulatorArm64Test by getting {
dependsOn(appleTest)
implementation(libs.tuulbox.coroutines)
}

all {
Expand Down
86 changes: 6 additions & 80 deletions exceptions/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,95 +5,21 @@ plugins {
id("com.vanniktech.maven.publish")
}

/* ```
* common
* |-- js
* |-- jvm
* '-- apple
* |-- ios
* '-- macos
* ```
*/
kotlin {
explicitApi()
jvmToolchain(libs.versions.jvm.toolchain.get().toInt())

jvm()
js().browser()
iosX64()
macosArm64()
iosArm64()
iosSimulatorArm64()
iosX64()
js().browser()
jvm()
macosArm64()
macosX64()

sourceSets {
val commonMain by getting {
dependencies {
}
}

val commonTest by getting {
dependencies {
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
}
}

val jsTest by getting {
dependencies {
implementation(kotlin("test-js"))
}
}

val jvmTest by getting {
dependencies {
implementation(kotlin("test-junit"))
}
}

val appleMain by creating {
dependsOn(commonMain)
}

val appleTest by creating

val macosX64Main by getting {
dependsOn(appleMain)
}

val macosX64Test by getting {
dependsOn(appleTest)
}

val macosArm64Main by getting {
dependsOn(appleMain)
}

val macosArm64Test by getting {
dependsOn(appleTest)
}

val iosX64Main by getting {
dependsOn(appleMain)
}

val iosX64Test by getting {
dependsOn(appleTest)
}

val iosArm64Main by getting {
dependsOn(appleMain)
}

val iosArm64Test by getting {
dependsOn(appleTest)
}

val iosSimulatorArm64Main by getting {
dependsOn(appleMain)
}
val iosSimulatorArm64Test by getting {
dependsOn(appleTest)
commonTest.dependencies {
implementation(kotlin("test"))
}
}
}

0 comments on commit 91aab9d

Please sign in to comment.