Swift Export integration prototype

^KT-63736
diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/apple/AppleXcodeTasks.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/apple/AppleXcodeTasks.kt
index 902d3ee..73ac44b 100644
--- a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/apple/AppleXcodeTasks.kt
+++ b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/apple/AppleXcodeTasks.kt
@@ -21,9 +21,9 @@
 import org.jetbrains.kotlin.gradle.plugin.mpp.Framework
 import org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType
 import org.jetbrains.kotlin.gradle.plugin.mpp.apple.FrameworkCopy.Companion.dsymFile
+import org.jetbrains.kotlin.gradle.plugin.mpp.apple.swiftexport.registerSwiftExportTask
 import org.jetbrains.kotlin.gradle.plugin.mpp.enabledOnCurrentHost
-import org.jetbrains.kotlin.gradle.tasks.FatFrameworkTask
-import org.jetbrains.kotlin.gradle.tasks.dependsOn
+import org.jetbrains.kotlin.gradle.tasks.*
 import org.jetbrains.kotlin.gradle.tasks.locateOrRegisterTask
 import org.jetbrains.kotlin.gradle.tasks.registerTask
 import org.jetbrains.kotlin.gradle.utils.getFile
@@ -138,13 +138,13 @@
             task.description = "Packs $frameworkBuildType fat framework for Xcode"
             task.baseName = framework.baseName
             task.destinationDirProperty.fileProvider(appleFrameworkDir(frameworkTaskName))
-            task.isEnabled = frameworkBuildType == envBuildType
+            task.isEnabled = !project.kotlinPropertiesProvider.swiftExportEnabled && frameworkBuildType == envBuildType
         }.also {
             it.configure { task -> task.from(framework) }
         }
         else -> registerTask<FrameworkCopy>(frameworkTaskName) { task ->
             task.description = "Packs $frameworkBuildType ${frameworkTarget.name} framework for Xcode"
-            task.isEnabled = frameworkBuildType == envBuildType
+            task.isEnabled = !project.kotlinPropertiesProvider.swiftExportEnabled && frameworkBuildType == envBuildType
             task.sourceFramework.fileProvider(framework.linkTaskProvider.flatMap { it.outputFile })
             task.sourceDsym.fileProvider(dsymFile(task.sourceFramework.mapToFile()))
             task.dependsOn(framework.linkTaskProvider)
@@ -223,6 +223,12 @@
         AppleXcodeTasks.embedAndSignTaskPostfix
     )
 
