Adam Brown
06/04/2022, 5:40 AMios()
to my common gradle file, it starts failing to resolve my dependencies:
Could not resolve org.jetbrains.compose.foundation:foundation:1.1.0.
Required by:
project :common
Adam Brown
06/04/2022, 5:40 AMimport org.jetbrains.compose.compose
plugins {
kotlin("multiplatform")
id("org.jetbrains.compose")
id("com.android.library")
id("kotlin-parcelize")
}
group = "com.darkrockstudios.apps.hammer"
version = "1.0-SNAPSHOT"
kotlin {
android()
jvm("desktop") {
compilations.all {
kotlinOptions.jvmTarget = "11"
}
}
ios {
binaries {
framework {
baseName = "common"
}
}
}
sourceSets {
val commonMain by getting {
dependencies {
implementation(compose.runtime)
implementation(compose.foundation)
implementation(compose.material)
api("com.arkivanov.decompose:decompose:0.6.0")
implementation("com.arkivanov.decompose:extensions-compose-jetbrains:0.6.0")
api("io.github.aakira:napier:2.6.1")
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
}
}
val androidMain by getting {
dependencies {
api("androidx.appcompat:appcompat:1.4.2")
api("androidx.core:core-ktx:1.8.0")
api("com.arkivanov.decompose:extensions-compose-jetbrains:0.6.0")
}
}
val iosMain by getting
val iosTest by getting
val androidTest by getting {
dependencies {
implementation("junit:junit:4.13.2")
}
}
val desktopMain by getting {
dependencies {
api(compose.preview)
api("com.arkivanov.decompose:extensions-compose-jetbrains:0.6.0")
}
}
val desktopTest by getting
}
}
android {
compileSdk = 31
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
defaultConfig {
minSdk = 24
targetSdk = 31
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}
ephemient
06/04/2022, 5:51 AMephemient
06/04/2022, 5:52 AMAdam Brown
06/04/2022, 5:52 AMAdam Brown
06/04/2022, 5:53 AMAdam Brown
06/04/2022, 5:59 AMAdam Brown
06/04/2022, 5:59 AMephemient
06/04/2022, 6:00 AMephemient
06/04/2022, 6:03 AMKotlin doesn't currently support sharing a source set for these combinations:
• Several JVM targets
• JVM + Android targetsso that pretty much rules out any possible application of hierarchy…
Adam Brown
06/04/2022, 6:06 AMAdam Brown
06/04/2022, 6:06 AMAdam Brown
06/04/2022, 6:06 AMAdam Brown
06/04/2022, 6:07 AMAdam Brown
06/04/2022, 6:09 AMAdam Brown
06/04/2022, 6:09 AMval composeUi by getting {
dependencies {
api(compose.runtime)
api(compose.foundation)
api(compose.material)
api("com.arkivanov.decompose:extensions-compose-jetbrains:0.6.0")
}
}
ephemient
06/04/2022, 6:15 AMcreating
instead of getting
. then you want to jvmMain { dependsOn(composeUi) }
ephemient
06/04/2022, 6:16 AMjvmMain { dependsOn(composeUi) }; androidMain { dependsOn(composeUi) }
isn't supported, which for now means there's not really any point to doing this. either you only support one JVM-like platform, in which case just put Compose dependencies on that platform only, or you support multiple, in which case you need a new moduleAdam Brown
06/04/2022, 6:19 AMAdam Brown
06/04/2022, 6:19 AMAdam Brown
06/04/2022, 6:44 AMcommonMain
come from? When in create a new module with a name like composeUi
it doesn't recognize a source set: composeUiMain
Arkadii Ivanov
06/04/2022, 6:59 AMephemient
06/04/2022, 7:00 AM${name}Main
and ${name}Test
source sets by default, so if you did
kotlin {
jvm {
compilations.create("composeUi")
then you'd have composeUiMain
and composeUiTest
source sets. but I don't think that's what you wantAdam Brown
06/04/2022, 7:35 AMAdam Brown
06/04/2022, 7:38 AMAdam Brown
06/04/2022, 7:41 AMmain
source set still doesn't see the compose classes:
val kotlin_version: String by extra
plugins {
kotlin("multiplatform")
id("org.jetbrains.compose")
id("com.android.library")
id("kotlin-parcelize")
}
group = "com.darkrockstudios.apps.hammer.composeui"
version = "1.0-SNAPSHOT"
kotlin {
android()
jvm {
compilations.all {
kotlinOptions.jvmTarget = "11"
}
}
sourceSets {
val jvmMain by getting {
dependencies {
api(project(":common"))
api(compose.runtime)
api(compose.foundation)
api(compose.material)
api("com.arkivanov.decompose:extensions-compose-jetbrains:0.6.0")
}
}
}
dependencies {
api(project(":common"))
api(compose.runtime)
api(compose.foundation)
api(compose.material)
api("com.arkivanov.decompose:extensions-compose-jetbrains:0.6.0")
}
}
android {
compileSdk = 31
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
defaultConfig {
minSdk = 24
targetSdk = 31
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}
dependencies {
api(project(":common"))
api(compose.runtime)
api(compose.foundation)
api(compose.material)
api("com.arkivanov.decompose:extensions-compose-jetbrains:0.6.0")
}
repositories {
mavenCentral()
}
Adam Brown
06/04/2022, 7:41 AMAdam Brown
06/04/2022, 7:42 AMArkadii Ivanov
06/04/2022, 7:47 AMephemient
06/04/2022, 7:49 AMAdam Brown
06/04/2022, 7:50 AMephemient
06/04/2022, 7:50 AMkotlin {
sourceSets {
val commonMain by getting {
dependencies {
Adam Brown
06/04/2022, 7:50 AMcommonMain
is a special source set, My previous mp module was CALLED common
so I thought commonMain
was named so b/c of the module...Adam Brown
06/04/2022, 7:51 AMcomposeUiMain
and various things...Adam Brown
06/04/2022, 7:52 AMArkadii Ivanov
06/04/2022, 7:52 AMephemient
06/04/2022, 7:53 AMAdam Brown
06/04/2022, 7:53 AMephemient
06/04/2022, 7:55 AMArkadii Ivanov
06/04/2022, 7:56 AMArkadii Ivanov
06/04/2022, 7:58 AMAdam Brown
06/04/2022, 7:59 AMArkadii Ivanov
06/04/2022, 8:01 AMAdam Brown
06/04/2022, 8:11 AMArkadii Ivanov
06/04/2022, 8:12 AMAdam Brown
06/04/2022, 8:12 AMAdam Brown
06/04/2022, 9:17 AMAdam Brown
06/04/2022, 9:17 AMArkadii Ivanov
06/04/2022, 9:18 AMAdam Brown
06/04/2022, 9:24 AMAdam Brown
06/04/2022, 9:24 AM