refactor(01-03): apply recipe.* conventions to composeApp + shared, drop js
- composeApp/build.gradle.kts now applies 4 recipe.* IDs (kotlin.multiplatform, compose.multiplatform, android.application, quality); removes all structural target/android/nativeDistributions blocks (114 -> 28 lines) - shared/build.gradle.kts applies recipe.kotlin.multiplatform + recipe.quality + androidLibrary; adds explicitApi() (D-12) and KotlinNativeTarget/Framework baseName = "Shared" override (D-07 / PITFALL #10); keeps android { } block per Open Question #1 - Adds libs.koin.android to androidMain dependencies (for Plan 04's MainApplication androidContext) - Drops js target per D-01: removes js { browser() } from both modules and deletes shared/src/jsMain/Platform.js.kt - iosX64 remains absent per D-02 - No version literals leak; tools/verify-no-version-literals.sh + verify-shared-pure.sh both pass
This commit is contained in:
@@ -1,42 +1,24 @@
|
||||
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
|
||||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||
|
||||
plugins {
|
||||
alias(libs.plugins.kotlinMultiplatform)
|
||||
id("recipe.kotlin.multiplatform")
|
||||
id("recipe.quality")
|
||||
alias(libs.plugins.androidLibrary)
|
||||
}
|
||||
|
||||
kotlin {
|
||||
androidTarget {
|
||||
compilerOptions {
|
||||
jvmTarget.set(JvmTarget.JVM_11)
|
||||
explicitApi()
|
||||
|
||||
// Override framework baseName: shared exposes "Shared.framework" to Swift, while
|
||||
// composeApp's convention-plugin default is "ComposeApp.framework". (D-07 / PITFALL #10)
|
||||
targets.withType<org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget>().configureEach {
|
||||
binaries.withType<org.jetbrains.kotlin.gradle.plugin.mpp.Framework>().configureEach {
|
||||
baseName = "Shared"
|
||||
}
|
||||
}
|
||||
|
||||
iosArm64()
|
||||
iosSimulatorArm64()
|
||||
|
||||
jvm {
|
||||
compilerOptions {
|
||||
jvmTarget.set(JvmTarget.JVM_21)
|
||||
}
|
||||
}
|
||||
|
||||
js {
|
||||
browser()
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalWasmDsl::class)
|
||||
wasmJs {
|
||||
browser()
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
commonMain.dependencies {
|
||||
// put your Multiplatform dependencies here
|
||||
}
|
||||
commonTest.dependencies {
|
||||
implementation(libs.kotlin.test)
|
||||
// Phase 1: intentionally empty. Domain models + DTOs land Phase 2+.
|
||||
// D-19 / INFRA-06: Do NOT add Ktor, Compose, or SQLDelight deps here — EVER.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
package dev.ulfrx.recipe
|
||||
|
||||
class JsPlatform : Platform {
|
||||
override val name: String = "Web with Kotlin/JS"
|
||||
}
|
||||
|
||||
actual fun getPlatform(): Platform = JsPlatform()
|
||||
Reference in New Issue
Block a user