Migrate KMP to swift module export
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||
import org.jetbrains.kotlin.gradle.swiftexport.ExperimentalSwiftExportDsl
|
||||
|
||||
plugins {
|
||||
alias(libs.plugins.androidApplication)
|
||||
@@ -24,6 +25,17 @@ kotlin {
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalSwiftExportDsl::class)
|
||||
swiftExport {
|
||||
moduleName = "ComposeApp"
|
||||
flattenPackage = "dev.carlosmartino.template"
|
||||
|
||||
export(project(":features:common")) {
|
||||
moduleName = "CommonFeature"
|
||||
flattenPackage = "dev.carlosmartino.template.common"
|
||||
}
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
androidMain.dependencies {
|
||||
implementation(compose.preview)
|
||||
|
||||
@@ -152,7 +152,7 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "if [ \"YES\" = \"$OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED\" ]; then\n echo \"Skipping Gradle build task invocation due to OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED environment variable set to \\\"YES\\\"\"\n exit 0\nfi\ncd \"$SRCROOT/../..\"\n./gradlew :app:composeApp:embedAndSignAppleFrameworkForXcode\n";
|
||||
shellScript = "cd \"$SRCROOT/../..\"\n./gradlew :app:composeApp:embedSwiftExportForXcode\n";
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import ComposeApp
|
||||
|
||||
struct ComposeView: UIViewControllerRepresentable {
|
||||
func makeUIViewController(context: Context) -> UIViewController {
|
||||
MainViewControllerKt.MainViewController()
|
||||
MainViewController()
|
||||
}
|
||||
|
||||
func updateUIViewController(_ uiViewController: UIViewController, context: Context) {}
|
||||
@@ -12,10 +12,6 @@ struct ComposeView: UIViewControllerRepresentable {
|
||||
|
||||
struct ContentView: View {
|
||||
var body: some View {
|
||||
ComposeView()
|
||||
.ignoresSafeArea()
|
||||
ComposeView().ignoresSafeArea()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ android-minSdk = "26"
|
||||
android-targetSdk = "36"
|
||||
# Platform specific versions
|
||||
agp = "8.13.0"
|
||||
kotlin = "2.2.20"
|
||||
kotlin = "2.3.0-Beta1"
|
||||
androidx-activity = "1.11.0"
|
||||
androidx-core = "1.17.0"
|
||||
androidx-espresso = "3.7.0"
|
||||
|
||||
Reference in New Issue
Block a user