Skip to content

Commit

Permalink
Use default hierarchy template (#599)
Browse files Browse the repository at this point in the history
  • Loading branch information
twyatt authored Nov 28, 2023
1 parent 3a52902 commit 4a8155c
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 181 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"))
}
}
}
15 changes: 6 additions & 9 deletions log-engine-tuulbox/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,16 @@ kotlin {
jvmToolchain(libs.versions.jvm.toolchain.get().toInt())

androidTarget().publishAllLibraryVariants()
js().browser()

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

sourceSets {
val commonMain by getting {
dependencies {
api(project(":core"))
api(libs.tuulbox.logging)
}
commonMain.dependencies {
api(project(":core"))
api(libs.tuulbox.logging)
}
}
}
Expand Down

0 comments on commit 4a8155c

Please sign in to comment.