+    val swiftExportTask: TaskProvider<*>? = if (project.kotlinPropertiesProvider.swiftExportEnabled && XcodeEnvironment.targets.contains(framework.target.konanTarget)) {
+        registerSwiftExportTask(framework)
+    } else {
+        null
+    }
+
     if (envBuildType == null || envTargets.isEmpty() || envEmbeddedFrameworksDir == null) {
         locateOrRegisterTask<DefaultTask>(frameworkTaskName) { task ->
             task.group = BasePlugin.BUILD_GROUP
@@ -273,6 +279,9 @@
     embedAndSignTask.configure { task ->
         val frameworkFile = framework.outputFile
         task.dependsOn(assembleTask)
+        if (swiftExportTask != null) {
+            task.dependsOn(swiftExportTask)
+        }
         task.sourceFramework.fileProvider(appleFrameworkDir(frameworkTaskName).map { it.resolve(frameworkFile.name) })
         task.destinationDirectory.set(envEmbeddedFrameworksDir)
         if (envSign != null) {
diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/apple/swiftexport/BuildSyntheticProjectWithSwiftExportPackage.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/apple/swiftexport/BuildSyntheticProjectWithSwiftExportPackage.kt
new file mode 100644
index 0000000..d41b95f
--- /dev/null
+++ b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/apple/swiftexport/BuildSyntheticProjectWithSwiftExportPackage.kt
@@ -0,0 +1,155 @@
+/*
+ * Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
+ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
+ */
+
+package org.jetbrains.kotlin.gradle.plugin.mpp.apple.swiftexport
+
+import org.gradle.api.DefaultTask
+import org.gradle.api.file.Directory
+import org.gradle.api.file.DirectoryProperty
+import org.gradle.api.file.FileSystemOperations
+import org.gradle.api.file.RegularFile
+import org.gradle.api.provider.Property
+import org.gradle.api.provider.Provider
+import org.gradle.api.provider.ProviderFactory
+import org.gradle.api.tasks.*
+import org.jetbrains.kotlin.gradle.plugin.mpp.apple.AppleXcodeTasks
+import org.jetbrains.kotlin.gradle.utils.appendLine
+import org.jetbrains.kotlin.gradle.utils.listFilesOrEmpty
+import org.jetbrains.kotlin.gradle.utils.mapToFile
+import org.jetbrains.kotlin.gradle.utils.runCommand
+import org.jetbrains.kotlin.utils.keysToMap
+import java.io.File
+import javax.inject.Inject
+
+abstract class BuildSyntheticProjectWithSwiftExportPackage : DefaultTask() {
+
+    @get:Inject
+    abstract val providerFactory: ProviderFactory
+
+    @get:Input
+    abstract val swiftApiModuleName: Property<String>
+
+    @get:Input
+    abstract val swiftLibraryName: Property<String>
+
+    @get:Input
+    val inheritedBuildSettingsFromEnvironment: Map<String, Provider<String>> get() = listOf(
+        "CONFIGURATION", "ARCHS", "ONLY_ACTIVE_ARCH",
+    ).keysToMap {
+        providerFactory.environmentVariable(it)
+    }
+
+    @get:Optional
+    @get:Input
+    val targetDeviceIdentifier: Provider<String> get() = providerFactory.environmentVariable("TARGET_DEVICE_IDENTIFIER")
+
+    @get:Input
+    val platformName: Provider<String> get() = providerFactory.environmentVariable("PLATFORM_NAME")
+
+    @get:OutputDirectory
+    val syntheticInterfacesPath: Provider<Directory> get() = syntheticProjectDirectory.map { it.dir("dd-interfaces") }
+
+    private val syntheticObjectFilesDirectory get() = syntheticProjectDirectory.map { it.dir("dd-o-files") }
+
+    @get:OutputFile
+    val syntheticLibraryPath: Provider<RegularFile> get() = syntheticObjectFilesDirectory.map { it.file("lib${swiftLibraryName.get()}.a") }
+
+    @get:OutputDirectory
+    val syntheticBuildIntermediatesPath: Provider<File> get() = syntheticProjectDirectory.map { it.dir("dd-other") }.mapToFile()
+
+    @get:Internal
+    abstract val syntheticProjectDirectory: DirectoryProperty
+
+    @TaskAction
+    fun run() {
+        val syntheticProjectPath = setUpSyntheticProject()
+        val syntheticObjectFilesDirectory = buildSyntheticProject(syntheticProjectPath)
+        packObjectFilesIntoLibrary(syntheticObjectFilesDirectory)
+    }
+
+    private fun setUpSyntheticProject(): File {
+        val syntheticForSpm = syntheticProjectDirectory.get().asFile
+        val syntheticProjectPath = syntheticForSpm.resolve("synthetic.xcodeproj")
+        syntheticProjectPath.mkdirs()
+
+        val pbxprojPath = syntheticProjectPath.resolve("project.pbxproj")
+        val syntheticProjectTemplate =
+            AppleXcodeTasks.javaClass.getResourceAsStream("/spm/project.pbxproj") ?: error("Missing synthetic project resource")
+
+        pbxprojPath.outputStream().writer().use { pbxprojWriter ->
+            syntheticProjectTemplate.reader().forEachLine { line ->
+                pbxprojWriter
+                    .append(line.replace(SYNTHETIC_PROJECT_MARKER, swiftApiModuleName.get()))
+                    .appendLine()
+            }
+        }
+        return syntheticProjectPath
+    }
+
+    private fun buildSyntheticProject(syntheticProjectPath: File): File {
+        val syntheticObjectFilesDirectory = this.syntheticObjectFilesDirectory.get().asFile
+        val intermediatesDestination = mapOf(
+            // Thin/universal object files
+            "TARGET_BUILD_DIR" to syntheticObjectFilesDirectory.canonicalPath,
+            // .swiftmodule interface
+            "BUILT_PRODUCTS_DIR" to syntheticInterfacesPath.get().asFile.canonicalPath
+        )
+        val inheritedBuildSettings = inheritedBuildSettingsFromEnvironment.mapValues {
+            it.value.get()
+        }
+
+        // FIXME: This will not work with dynamic libraries
+        runCommand(
+            listOf(
+                "xcodebuild",
+                "build",
+                "-derivedDataPath", syntheticBuildIntermediatesPath.get().canonicalPath,
+                "-project", syntheticProjectPath.canonicalPath,
+                "-scheme", swiftLibraryName.get(),
+                "-destination", destination(),
+            ) + (inheritedBuildSettings + intermediatesDestination).map { (k, v) -> "$k=$v" }
+        )
+        return syntheticObjectFilesDirectory
+    }
+
+    private fun packObjectFilesIntoLibrary(syntheticObjectFilesDirectory: File) {
+        val objectFilePaths = syntheticObjectFilesDirectory.listFilesOrEmpty().filter {
+            it.extension == "o"
+        }.map { it.canonicalPath }
+        if (objectFilePaths.isEmpty()) {
+            error("Synthetic project build didn't produce any object files")
+        }
+
+        runCommand(
+            listOf(
+                "libtool", "-static",
+                "-o", syntheticLibraryPath.get().asFile.canonicalPath,
+            ) + objectFilePaths,
+        )
+    }
+
+    private fun destination(): String {
+        val deviceId: String? = targetDeviceIdentifier.orNull
+        if (deviceId != null) return "id=$deviceId"
+
+        val platformName = platformName.orNull ?: error("Missing a target device identifier and a platform name")
+        val platform = mapOf(
+            "iphonesimulator" to "iOS Simulator",
+            "iphoneos" to "iOS",
+            "watchsimulator" to "watchOS Simulator",
+            "watchos" to "watchOS",
+            "appletvos" to "tvOS",
+            "appletvsimulator" to "tvOS Simulator",
+            "macosx" to "macOS",
+        )[platformName] ?: error("Unknown PLATFORM_NAME $platformName")
+
+        return "generic/platform=$platform"
+    }
+
+    companion object {
+        const val SYNTHETIC_PROJECT_MARKER = "<SwiftExportModuleName>"
+    }
+
+}
\ No newline at end of file
diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/apple/swiftexport/CopySwiftExportIntermediatesForConsumer.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/apple/swiftexport/CopySwiftExportIntermediatesForConsumer.kt
new file mode 100644
index 0000000..a165fe4
--- /dev/null
+++ b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/apple/swiftexport/CopySwiftExportIntermediatesForConsumer.kt
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
+ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
+ */
+
+package org.jetbrains.kotlin.gradle.plugin.mpp.apple.swiftexport
+
+import org.gradle.api.DefaultTask
+import org.gradle.api.file.FileSystemOperations
+import org.gradle.api.provider.Property
+import org.gradle.api.provider.Provider
+import org.gradle.api.provider.ProviderFactory
+import org.gradle.api.tasks.Input
+import org.gradle.api.tasks.InputDirectory
+import org.gradle.api.tasks.InputFile
+import org.gradle.api.tasks.OutputDirectory
+import org.gradle.api.tasks.OutputFile
+import org.gradle.api.tasks.TaskAction
+import java.io.File
+import javax.inject.Inject
+
+abstract class CopySwiftExportIntermediatesForConsumer : DefaultTask() {
+
+    @get:Inject
+    abstract val fileSystem: FileSystemOperations
+
+    @get:Inject
+    abstract val providerFactory: ProviderFactory
+
+    @get:InputDirectory
+    abstract val includeBridgeDirectory: Property<File>
+
+    @get:InputFile
+    abstract val kotlinLibraryPath: Property<File>
+
+    @get:InputFile
+    abstract val syntheticLibraryPath: Property<File>
+
+    @get:InputDirectory
+    abstract val syntheticInterfacesPath: Property<File>
+
+    @get:InputDirectory
+    val builtProductsDirectory: Provider<String> get() = providerFactory.environmentVariable("BUILT_PRODUCTS_DIR")
+
+    @get:OutputFile
+    val syntheticLibraryDestinationPath: Provider<File> get() = builtProductsDirectory.map { File(it).resolve(syntheticLibraryPath.get().name) }
+
+    @get:OutputFile
+    val kotlinLibraryDestinationPath: Provider<File> get() = builtProductsDirectory.map { File(it).resolve(kotlinLibraryPath.get().name) }
+
+    @get:OutputDirectory
+    val syntheticInterfacesDestinationPath: Provider<File> get() = builtProductsDirectory.map { File(it).resolve("KotlinBridge") }
+
+    @TaskAction
+    fun copy() {
+        fileSystem.copy {
+            it.from(kotlinLibraryPath)
+            it.from(syntheticInterfacesPath)
+            it.from(syntheticLibraryPath)
+            it.into(builtProductsDirectory)
+        }
+        fileSystem.copy {
+            it.from(includeBridgeDirectory)
+            it.into(syntheticInterfacesDestinationPath)
+        }
+    }
+}
\ No newline at end of file
diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/apple/swiftexport/GenerateSPMPackageFromSwiftExport.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/apple/swiftexport/GenerateSPMPackageFromSwiftExport.kt
new file mode 100644
index 0000000..b198f5e
--- /dev/null
+++ b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/apple/swiftexport/GenerateSPMPackageFromSwiftExport.kt
@@ -0,0 +1,123 @@
+/*
+ * Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
+ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
+ */
+
+package org.jetbrains.kotlin.gradle.plugin.mpp.apple.swiftexport
+
+import org.gradle.api.DefaultTask
+import org.gradle.api.file.DirectoryProperty
+import org.gradle.api.file.RegularFileProperty
+import org.gradle.api.provider.Property
+import org.gradle.api.tasks.Input
+import org.gradle.api.tasks.InputFile
+import org.gradle.api.tasks.Internal
+import org.gradle.api.tasks.OutputDirectory
+import org.gradle.api.tasks.TaskAction
+import org.jetbrains.kotlin.gradle.utils.appendLine
+import org.jetbrains.kotlin.incremental.createDirectory
+import org.jetbrains.kotlin.incremental.deleteRecursivelyOrThrow
+
+abstract class GenerateSPMPackageFromSwiftExport : DefaultTask() {
+
+    @get:Input
+    abstract val swiftApiModuleName: Property<String>
+    @get:Input
+    abstract val swiftLibraryName: Property<String>
+    @get:Input
+    abstract val kotlinLibraryName: Property<String>
+
+    @get:InputFile
+    abstract val swiftApiPath: RegularFileProperty
+    @get:InputFile
+    abstract val headerBridgePath: RegularFileProperty
+    @get:InputFile
+    abstract val libraryPath: RegularFileProperty
+
+    @get:OutputDirectory
+    abstract val packagePath: DirectoryProperty
+
+    @get:Internal
+    val headerBridgeIncludePath get() = headerBridgeModulePath.resolve("include")
+
+    private val swiftApiModule get() = swiftApiModuleName.get()
+    private val headerBridgeModule get() = swiftApiModule + "Bridge"
+    private val spmPackageRootPath get() = packagePath.get().asFile
+    private val sourcesPath get() = spmPackageRootPath.resolve("Sources")
+    private val swiftApiModulePath get() = sourcesPath.resolve(swiftApiModule)
+    private val headerBridgeModulePath get() = sourcesPath.resolve(headerBridgeModule)
+
+    @TaskAction
+    fun generate() {
+        preparePackageDirectory()
+        createHeaderTarget()
+        createSwiftTarget()
+        createPackageManifest()
+    }
+
+    private fun preparePackageDirectory() {
+        val spmSupportRootPath = packagePath.get().asFile
+        if (spmSupportRootPath.exists()) {
+            spmSupportRootPath.deleteRecursivelyOrThrow()
+        }
+        swiftApiModulePath.createDirectory()
+        headerBridgeIncludePath.createDirectory()
+    }
+
+    private fun createHeaderTarget() {
+        headerBridgePath.get().asFile.copyTo(
+            headerBridgeIncludePath.resolve("Kotlin.h")
+        )
+        headerBridgeIncludePath.resolve("module.modulemap").writeText(
+            """
+            module $headerBridgeModule {
+                umbrella "."
+                export *
+                
+                link "${swiftLibraryName.get()}"
+                link "${kotlinLibraryName.get()}"
+            }
+            """.trimIndent()
+        )
+        headerBridgeModulePath.resolve("linkingStub.c").writeText("\n")
+    }
+
+    private fun createSwiftTarget() {
+        swiftApiModulePath.resolve("Kotlin.swift").writer().use { kotlinApi ->
+            kotlinApi.append("import $headerBridgeModule\n\n")
+            swiftApiPath.get().asFile.reader().forEachLine {
+                kotlinApi.append(it).appendLine()
+            }
+        }
+    }
+
+    private fun createPackageManifest() {
+        val manifest = spmPackageRootPath.resolve("Package.swift")
+        manifest.writeText(
+            """
+            // swift-tools-version: 5.9
+            
+            import PackageDescription
+            let package = Package(
+                name: "$swiftApiModule",
+                products: [
+                    .library(
+                        name: "${swiftApiModule}Library",
+                        targets: ["$swiftApiModule"]
+                    ),
+                ],
+                targets: [
+                    .target(
+                        name: "$swiftApiModule",
+                        dependencies: ["$headerBridgeModule"]
+                    ),
+                    .target(
+                        name: "$headerBridgeModule"
+                    )
+                ]
+            )
+            """.trimIndent()
+        )
+    }
+
+}
\ No newline at end of file
diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/apple/swiftexport/SwiftExport.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/apple/swiftexport/SwiftExport.kt
new file mode 100644
index 0000000..24bf94a
--- /dev/null
+++ b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/apple/swiftexport/SwiftExport.kt
@@ -0,0 +1,217 @@
+/*
+ * Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
+ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
+ */
+
+package org.jetbrains.kotlin.gradle.plugin.mpp.apple.swiftexport
+
+import org.gradle.api.NamedDomainObjectContainer
+import org.gradle.api.Project
+import org.gradle.api.file.Directory
+import org.gradle.api.plugins.BasePlugin
+import org.gradle.api.provider.Provider
+import org.gradle.api.tasks.TaskProvider
+import org.jetbrains.kotlin.gradle.dsl.KotlinNativeBinaryContainer
+import org.jetbrains.kotlin.gradle.plugin.KotlinCompilation
+import org.jetbrains.kotlin.gradle.plugin.KotlinPluginLifecycle
+import org.jetbrains.kotlin.gradle.plugin.kotlinPluginLifecycle
+import org.jetbrains.kotlin.gradle.plugin.launch
+import org.jetbrains.kotlin.gradle.plugin.mpp.*
+import org.jetbrains.kotlin.gradle.tasks.dependsOn
+import org.jetbrains.kotlin.gradle.tasks.locateOrRegisterTask
+import org.jetbrains.kotlin.gradle.utils.future
+import org.jetbrains.kotlin.gradle.utils.getOrCreate
+import org.jetbrains.kotlin.gradle.utils.lowerCamelCaseName
+import org.jetbrains.kotlin.gradle.utils.mapToFile
+
+fun Project.registerSwiftExportTask(
+    framework: Framework
+): TaskProvider<*> {
+    return registerSwiftExportTask(
+        swiftApiModuleName = framework.baseName,
+        target = framework.target,
+        buildType = framework.buildType,
+    )
+}
+
+private fun Project.registerSwiftExportTask(
+    swiftApiModuleName: String,
+    target: KotlinNativeTarget,
+    buildType: NativeBuildType,
+): TaskProvider<*> {
+    val taskNamePrefix = lowerCamelCaseName(
+        target.disambiguationClassifier ?: target.name,
+        buildType.getName(),
+    )
+    val mainCompilation = target.compilations.getByName("main")
+
+    val swiftExportTask = registerSwiftExportRun(
+        taskNamePrefix = taskNamePrefix,
+        mainCompilation = mainCompilation,
+    )
+    val staticLibrary = registerSwiftExportCompilationAndGetBinary(
+        buildType = buildType,
+        compilations = target.compilations,
+        binaries = target.binaries,
+        mainCompilation = mainCompilation,
+        swiftExportTask = swiftExportTask,
+    )
+
+    val kotlinStaticLibraryName = staticLibrary.linkTaskProvider.map { it.baseName }
+    val swiftApiLibraryName = swiftApiModuleName + "Library"
+
+    val syntheticBuildRoot = layout.buildDirectory.dir("${taskNamePrefix}SPMPackage")
+    val packageGenerationTask = registerPackageGeneration(
+        taskNamePrefix = taskNamePrefix,
+        swiftApiModuleName = swiftApiModuleName,
+        swiftApiLibraryName = swiftApiLibraryName,
+        kotlinStaticLibraryName = kotlinStaticLibraryName,
+        swiftExportTask = swiftExportTask,
+        staticLibrary = staticLibrary,
+        syntheticBuildRoot = syntheticBuildRoot,
+    )
+    val syntheticProjectBuild = registerSyntheticProjectBuild(
+        taskNamePrefix = taskNamePrefix,
+        swiftApiModuleName = swiftApiModuleName,
+        swiftApiLibraryName = swiftApiLibraryName,
+        syntheticBuildRoot = syntheticBuildRoot,
+        packageGenerationTask = packageGenerationTask,
+    )
+
+    return registerCopyTask(
+        taskNamePrefix = taskNamePrefix,
+        staticLibrary = staticLibrary,
+        packageGenerationTask = packageGenerationTask,
+        syntheticProjectBuild = syntheticProjectBuild,
+    )
+}
+
+private fun Project.registerSwiftExportRun(
+    taskNamePrefix: String,
+    mainCompilation: KotlinCompilation<*>,
+): TaskProvider<SwiftExportTask> {
+    val swiftExportTaskName = taskNamePrefix + "SwiftExport"
+    return locateOrRegisterTask<SwiftExportTask>(swiftExportTaskName) { task ->
+        val directoriesProvider = project.future {
+            kotlinPluginLifecycle.await(KotlinPluginLifecycle.Stage.AfterFinaliseRefinesEdges)
+            mainCompilation.allKotlinSourceSets.flatMap {
+                it.kotlin.srcDirs.filter { it.exists() }.map { it.canonicalPath }
+            }
+        }
+        // Explicitly depend on source sets directories because there is no @InputDirectories annotation
+        project.launch {
+            directoriesProvider.await().forEach {
+                task.inputs.dir(it)
+            }
+        }
+        val outputs = layout.buildDirectory.dir("${swiftExportTaskName}SwiftExport")
+        val swiftIntermediates = outputs.map { it.dir("swiftIntermediates") }
+        val kotlinIntermediates = outputs.map { it.dir("kotlinIntermediates") }
+
+        // Input
+        task.sourcesRoots.set(project.provider { directoriesProvider.getOrThrow() })
+
+        // Output
+        task.swiftApiPath.set(swiftIntermediates.map { it.file("KotlinAPI.swift") })
+        task.headerBridgePath.set(swiftIntermediates.map { it.file("KotlinBridge.h") })
+        task.kotlinBridgePath.set(kotlinIntermediates.map { it.file("KotlinBridge.kt") })
+    }
+}
+
+private fun registerSwiftExportCompilationAndGetBinary(
+    buildType: NativeBuildType,
+    compilations: NamedDomainObjectContainer<KotlinNativeCompilation>,
+    binaries: KotlinNativeBinaryContainer,
+    mainCompilation: KotlinCompilation<*>,
+    swiftExportTask: TaskProvider<SwiftExportTask>,
+): StaticLibrary {
+    val swiftExportCompilationName = "swiftExportMain"
+    val swiftExportBinary = "swiftExportBinary"
+
+    compilations.getOrCreate(
+        swiftExportCompilationName,
+        invokeWhenCreated = { swiftExportCompilation ->
+            swiftExportCompilation.associateWith(mainCompilation)
+            swiftExportCompilation.compileTaskProvider.dependsOn(swiftExportTask)
+            swiftExportCompilation.defaultSourceSet.kotlin.srcDir(swiftExportTask.map { it.kotlinBridgePath.get().asFile.parent })
+            swiftExportCompilation.compilerOptions.options.optIn.add("kotlin.experimental.ExperimentalNativeApi")
+
+            binaries.staticLib(swiftExportBinary) { staticLib ->
+                staticLib.compilation = swiftExportCompilation
+            }
+        }
+    )
+
+    return binaries.getStaticLib(
+        swiftExportBinary,
+        buildType
+    )
+}
+
+private fun Project.registerPackageGeneration(
+    taskNamePrefix: String,
+    swiftApiModuleName: String,
+    swiftApiLibraryName: String,
+    kotlinStaticLibraryName: Provider<String>,
+    swiftExportTask: TaskProvider<SwiftExportTask>,
+    staticLibrary: StaticLibrary,
+    syntheticBuildRoot: Provider<Directory>,
+): TaskProvider<GenerateSPMPackageFromSwiftExport> {
+    val spmPackageGenTaskName = taskNamePrefix + "GenerateSPMPackage"
+    val packageGenerationTask = locateOrRegisterTask<GenerateSPMPackageFromSwiftExport>(spmPackageGenTaskName) { task ->
+        task.group = BasePlugin.BUILD_GROUP
+        task.description = "Generates $taskNamePrefix SPM Package"
+
+        // Input
+        task.swiftApiPath.set(swiftExportTask.map { it.swiftApiPath.get() })
+        task.headerBridgePath.set(swiftExportTask.map { it.headerBridgePath.get() })
+        task.libraryPath.set { staticLibrary.linkTaskProvider.map { it.outputFile.get() }.get() }
+        task.swiftLibraryName.set(swiftApiLibraryName)
+        task.kotlinLibraryName.set(kotlinStaticLibraryName)
+        task.swiftApiModuleName.set(swiftApiModuleName)
+
+        // Output
+        task.packagePath.set(syntheticBuildRoot.map { it.dir(swiftApiModuleName) })
+    }
+    packageGenerationTask.dependsOn(staticLibrary.linkTaskProvider)
+    packageGenerationTask.dependsOn(swiftExportTask)
+    return packageGenerationTask
+}
+
+private fun Project.registerSyntheticProjectBuild(
+    taskNamePrefix: String,
+    swiftApiModuleName: String,
+    swiftApiLibraryName: String,
+    syntheticBuildRoot: Provider<Directory>,
+    packageGenerationTask: TaskProvider<*>,
+): TaskProvider<BuildSyntheticProjectWithSwiftExportPackage> {
+    val buildTaskName = taskNamePrefix + "BuildSyntheticProject"
+    val syntheticProjectBuild = locateOrRegisterTask<BuildSyntheticProjectWithSwiftExportPackage>(buildTaskName) { task ->
+        task.group = BasePlugin.BUILD_GROUP
+        task.description = "Builds $taskNamePrefix synthetic project"
+        task.swiftApiModuleName.set(swiftApiModuleName)
+        task.swiftLibraryName.set(swiftApiLibraryName)
+        task.syntheticProjectDirectory.set(syntheticBuildRoot)
+    }
+    syntheticProjectBuild.dependsOn(packageGenerationTask)
+    return syntheticProjectBuild
+}
+
+private fun Project.registerCopyTask(
+    taskNamePrefix: String,
+    staticLibrary: StaticLibrary,
+    packageGenerationTask: TaskProvider<GenerateSPMPackageFromSwiftExport>,
+    syntheticProjectBuild: TaskProvider<BuildSyntheticProjectWithSwiftExportPackage>,
+): TaskProvider<*> {
+    val copyTaskName = taskNamePrefix + "CopySyntheticProjectIntermediates"
+    val copyTask = locateOrRegisterTask<CopySwiftExportIntermediatesForConsumer>(copyTaskName) { task ->
+        task.group = BasePlugin.BUILD_GROUP
+        task.description = "Copy $taskNamePrefix synthetic project intermediates"
+        task.includeBridgeDirectory.set(packageGenerationTask.map { it.headerBridgeIncludePath })
+        task.kotlinLibraryPath.set(staticLibrary.linkTaskProvider.flatMap { it.outputFile })
+        task.syntheticLibraryPath.set(syntheticProjectBuild.flatMap { it.syntheticLibraryPath.mapToFile() })
+        task.syntheticInterfacesPath.set(syntheticProjectBuild.flatMap { it.syntheticInterfacesPath.mapToFile() })
+    }
+    copyTask.dependsOn(syntheticProjectBuild)
+    return copyTask
+}
\ No newline at end of file
diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/apple/swiftexport/SwiftExportTask.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/apple/swiftexport/SwiftExportTask.kt
new file mode 100644
index 0000000..61181cf
--- /dev/null
+++ b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/apple/swiftexport/SwiftExportTask.kt
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
+ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
+ */
+
+package org.jetbrains.kotlin.gradle.plugin.mpp.apple.swiftexport
+
+import org.gradle.api.DefaultTask
+import org.gradle.api.file.RegularFileProperty
+import org.gradle.api.provider.ListProperty
+import org.gradle.api.tasks.Input
+import org.gradle.api.tasks.OutputFile
+import org.gradle.api.tasks.TaskAction
+import org.jetbrains.kotlin.sir.runner.SwiftExportConfig
+import org.jetbrains.kotlin.sir.runner.SwiftExportInput
+import org.jetbrains.kotlin.sir.runner.SwiftExportOutput
+import org.jetbrains.kotlin.sir.runner.runSwiftExport
+import java.nio.file.Paths
+
+
+abstract class SwiftExportTask : DefaultTask() {
+
+    @get:Input
+    abstract val sourcesRoots: ListProperty<String>
+
+    @get:OutputFile
+    abstract val swiftApiPath: RegularFileProperty
+
+    @get:OutputFile
+    abstract val headerBridgePath: RegularFileProperty
+
+    @get:OutputFile
+    abstract val kotlinBridgePath: RegularFileProperty
+
+    @TaskAction
+    fun run() {
+        runSwiftExport(
+            input = SwiftExportInput(
+                sourceRoots = sourcesRoots.get().map { Paths.get(it) },
+            ),
+            config = SwiftExportConfig(
+                settings = emptyMap(),
+            ),
+            output = SwiftExportOutput(
+                swiftApi = swiftApiPath.get().asFile.toPath(),
+                kotlinBridges = kotlinBridgePath.get().asFile.toPath(),
+                cHeaderBridges = headerBridgePath.get().asFile.toPath(),
+            )
+        )
+    }
+
+}
\ No newline at end of file
diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/registerKotlinPluginExtensions.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/registerKotlinPluginExtensions.kt
index 06c7166..3294b15 100644
--- a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/registerKotlinPluginExtensions.kt
+++ b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/registerKotlinPluginExtensions.kt
@@ -31,7 +31,10 @@
 import org.jetbrains.kotlin.gradle.targets.native.KotlinNativeConfigureBinariesSideEffect
 import org.jetbrains.kotlin.gradle.targets.native.SetupEmbedAndSignAppleFrameworkTaskSideEffect
 import org.jetbrains.kotlin.gradle.targets.native.internal.*
-import org.jetbrains.kotlin.gradle.targets.native.swiftExport.tasks.KotlinSwiftExportSetupAction
+import org.jetbrains.kotlin.gradle.targets.native.internal.AddKotlinPlatformIntegersSupportLibrary
+import org.jetbrains.kotlin.gradle.targets.native.internal.CInteropCommonizedCInteropApiElementsConfigurationsSetupAction
+import org.jetbrains.kotlin.gradle.targets.native.internal.SetupCInteropApiElementsConfigurationSideEffect
+import org.jetbrains.kotlin.gradle.targets.native.internal.SetupKotlinNativePlatformDependenciesForLegacyImport
 import org.jetbrains.kotlin.gradle.targets.native.tasks.artifact.KotlinArtifactsExtensionSetupAction
 import org.jetbrains.kotlin.gradle.tooling.RegisterBuildKotlinToolingMetadataTask
 
@@ -73,8 +76,6 @@
             register(project, KotlinRegisterCompilationArchiveTasksExtension)
             register(project, IdeMultiplatformImportActionSetupAction)
             register(project, KotlinLLDBScriptSetupAction)
-            register(project, KotlinSwiftExportSetupAction)
-            register(project, ExcludeDefaultPlatformDependenciesFromKotlinNativeCompileTasks)
         }
     }
 
@@ -150,4 +151,4 @@
 
 private val Project.isJs get() = kotlinExtensionOrNull is KotlinJsProjectExtension
 
-private val Project.isAndroid get() = kotlinExtension is KotlinAndroidProjectExtension
\ No newline at end of file
+private val Project.isAndroid get() = kotlinExtension is KotlinAndroidProjectExtension
diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/native/swiftExport/tasks/SwiftExportTask.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/native/swiftExport/tasks/SwiftExportTask.kt
deleted file mode 100644
index 98a29c6..0000000
--- a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/native/swiftExport/tasks/SwiftExportTask.kt
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
- * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
- */
-
-package org.jetbrains.kotlin.gradle.targets.native.swiftExport.tasks
-
-import org.gradle.api.DefaultTask
-import org.gradle.api.Project
-import org.gradle.api.file.DirectoryProperty
-import org.gradle.api.file.ProjectLayout
-import org.gradle.api.tasks.*
-import org.gradle.work.DisableCachingByDefault
-import org.jetbrains.kotlin.gradle.plugin.KotlinProjectSetupCoroutine
-import org.jetbrains.kotlin.gradle.tasks.locateOrRegisterTask
-import org.jetbrains.kotlin.sir.runner.SwiftExportInput
-import org.jetbrains.kotlin.sir.runner.SwiftExportOutput
-import org.jetbrains.kotlin.sir.runner.runSwiftExport
-import javax.inject.Inject
-
-internal val KotlinSwiftExportSetupAction = KotlinProjectSetupCoroutine {
-    locateOrRegisterSwiftExportTask()
-}
-
-@DisableCachingByDefault
-abstract class SwiftExportTask @Inject constructor(
-    layout: ProjectLayout
-) : DefaultTask() {
-
-    @get:PathSensitive(PathSensitivity.RELATIVE)
-    @get:InputDirectory
-    abstract val moduleRoot: DirectoryProperty
-
-    @get:OutputDirectory
-    abstract val swiftOutput: DirectoryProperty
-
-    @TaskAction
-    open fun swiftExport() {
-        logger.info("🧪 Run Swift Export")
-
-        val output = SwiftExportOutput(
-            swiftApi = swiftOutput.get().asFile.resolve("result.swift").toPath(),
-            kotlinBridges = swiftOutput.get().asFile.resolve("result.kt").toPath(),
-            cHeaderBridges = swiftOutput.get().asFile.resolve("result.c").toPath()
-        )
-
-        runSwiftExport(
-            input = SwiftExportInput(
-                sourceRoot = moduleRoot.get().asFile.toPath(),
-            ),
-            output = output
-        )
-    }
-}
-
-internal fun Project.locateOrRegisterSwiftExportTask(): TaskProvider<SwiftExportTask> {
-    return locateOrRegisterTask("swiftExport") { task ->
-        //FIXME: For test purpose only. Create a directory 'swiftexportInput' in your module and put '.kt' file in it
-        val resourcesDir = layout.projectDirectory.dir("swiftexportInput")
-        val swiftOutput = layout.buildDirectory.dir("swiftexport")
-
-        task.description = "Swift Export prototype task"
-        task.group = "swift export"
-        task.moduleRoot.set(resourcesDir)
-        task.swiftOutput.set(swiftOutput)
-    }
-}
\ No newline at end of file
diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/resources/spm/project.pbxproj b/libraries/tools/kotlin-gradle-plugin/src/common/resources/spm/project.pbxproj
new file mode 100644
index 0000000..980ab8ee
--- /dev/null
+++ b/libraries/tools/kotlin-gradle-plugin/src/common/resources/spm/project.pbxproj
@@ -0,0 +1,907 @@
+// !$*UTF8*$!
+{
+	archiveVersion = 1;
+	classes = {
+	};
+	objectVersion = 56;
+	objects = {
+
+/* Begin PBXCopyFilesBuildPhase section */
+		05F2823A27BFF52F00A213D9 /* Embed App Extensions */ = {
+			isa = PBXCopyFilesBuildPhase;
+			buildActionMask = 2147483647;
+			dstPath = "";
+			dstSubfolderSpec = 13;
+			files = (
+			);
+			name = "Embed App Extensions";
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXCopyFilesBuildPhase section */
+
+/* Begin PBXFileReference section */
+		05F281E327BFA36E00A213D9 /* ios.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ios.app"; sourceTree = BUILT_PRODUCTS_DIR; };
+		05F2820027BFF4EB00A213D9 /* macos.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "macos.app"; sourceTree = BUILT_PRODUCTS_DIR; };
+		05F2821827BFF52C00A213D9 /* watchos.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "watchos.app"; sourceTree = BUILT_PRODUCTS_DIR; };
+		05F2824827BFF63B00A213D9 /* tvos.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "tvos.app"; sourceTree = BUILT_PRODUCTS_DIR; };
+		05F2824827BFF73B00A213D9 /* <SwiftExportModuleName> */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = <SwiftExportModuleName>; sourceTree = "<group>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+		05F281E027BFA36E00A213D9 /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			    05F2825A27BFF65D00A213D9
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		05F281FD27BFF4EB00A213D9 /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			    05F2825A27BFF65D00A213D9
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		05F2824527BFF63B00A213D9 /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			    05F2825A27BFF65D00A213D9
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+		05F281BA27BFA02500A213D9 = {
+			isa = PBXGroup;
+			children = (
+			    05F2824827BFF73B00A213D9 /* <SwiftExportModuleName> */,
+				05F281C627BFA08C00A213D9 /* Products */,
+			);
+			sourceTree = "<group>";
+		};
+		05F281C627BFA08C00A213D9 /* Products */ = {
+			isa = PBXGroup;
+			children = (
+				05F281E327BFA36E00A213D9 /* ios.app */,
+				05F2820027BFF4EB00A213D9 /* macos.app */,
+				05F2821827BFF52C00A213D9 /* watchos.app */,
+				05F2824827BFF63B00A213D9 /* tvos.app */,
+			);
+			name = Products;
+			sourceTree = "<group>";
+		};
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+		05F281E227BFA36E00A213D9 /* ios */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = 05F281F927BFA37000A213D9 /* Build configuration list for PBXNativeTarget "ios" */;
+			buildPhases = (
+				05F281DF27BFA36E00A213D9 /* Sources */,
+				05F281E027BFA36E00A213D9 /* Frameworks */,
+				05F281E127BFA36E00A213D9 /* Resources */,
+			);
+			buildRules = (
+			);
+			dependencies = (
+			);
+			name = "ios";
+			packageProductDependencies = (
+                05F2825A27BFF64D00A213D9 /* <SwiftExportModuleName> */,
+            );
+			productName = "ios";
+			productReference = 05F281E327BFA36E00A213D9 /* ios.app */;
+			productType = "com.apple.product-type.application";
+		};
+		05F281FF27BFF4EB00A213D9 /* macos */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = 05F2821027BFF4ED00A213D9 /* Build configuration list for PBXNativeTarget "macos" */;
+			buildPhases = (
+				05F281FC27BFF4EB00A213D9 /* Sources */,
+				05F281FD27BFF4EB00A213D9 /* Frameworks */,
+				05F281FE27BFF4EB00A213D9 /* Resources */,
+			);
+			buildRules = (
+			);
+			dependencies = (
+			);
+			name = "macos";
+			productName = "macos-app";
+			productReference = 05F2820027BFF4EB00A213D9 /* macos.app */;
+			productType = "com.apple.product-type.application";
+		};
+		05F2821727BFF52B00A213D9 /* watchos */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = 05F2823B27BFF52F00A213D9 /* Build configuration list for PBXNativeTarget "watchos" */;
+			buildPhases = (
+				05F2821627BFF52B00A213D9 /* Resources */,
+				05F2823A27BFF52F00A213D9 /* Embed App Extensions */,
+			);
+			buildRules = (
+			);
+			dependencies = (
+			);
+			name = "watchos";
+			productName = "watchos";
+			productReference = 05F2821827BFF52C00A213D9 /* watchos.app */;
+			productType = "com.apple.product-type.application.watchapp2";
+		};
+		05F2824727BFF63B00A213D9 /* tvos */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = 05F2825A27BFF63D00A213D9 /* Build configuration list for PBXNativeTarget "tvos" */;
+			buildPhases = (
+				05F2824427BFF63B00A213D9 /* Sources */,
+				05F2824527BFF63B00A213D9 /* Frameworks */,
+				05F2824627BFF63B00A213D9 /* Resources */,
+			);
+			buildRules = (
+			);
+			dependencies = (
+			);
+			name = "tvos";
+			productName = "tvos";
+			productReference = 05F2824827BFF63B00A213D9 /* tvos.app */;
+			productType = "com.apple.product-type.application";
+		};
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+		05F281BB27BFA02500A213D9 /* Project object */ = {
+			isa = PBXProject;
+			attributes = {
+				BuildIndependentTargetsInParallel = 1;
+				LastUpgradeCheck = 1320;
+				TargetAttributes = {
+					05F281E227BFA36E00A213D9 = {
+						CreatedOnToolsVersion = 15.0;
+					};
+					05F281FF27BFF4EB00A213D9 = {
+						CreatedOnToolsVersion = 15.0;
+					};
+					05F2821727BFF52B00A213D9 = {
+						CreatedOnToolsVersion = 15.0;
+					};
+					05F2824727BFF63B00A213D9 = {
+						CreatedOnToolsVersion = 15.0;
+					};
+				};
+			};
+			buildConfigurationList = 05F281BE27BFA02500A213D9 /* Build configuration list for PBXProject "<SwiftExportModuleName>" */;
+			compatibilityVersion = "Xcode 15.0";
+			developmentRegion = en;
+			hasScannedForEncodings = 0;
+			knownRegions = (
+				en,
+				Base,
+			);
+			mainGroup = 05F281BA27BFA02500A213D9;
+			productRefGroup = 05F281C627BFA08C00A213D9 /* Products */;
+			projectDirPath = "";
+			projectRoot = "";
+			targets = (
+				05F281E227BFA36E00A213D9 /* ios */,
+				05F281FF27BFF4EB00A213D9 /* macos */,
+				05F2821727BFF52B00A213D9 /* watchos */,
+				05F2824727BFF63B00A213D9 /* tvos */,
+			);
+		};
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+		05F281E127BFA36E00A213D9 /* Resources */ = {
+			isa = PBXResourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		05F281FE27BFF4EB00A213D9 /* Resources */ = {
+			isa = PBXResourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		05F2821627BFF52B00A213D9 /* Resources */ = {
+			isa = PBXResourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		05F2824627BFF63B00A213D9 /* Resources */ = {
+			isa = PBXResourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+		05F281DF27BFA36E00A213D9 /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		05F281FC27BFF4EB00A213D9 /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		05F2824427BFF63B00A213D9 /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+		05F281BF27BFA02500A213D9 /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+			};
+			name = Debug;
+		};
+		05F281C027BFA02500A213D9 /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+			};
+			name = Release;
+		};
+		05F281FA27BFA37000A213D9 /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
+				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
+				CLANG_ANALYZER_NONNULL = YES;
+				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
+				CLANG_CXX_LIBRARY = "libc++";
+				CLANG_ENABLE_MODULES = YES;
+				CLANG_ENABLE_OBJC_ARC = YES;
+				CLANG_ENABLE_OBJC_WEAK = YES;
+				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+				CLANG_WARN_BOOL_CONVERSION = YES;
+				CLANG_WARN_COMMA = YES;
+				CLANG_WARN_CONSTANT_CONVERSION = YES;
+				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+				CLANG_WARN_EMPTY_BODY = YES;
+				CLANG_WARN_ENUM_CONVERSION = YES;
+				CLANG_WARN_INFINITE_RECURSION = YES;
+				CLANG_WARN_INT_CONVERSION = YES;
+				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
+				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+				CLANG_WARN_STRICT_PROTOTYPES = YES;
+				CLANG_WARN_SUSPICIOUS_MOVE = YES;
+				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+				CLANG_WARN_UNREACHABLE_CODE = YES;
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+				CODE_SIGN_STYLE = Automatic;
+				COPY_PHASE_STRIP = NO;
+				CURRENT_PROJECT_VERSION = 1;
+				DEBUG_INFORMATION_FORMAT = dwarf;
+				ENABLE_STRICT_OBJC_MSGSEND = YES;
+				ENABLE_TESTABILITY = YES;
+				GCC_C_LANGUAGE_STANDARD = gnu11;
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_NO_COMMON_BLOCKS = YES;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				GCC_PREPROCESSOR_DEFINITIONS = (
+					"DEBUG=1",
+					"$(inherited)",
+				);
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
+				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+				GCC_WARN_UNUSED_FUNCTION = YES;
+				GCC_WARN_UNUSED_VARIABLE = YES;
+				GENERATE_INFOPLIST_FILE = YES;
+				INFOPLIST_FILE = "";
+				INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
+				INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
+				INFOPLIST_KEY_UIMainStoryboardFile = Main;
+				INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
+				INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
+				IPHONEOS_DEPLOYMENT_TARGET = 15.2;
+				LD_RUNPATH_SEARCH_PATHS = (
+					"$(inherited)",
+					"@executable_path/Frameworks",
+				);
+				MARKETING_VERSION = 1.0;
+				MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
+				MTL_FAST_MATH = YES;
+				ONLY_ACTIVE_ARCH = YES;
+				PRODUCT_BUNDLE_IDENTIFIER = "com.dummy.ios";
+				PRODUCT_NAME = "$(TARGET_NAME)";
+				SDKROOT = iphoneos;
+				SWIFT_EMIT_LOC_STRINGS = YES;
+				TARGETED_DEVICE_FAMILY = "1,2";
+			};
+			name = Debug;
+		};
+		05F281FB27BFA37000A213D9 /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
+				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
+				CLANG_ANALYZER_NONNULL = YES;
+				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
+				CLANG_CXX_LIBRARY = "libc++";
+				CLANG_ENABLE_MODULES = YES;
+				CLANG_ENABLE_OBJC_ARC = YES;
+				CLANG_ENABLE_OBJC_WEAK = YES;
+				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+				CLANG_WARN_BOOL_CONVERSION = YES;
+				CLANG_WARN_COMMA = YES;
+				CLANG_WARN_CONSTANT_CONVERSION = YES;
+				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+				CLANG_WARN_EMPTY_BODY = YES;
+				CLANG_WARN_ENUM_CONVERSION = YES;
+				CLANG_WARN_INFINITE_RECURSION = YES;
+				CLANG_WARN_INT_CONVERSION = YES;
+				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
+				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+				CLANG_WARN_STRICT_PROTOTYPES = YES;
+				CLANG_WARN_SUSPICIOUS_MOVE = YES;
+				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+				CLANG_WARN_UNREACHABLE_CODE = YES;
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+				CODE_SIGN_STYLE = Automatic;
+				COPY_PHASE_STRIP = NO;
+				CURRENT_PROJECT_VERSION = 1;
+				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+				ENABLE_NS_ASSERTIONS = NO;
+				ENABLE_STRICT_OBJC_MSGSEND = YES;
+				GCC_C_LANGUAGE_STANDARD = gnu11;
+				GCC_NO_COMMON_BLOCKS = YES;
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
+				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+				GCC_WARN_UNUSED_FUNCTION = YES;
+				GCC_WARN_UNUSED_VARIABLE = YES;
+				GENERATE_INFOPLIST_FILE = YES;
+				INFOPLIST_FILE = "";
+				INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
+				INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
+				INFOPLIST_KEY_UIMainStoryboardFile = Main;
+				INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
+				INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
+				IPHONEOS_DEPLOYMENT_TARGET = 15.2;
+				LD_RUNPATH_SEARCH_PATHS = (
+					"$(inherited)",
+					"@executable_path/Frameworks",
+				);
+				MARKETING_VERSION = 1.0;
+				MTL_ENABLE_DEBUG_INFO = NO;
+				MTL_FAST_MATH = YES;
+				PRODUCT_BUNDLE_IDENTIFIER = "com.dummy.ios";
+				PRODUCT_NAME = "$(TARGET_NAME)";
+				SDKROOT = iphoneos;
+				SWIFT_EMIT_LOC_STRINGS = YES;
+				TARGETED_DEVICE_FAMILY = "1,2";
+				VALIDATE_PRODUCT = YES;
+			};
+			name = Release;
+		};
+		05F2821127BFF4ED00A213D9 /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
+				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
+				CLANG_ANALYZER_NONNULL = YES;
+				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
+				CLANG_CXX_LIBRARY = "libc++";
+				CLANG_ENABLE_MODULES = YES;
+				CLANG_ENABLE_OBJC_ARC = YES;
+				CLANG_ENABLE_OBJC_WEAK = YES;
+				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+				CLANG_WARN_BOOL_CONVERSION = YES;
+				CLANG_WARN_COMMA = YES;
+				CLANG_WARN_CONSTANT_CONVERSION = YES;
+				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+				CLANG_WARN_EMPTY_BODY = YES;
+				CLANG_WARN_ENUM_CONVERSION = YES;
+				CLANG_WARN_INFINITE_RECURSION = YES;
+				CLANG_WARN_INT_CONVERSION = YES;
+				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
+				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+				CLANG_WARN_STRICT_PROTOTYPES = YES;
+				CLANG_WARN_SUSPICIOUS_MOVE = YES;
+				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+				CLANG_WARN_UNREACHABLE_CODE = YES;
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+				CODE_SIGN_ENTITLEMENTS = "macos-app/macos_app.entitlements";
+				CODE_SIGN_STYLE = Automatic;
+				COMBINE_HIDPI_IMAGES = YES;
+				COPY_PHASE_STRIP = NO;
+				CURRENT_PROJECT_VERSION = 1;
+				DEBUG_INFORMATION_FORMAT = dwarf;
+				ENABLE_STRICT_OBJC_MSGSEND = YES;
+				ENABLE_TESTABILITY = YES;
+				GCC_C_LANGUAGE_STANDARD = gnu11;
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_NO_COMMON_BLOCKS = YES;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				GCC_PREPROCESSOR_DEFINITIONS = (
+					"DEBUG=1",
+					"$(inherited)",
+				);
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
+				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+				GCC_WARN_UNUSED_FUNCTION = YES;
+				GCC_WARN_UNUSED_VARIABLE = YES;
+				GENERATE_INFOPLIST_FILE = YES;
+				INFOPLIST_KEY_NSHumanReadableCopyright = "";
+				INFOPLIST_KEY_NSMainStoryboardFile = Main;
+				INFOPLIST_KEY_NSPrincipalClass = NSApplication;
+				LD_RUNPATH_SEARCH_PATHS = (
+					"$(inherited)",
+					"@executable_path/../Frameworks",
+				);
+				MACOSX_DEPLOYMENT_TARGET = 12.1;
+				MARKETING_VERSION = 1.0;
+				MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
+				MTL_FAST_MATH = YES;
+				ONLY_ACTIVE_ARCH = YES;
+				PRODUCT_BUNDLE_IDENTIFIER = "com.dummy.macos-app";
+				PRODUCT_NAME = "$(TARGET_NAME)";
+				SDKROOT = macosx;
+				SWIFT_EMIT_LOC_STRINGS = YES;
+			};
+			name = Debug;
+		};
+		05F2821227BFF4ED00A213D9 /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
+				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
+				CLANG_ANALYZER_NONNULL = YES;
+				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
+				CLANG_CXX_LIBRARY = "libc++";
+				CLANG_ENABLE_MODULES = YES;
+				CLANG_ENABLE_OBJC_ARC = YES;
+				CLANG_ENABLE_OBJC_WEAK = YES;
+				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+				CLANG_WARN_BOOL_CONVERSION = YES;
+				CLANG_WARN_COMMA = YES;
+				CLANG_WARN_CONSTANT_CONVERSION = YES;
+				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+				CLANG_WARN_EMPTY_BODY = YES;
+				CLANG_WARN_ENUM_CONVERSION = YES;
+				CLANG_WARN_INFINITE_RECURSION = YES;
+				CLANG_WARN_INT_CONVERSION = YES;
+				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
+				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+				CLANG_WARN_STRICT_PROTOTYPES = YES;
+				CLANG_WARN_SUSPICIOUS_MOVE = YES;
+				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+				CLANG_WARN_UNREACHABLE_CODE = YES;
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+				CODE_SIGN_ENTITLEMENTS = "macos-app/macos_app.entitlements";
+				CODE_SIGN_STYLE = Automatic;
+				COMBINE_HIDPI_IMAGES = YES;
+				COPY_PHASE_STRIP = NO;
+				CURRENT_PROJECT_VERSION = 1;
+				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+				ENABLE_NS_ASSERTIONS = NO;
+				ENABLE_STRICT_OBJC_MSGSEND = YES;
+				GCC_C_LANGUAGE_STANDARD = gnu11;
+				GCC_NO_COMMON_BLOCKS = YES;
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
+				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+				GCC_WARN_UNUSED_FUNCTION = YES;
+				GCC_WARN_UNUSED_VARIABLE = YES;
+				GENERATE_INFOPLIST_FILE = YES;
+				INFOPLIST_KEY_NSHumanReadableCopyright = "";
+				INFOPLIST_KEY_NSMainStoryboardFile = Main;
+				INFOPLIST_KEY_NSPrincipalClass = NSApplication;
+				LD_RUNPATH_SEARCH_PATHS = (
+					"$(inherited)",
+					"@executable_path/../Frameworks",
+				);
+				MACOSX_DEPLOYMENT_TARGET = 12.1;
+				MARKETING_VERSION = 1.0;
+				MTL_ENABLE_DEBUG_INFO = NO;
+				MTL_FAST_MATH = YES;
+				PRODUCT_BUNDLE_IDENTIFIER = "com.dummy.macos-app";
+				PRODUCT_NAME = "$(TARGET_NAME)";
+				SDKROOT = macosx;
+				SWIFT_EMIT_LOC_STRINGS = YES;
+			};
+			name = Release;
+		};
+		05F2823C27BFF52F00A213D9 /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
+				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
+				CLANG_ANALYZER_NONNULL = YES;
+				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
+				CLANG_CXX_LIBRARY = "libc++";
+				CLANG_ENABLE_MODULES = YES;
+				CLANG_ENABLE_OBJC_ARC = YES;
+				CLANG_ENABLE_OBJC_WEAK = YES;
+				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+				CLANG_WARN_BOOL_CONVERSION = YES;
+				CLANG_WARN_COMMA = YES;
+				CLANG_WARN_CONSTANT_CONVERSION = YES;
+				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+				CLANG_WARN_EMPTY_BODY = YES;
+				CLANG_WARN_ENUM_CONVERSION = YES;
+				CLANG_WARN_INFINITE_RECURSION = YES;
+				CLANG_WARN_INT_CONVERSION = YES;
+				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
+				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+				CLANG_WARN_STRICT_PROTOTYPES = YES;
+				CLANG_WARN_SUSPICIOUS_MOVE = YES;
+				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+				CLANG_WARN_UNREACHABLE_CODE = YES;
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+				CODE_SIGN_STYLE = Automatic;
+				COPY_PHASE_STRIP = NO;
+				CURRENT_PROJECT_VERSION = 1;
+				DEBUG_INFORMATION_FORMAT = dwarf;
+				ENABLE_STRICT_OBJC_MSGSEND = YES;
+				ENABLE_TESTABILITY = YES;
+				GCC_C_LANGUAGE_STANDARD = gnu11;
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_NO_COMMON_BLOCKS = YES;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				GCC_PREPROCESSOR_DEFINITIONS = (
+					"DEBUG=1",
+					"$(inherited)",
+				);
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
+				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+				GCC_WARN_UNUSED_FUNCTION = YES;
+				GCC_WARN_UNUSED_VARIABLE = YES;
+				GENERATE_INFOPLIST_FILE = YES;
+				IBSC_MODULE = watchos_target_WatchKit_Extension;
+				INFOPLIST_KEY_CFBundleDisplayName = "watchos";
+				INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
+				MARKETING_VERSION = 1.0;
+				MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
+				MTL_FAST_MATH = YES;
+				ONLY_ACTIVE_ARCH = YES;
+				PRODUCT_BUNDLE_IDENTIFIER = "com.dummy.watchos.watchkitapp";
+				PRODUCT_NAME = "$(TARGET_NAME)";
+				SDKROOT = watchos;
+				SKIP_INSTALL = YES;
+				SWIFT_EMIT_LOC_STRINGS = YES;
+				TARGETED_DEVICE_FAMILY = 4;
+				WATCHOS_DEPLOYMENT_TARGET = 8.3;
+			};
+			name = Debug;
+		};
+		05F2823D27BFF52F00A213D9 /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
+				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
+				CLANG_ANALYZER_NONNULL = YES;
+				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
+				CLANG_CXX_LIBRARY = "libc++";
+				CLANG_ENABLE_MODULES = YES;
+				CLANG_ENABLE_OBJC_ARC = YES;
+				CLANG_ENABLE_OBJC_WEAK = YES;
+				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+				CLANG_WARN_BOOL_CONVERSION = YES;
+				CLANG_WARN_COMMA = YES;
+				CLANG_WARN_CONSTANT_CONVERSION = YES;
+				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+				CLANG_WARN_EMPTY_BODY = YES;
+				CLANG_WARN_ENUM_CONVERSION = YES;
+				CLANG_WARN_INFINITE_RECURSION = YES;
+				CLANG_WARN_INT_CONVERSION = YES;
+				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
+				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+				CLANG_WARN_STRICT_PROTOTYPES = YES;
+				CLANG_WARN_SUSPICIOUS_MOVE = YES;
+				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+				CLANG_WARN_UNREACHABLE_CODE = YES;
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+				CODE_SIGN_STYLE = Automatic;
+				COPY_PHASE_STRIP = NO;
+				CURRENT_PROJECT_VERSION = 1;
+				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+				ENABLE_NS_ASSERTIONS = NO;
+				ENABLE_STRICT_OBJC_MSGSEND = YES;
+				GCC_C_LANGUAGE_STANDARD = gnu11;
+				GCC_NO_COMMON_BLOCKS = YES;
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
+				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+				GCC_WARN_UNUSED_FUNCTION = YES;
+				GCC_WARN_UNUSED_VARIABLE = YES;
+				GENERATE_INFOPLIST_FILE = YES;
+				IBSC_MODULE = watchos_target_WatchKit_Extension;
+				INFOPLIST_KEY_CFBundleDisplayName = "watchos";
+				INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
+				MARKETING_VERSION = 1.0;
+				MTL_ENABLE_DEBUG_INFO = NO;
+				MTL_FAST_MATH = YES;
+				PRODUCT_BUNDLE_IDENTIFIER = "com.dummy.watchos.watchkitapp";
+				PRODUCT_NAME = "$(TARGET_NAME)";
+				SDKROOT = watchos;
+				SKIP_INSTALL = YES;
+				SWIFT_EMIT_LOC_STRINGS = YES;
+				TARGETED_DEVICE_FAMILY = 4;
+				VALIDATE_PRODUCT = YES;
+				WATCHOS_DEPLOYMENT_TARGET = 8.3;
+			};
+			name = Release;
+		};
+		05F2825B27BFF63D00A213D9 /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
+				ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image";
+				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
+				CLANG_ANALYZER_NONNULL = YES;
+				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
+				CLANG_CXX_LIBRARY = "libc++";
+				CLANG_ENABLE_MODULES = YES;
+				CLANG_ENABLE_OBJC_ARC = YES;
+				CLANG_ENABLE_OBJC_WEAK = YES;
+				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+				CLANG_WARN_BOOL_CONVERSION = YES;
+				CLANG_WARN_COMMA = YES;
+				CLANG_WARN_CONSTANT_CONVERSION = YES;
+				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+				CLANG_WARN_EMPTY_BODY = YES;
+				CLANG_WARN_ENUM_CONVERSION = YES;
+				CLANG_WARN_INFINITE_RECURSION = YES;
+				CLANG_WARN_INT_CONVERSION = YES;
+				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
+				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+				CLANG_WARN_STRICT_PROTOTYPES = YES;
+				CLANG_WARN_SUSPICIOUS_MOVE = YES;
+				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+				CLANG_WARN_UNREACHABLE_CODE = YES;
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+				CODE_SIGN_STYLE = Automatic;
+				COPY_PHASE_STRIP = NO;
+				CURRENT_PROJECT_VERSION = 1;
+				DEBUG_INFORMATION_FORMAT = dwarf;
+				ENABLE_STRICT_OBJC_MSGSEND = YES;
+				ENABLE_TESTABILITY = YES;
+				GCC_C_LANGUAGE_STANDARD = gnu11;
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_NO_COMMON_BLOCKS = YES;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				GCC_PREPROCESSOR_DEFINITIONS = (
+					"DEBUG=1",
+					"$(inherited)",
+				);
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
+				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+				GCC_WARN_UNUSED_FUNCTION = YES;
+				GCC_WARN_UNUSED_VARIABLE = YES;
+				GENERATE_INFOPLIST_FILE = YES;
+				INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
+				INFOPLIST_KEY_UIMainStoryboardFile = Main;
+				INFOPLIST_KEY_UIUserInterfaceStyle = Automatic;
+				LD_RUNPATH_SEARCH_PATHS = (
+					"$(inherited)",
+					"@executable_path/Frameworks",
+				);
+				MARKETING_VERSION = 1.0;
+				MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
+				MTL_FAST_MATH = YES;
+				ONLY_ACTIVE_ARCH = YES;
+				PRODUCT_BUNDLE_IDENTIFIER = "com.dummy.tvos";
+				PRODUCT_NAME = "$(TARGET_NAME)";
+				SDKROOT = appletvos;
+				SWIFT_EMIT_LOC_STRINGS = YES;
+				TARGETED_DEVICE_FAMILY = 3;
+				TVOS_DEPLOYMENT_TARGET = 15.2;
+			};
+			name = Debug;
+		};
+		05F2825C27BFF63D00A213D9 /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
+				ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image";
+				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
+				CLANG_ANALYZER_NONNULL = YES;
+				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
+				CLANG_CXX_LIBRARY = "libc++";
+				CLANG_ENABLE_MODULES = YES;
+				CLANG_ENABLE_OBJC_ARC = YES;
+				CLANG_ENABLE_OBJC_WEAK = YES;
+				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+				CLANG_WARN_BOOL_CONVERSION = YES;
+				CLANG_WARN_COMMA = YES;
+				CLANG_WARN_CONSTANT_CONVERSION = YES;
+				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+				CLANG_WARN_EMPTY_BODY = YES;
+				CLANG_WARN_ENUM_CONVERSION = YES;
+				CLANG_WARN_INFINITE_RECURSION = YES;
+				CLANG_WARN_INT_CONVERSION = YES;
+				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
+				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+				CLANG_WARN_STRICT_PROTOTYPES = YES;
+				CLANG_WARN_SUSPICIOUS_MOVE = YES;
+				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+				CLANG_WARN_UNREACHABLE_CODE = YES;
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+				CODE_SIGN_STYLE = Automatic;
+				COPY_PHASE_STRIP = NO;
+				CURRENT_PROJECT_VERSION = 1;
+				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+				ENABLE_NS_ASSERTIONS = NO;
+				ENABLE_STRICT_OBJC_MSGSEND = YES;
+				GCC_C_LANGUAGE_STANDARD = gnu11;
+				GCC_NO_COMMON_BLOCKS = YES;
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
+				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+				GCC_WARN_UNUSED_FUNCTION = YES;
+				GCC_WARN_UNUSED_VARIABLE = YES;
+				GENERATE_INFOPLIST_FILE = YES;
+				INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
+				INFOPLIST_KEY_UIMainStoryboardFile = Main;
+				INFOPLIST_KEY_UIUserInterfaceStyle = Automatic;
+				LD_RUNPATH_SEARCH_PATHS = (
+					"$(inherited)",
+					"@executable_path/Frameworks",
+				);
+				MARKETING_VERSION = 1.0;
+				MTL_ENABLE_DEBUG_INFO = NO;
+				MTL_FAST_MATH = YES;
+				PRODUCT_BUNDLE_IDENTIFIER = "com.dummy.tvos";
+				PRODUCT_NAME = "$(TARGET_NAME)";
+				SDKROOT = appletvos;
+				SWIFT_EMIT_LOC_STRINGS = YES;
+				TARGETED_DEVICE_FAMILY = 3;
+				TVOS_DEPLOYMENT_TARGET = 15.2;
+				VALIDATE_PRODUCT = YES;
+			};
+			name = Release;
+		};
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+		05F281BE27BFA02500A213D9 /* Build configuration list for PBXProject "<SwiftExportModuleName>" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				05F281BF27BFA02500A213D9 /* Debug */,
+				05F281C027BFA02500A213D9 /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+		05F281F927BFA37000A213D9 /* Build configuration list for PBXNativeTarget "ios" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				05F281FA27BFA37000A213D9 /* Debug */,
+				05F281FB27BFA37000A213D9 /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+		05F2821027BFF4ED00A213D9 /* Build configuration list for PBXNativeTarget "macos" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				05F2821127BFF4ED00A213D9 /* Debug */,
+				05F2821227BFF4ED00A213D9 /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+		05F2823B27BFF52F00A213D9 /* Build configuration list for PBXNativeTarget "watchos" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				05F2823C27BFF52F00A213D9 /* Debug */,
+				05F2823D27BFF52F00A213D9 /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+		05F2825A27BFF63D00A213D9 /* Build configuration list for PBXNativeTarget "tvos" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				05F2825B27BFF63D00A213D9 /* Debug */,
+				05F2825C27BFF63D00A213D9 /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+/* End XCConfigurationList section */
+
+/* Begin XCSwiftPackageProductDependency section */
+		05F2825A27BFF64D00A213D9 /* LocalLibrary */ = {
+			isa = XCSwiftPackageProductDependency;
+			productName = <SwiftExportModuleName>Library;
+		};
+/* End XCSwiftPackageProductDependency section */
+
+/* Begin PBXBuildFile section */
+		05F2825A27BFF65D00A213D9 /* LocalLibrary in Frameworks */ = {isa = PBXBuildFile; productRef = 05F2825A27BFF64D00A213D9 /* LocalLibrary */; };
+/* End PBXBuildFile section */
+	};
+	rootObject = 05F281BB27BFA02500A213D9 /* Project object */;
+}
diff --git a/native/swift/sir-runner/src/org/jetbrains/kotlin/sir/runner/SwiftExportRunner.kt b/native/swift/sir-runner/src/org/jetbrains/kotlin/sir/runner/SwiftExportRunner.kt
index 92ed088..124f6e2 100644
--- a/native/swift/sir-runner/src/org/jetbrains/kotlin/sir/runner/SwiftExportRunner.kt
+++ b/native/swift/sir-runner/src/org/jetbrains/kotlin/sir/runner/SwiftExportRunner.kt
@@ -16,7 +16,7 @@
 )
 
 public data class SwiftExportInput(
-    val sourceRoot: Path, // todo: we do not support multi-modules currently. see KT-65220
+    val sourceRoots: List<Path>, // todo: we do not support multi-modules currently. see KT-65220
     val libraries: List<Path> = emptyList(), // todo: not supported currently. see KT-65221
 )
 
diff --git a/native/swift/sir-runner/src/org/jetbrains/kotlin/sir/runner/builders/buildSwiftModule.kt b/native/swift/sir-runner/src/org/jetbrains/kotlin/sir/runner/builders/buildSwiftModule.kt
index 8bf2f0a..9bfa59b 100644
--- a/native/swift/sir-runner/src/org/jetbrains/kotlin/sir/runner/builders/buildSwiftModule.kt
+++ b/native/swift/sir-runner/src/org/jetbrains/kotlin/sir/runner/builders/buildSwiftModule.kt
@@ -27,7 +27,7 @@
 
             addModule(
                 buildKtSourceModule {
-                    addSourceRoot(input.sourceRoot)
+                    addSourceRoots(input.sourceRoots)
                     platform = NativePlatforms.unspecifiedNativePlatform
                     moduleName = "main"
                 }