diff --git a/CHANGELOG.md b/CHANGELOG.md index 56e94a2d..c8d047ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ [//]: # (Removed, Added, Changed, Fixed, Updated) +### Fixed +- fix the broken test-main dependencies in the intermediate KMP source sets. + ### Added - set `unitTest` source set tree for Android to the usual `test` tree. diff --git a/fluxo-kmp-conf/src/main/kotlin/fluxo/conf/dsl/container/impl/KmpTargetContainerImpl.kt b/fluxo-kmp-conf/src/main/kotlin/fluxo/conf/dsl/container/impl/KmpTargetContainerImpl.kt index e83b2ee8..a64808d9 100644 --- a/fluxo-kmp-conf/src/main/kotlin/fluxo/conf/dsl/container/impl/KmpTargetContainerImpl.kt +++ b/fluxo-kmp-conf/src/main/kotlin/fluxo/conf/dsl/container/impl/KmpTargetContainerImpl.kt @@ -55,9 +55,7 @@ internal abstract class KmpTargetContainerImpl( override fun setup(k: KotlinMultiplatformExtension) { val target = k.createTarget() - if (allowManualHierarchy) { - setupParentSourceSet(k, k.bundleFor(target)) - } + setupParentSourceSet(k, k.bundleFor(target)) } @@ -69,9 +67,12 @@ internal abstract class KmpTargetContainerImpl( } override fun setupParentSourceSet(k: KotlinMultiplatformExtension, child: SourceSetBundle) { - // Android source sets can always require manual hierarchy setup. - if (!allowManualHierarchy && !child.isAndroid) return val bundle = k.commonJvm + + // Fix the broken test-main dependencies in the intermediate KMP source sets. + bundle.test.dependsOn(bundle.main) + + if (!allowManualHierarchy) return @Suppress("DEPRECATION") child dependsOn bundle super.setupParentSourceSet(k, bundle) diff --git a/fluxo-kmp-conf/src/main/kotlin/fluxo/conf/dsl/container/impl/target/TargetAndroidContainer.kt b/fluxo-kmp-conf/src/main/kotlin/fluxo/conf/dsl/container/impl/target/TargetAndroidContainer.kt index 3d6f2a1d..fbbb66b9 100644 --- a/fluxo-kmp-conf/src/main/kotlin/fluxo/conf/dsl/container/impl/target/TargetAndroidContainer.kt +++ b/fluxo-kmp-conf/src/main/kotlin/fluxo/conf/dsl/container/impl/target/TargetAndroidContainer.kt @@ -94,13 +94,12 @@ internal abstract class TargetAndroidContainer( setupAndroid(project) - if (!allowManualHierarchy) { - return - } - val layoutV2 = ctx.androidLayoutV2 val bundle = k.sourceSets.bundleFor(target, androidLayoutV2 = layoutV2, isAndroid = true) setupParentSourceSet(k, bundle) + if (!allowManualHierarchy) { + return + } /** * Configure Android's variants,