Skip to content

Commit

Permalink
use multiplatform plugin instead of jvm
Browse files Browse the repository at this point in the history
  • Loading branch information
dsvag committed Feb 11, 2024
1 parent fec3f6f commit 39402c4
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 60 deletions.
45 changes: 0 additions & 45 deletions build-logic/src/main/kotlin/elmslie.kotlin-jvm-lib.gradle.kts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
@file:Suppress("UnstableApiUsage")
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
kotlin("multiplatform")
id("com.android.library")
id("elmslie.detekt")
}

kotlin {
applyDefaultHierarchyTemplate()

androidTarget {
jvm {
compilations.all {
kotlinOptions {
jvmTarget = JvmTarget.toString()
compilerOptions.configure {
jvmTarget.set(JvmTarget.JVM_11)
}
}
}

iosX64()
iosArm64()
}
iosSimulatorArm64()
iosX64()
}
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
plugins {
alias(libs.plugins.androidApplication) apply false
alias(libs.plugins.kotlinJvm) apply false
alias(libs.plugins.kotlinMultiplatform) apply false
}
22 changes: 16 additions & 6 deletions elmslie-core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
plugins {
id("elmslie.kotlin-jvm-lib")
id("elmslie.tests-convention")
id("elmslie.kotlin-multiplatform-lib")
}

dependencies {
implementation(libs.kotlinx.coroutinesCore)
testImplementation(libs.kotlinx.coroutinesTest)
}
kotlin {
sourceSets {
val commonMain by getting {
dependencies {
implementation(libs.kotlinx.coroutinesCore)
}
}
val commonTest by getting {
dependencies {
implementation(libs.kotlinx.coroutinesTest)
implementation(libs.kotlin.test)
}
}
}
}
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ kotlinx-coroutinesCore = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-co
kotlinx-coroutinesTest = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines" }

[plugins]
kotlinJvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
androidApplication = { id = "com.android.application", version.ref = "agp" }

0 comments on commit 39402c4

Please sign in to comment.