From 53a231ffbc5a494f3c7c8a55ec9c2977d7efb49d Mon Sep 17 00:00:00 2001 From: Artur Babichev Date: Wed, 10 Apr 2024 01:20:11 +0400 Subject: [PATCH] remove workaround --- .../notedelight/ProjectExtensions.kt | 31 ------------------- ios-compose-kit/build.gradle.kts | 4 +-- shared-compose-ui/build.gradle.kts | 5 ++- shared/build.gradle.kts | 5 ++- 4 files changed, 6 insertions(+), 39 deletions(-) diff --git a/build-logic/convention/src/main/kotlin/com/softartdev/notedelight/ProjectExtensions.kt b/build-logic/convention/src/main/kotlin/com/softartdev/notedelight/ProjectExtensions.kt index 7af02500..ab7f38fe 100644 --- a/build-logic/convention/src/main/kotlin/com/softartdev/notedelight/ProjectExtensions.kt +++ b/build-logic/convention/src/main/kotlin/com/softartdev/notedelight/ProjectExtensions.kt @@ -4,37 +4,6 @@ import org.gradle.api.Project import org.gradle.api.artifacts.VersionCatalog import org.gradle.api.artifacts.VersionCatalogsExtension import org.gradle.kotlin.dsl.getByType -import org.jetbrains.kotlin.gradle.plugin.KotlinCompilation.Companion.MAIN_COMPILATION_NAME -import org.jetbrains.kotlin.gradle.plugin.KotlinCompilation.Companion.TEST_COMPILATION_NAME -import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet -import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet.Companion.COMMON_MAIN_SOURCE_SET_NAME -import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet.Companion.COMMON_TEST_SOURCE_SET_NAME -import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSetContainer -import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget val Project.libs get(): VersionCatalog = extensions.getByType().named("libs") - -//FIXME https://github.com/cashapp/sqldelight/issues/4523 -fun KotlinSourceSetContainer.iosIntermediateSourceSets(vararg iosTargets: KotlinNativeTarget) { - val children: List> = iosTargets.map { target -> - val main = target.compilations.getByName(MAIN_COMPILATION_NAME).defaultSourceSet - val test = target.compilations.getByName(TEST_COMPILATION_NAME).defaultSourceSet - return@map main to test - } - val parent: Pair = Pair( - first = sourceSets.getByName(COMMON_MAIN_SOURCE_SET_NAME), - second = sourceSets.getByName(COMMON_TEST_SOURCE_SET_NAME) - ) - createIntermediateSourceSet("iosMain", children.map { it.first }, parent.first) - createIntermediateSourceSet("iosTest", children.map { it.second }, parent.second) -} - -private fun KotlinSourceSetContainer.createIntermediateSourceSet( - name: String, - children: List, - parent: KotlinSourceSet -): KotlinSourceSet = sourceSets.maybeCreate(name).apply { - dependsOn(parent) - children.forEach { it.dependsOn(this) } -} diff --git a/ios-compose-kit/build.gradle.kts b/ios-compose-kit/build.gradle.kts index 76c39678..0a5d1a43 100644 --- a/ios-compose-kit/build.gradle.kts +++ b/ios-compose-kit/build.gradle.kts @@ -1,4 +1,3 @@ -import com.softartdev.notedelight.iosIntermediateSourceSets import org.gradle.internal.os.OperatingSystem plugins { @@ -10,7 +9,8 @@ compose { kotlinCompilerPlugin.set(libs.versions.composeCompiler.get()) } kotlin { - iosIntermediateSourceSets(iosArm64(), iosSimulatorArm64()) + iosArm64() + iosSimulatorArm64() applyDefaultHierarchyTemplate() cocoapods { diff --git a/shared-compose-ui/build.gradle.kts b/shared-compose-ui/build.gradle.kts index 15a441a4..4b9b2e86 100644 --- a/shared-compose-ui/build.gradle.kts +++ b/shared-compose-ui/build.gradle.kts @@ -1,5 +1,3 @@ -import com.softartdev.notedelight.iosIntermediateSourceSets - plugins { alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.android.library) @@ -17,7 +15,8 @@ kotlin { } } androidTarget() - iosIntermediateSourceSets(iosArm64(), iosSimulatorArm64()) + iosArm64() + iosSimulatorArm64() applyDefaultHierarchyTemplate() sourceSets { diff --git a/shared/build.gradle.kts b/shared/build.gradle.kts index 69287292..3d2176d5 100644 --- a/shared/build.gradle.kts +++ b/shared/build.gradle.kts @@ -1,9 +1,7 @@ -import com.softartdev.notedelight.iosIntermediateSourceSets import org.gradle.internal.os.OperatingSystem import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { - alias(libs.plugins.gradle.convention) alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.kotlin.cocoapods) alias(libs.plugins.sqlDelight) @@ -56,7 +54,8 @@ kotlin { jvmToolchain(libs.versions.jdk.get().toInt()) jvm() androidTarget() - iosIntermediateSourceSets(iosArm64(), iosSimulatorArm64()) + iosArm64() + iosSimulatorArm64() applyDefaultHierarchyTemplate() sourceSets {