From 4ac946cd062d12a00bbe6fc4eef6975396345e21 Mon Sep 17 00:00:00 2001 From: Nikita Lipsky Date: Mon, 5 Dec 2022 14:34:33 +0200 Subject: [PATCH] Refactor todoapp-lite to follow KMM structure and add iOS target (#2536) --- experimental/examples/todoapp-lite/.gitignore | 14 +- .../{desktop.run.xml => desktopApp.run.xml} | 9 +- .../examples/todoapp-lite/.run/iosApp.run.xml | 8 + .../todoapp-lite/.run/iosApp_.run.xml | 7 + experimental/examples/todoapp-lite/README.md | 34 +- .../todoapp-lite/android/build.gradle.kts | 29 -- .../todoapp-lite/androidApp/build.gradle.kts | 34 ++ .../src/main/AndroidManifest.xml | 0 .../java/example/todoapp/lite/MainActivity.kt | 6 +- .../todoapp-lite/common/build.gradle.kts | 42 -- .../{desktop => desktopApp}/build.gradle.kts | 10 +- .../kotlin/example/todoapp/lite/Main.kt | 9 +- .../examples/todoapp-lite/gradle.properties | 33 +- .../iosApp/Configuration/TeamId.xcconfig | 1 + .../examples/todoapp-lite/iosApp/Podfile | 5 + .../TodoAppLite.xcodeproj/project.pbxproj | 380 ++++++++++++++++++ .../todoapp-lite/iosApp/iosApp/Info.plist | 48 +++ .../todoapp-lite/iosApp/iosApp/iosApp.swift | 15 + .../todoapp-lite/run-configurations.png | Bin 0 -> 15762 bytes .../screenshots/desktop-run-configuration.png | Bin 2582 -> 0 bytes .../examples/todoapp-lite/settings.gradle.kts | 6 +- .../todoapp-lite/shared/build.gradle.kts | 63 +++ .../src/androidMain/AndroidManifest.xml | 0 .../example/todoapp/lite/common/Utils.kt | 0 .../src/androidMain/kotlin/main.android.kt | 6 + .../drawable-v24/ic_launcher_foreground.xml | 0 .../res/drawable/ic_launcher_background.xml | 0 .../res/mipmap-anydpi-v26/ic_launcher.xml | 0 .../mipmap-anydpi-v26/ic_launcher_round.xml | 0 .../res/mipmap-hdpi/ic_launcher.png | Bin .../res/mipmap-hdpi/ic_launcher_round.png | Bin .../res/mipmap-mdpi/ic_launcher.png | Bin .../res/mipmap-mdpi/ic_launcher_round.png | Bin .../res/mipmap-xhdpi/ic_launcher.png | Bin .../res/mipmap-xhdpi/ic_launcher_round.png | Bin .../res/mipmap-xxhdpi/ic_launcher.png | Bin .../res/mipmap-xxhdpi/ic_launcher_round.png | Bin .../res/mipmap-xxxhdpi/ic_launcher.png | Bin .../res/mipmap-xxxhdpi/ic_launcher_round.png | Bin .../src/androidMain/res/values/strings.xml | 0 .../example/todoapp/lite/common/EditDialog.kt | 0 .../todoapp/lite/common/MainContent.kt | 0 .../todoapp/lite/common/RootContent.kt | 2 +- .../example/todoapp/lite/common/RootStore.kt | 0 .../example/todoapp/lite/common/TodoItem.kt | 0 .../example/todoapp/lite/common/Utils.kt | 0 .../example/todoapp/lite/common/Utils.kt | 0 .../src/desktopMain/kotlin/main.desktop.kt | 6 + .../example/todoapp/lite/common/Utils.kt | 32 ++ .../shared/src/iosMain/kotlin/main.ios.kt | 26 ++ 50 files changed, 695 insertions(+), 130 deletions(-) rename experimental/examples/todoapp-lite/.run/{desktop.run.xml => desktopApp.run.xml} (70%) create mode 100644 experimental/examples/todoapp-lite/.run/iosApp.run.xml create mode 100644 experimental/examples/todoapp-lite/.run/iosApp_.run.xml delete mode 100755 experimental/examples/todoapp-lite/android/build.gradle.kts create mode 100755 experimental/examples/todoapp-lite/androidApp/build.gradle.kts rename experimental/examples/todoapp-lite/{android => androidApp}/src/main/AndroidManifest.xml (100%) rename experimental/examples/todoapp-lite/{android => androidApp}/src/main/java/example/todoapp/lite/MainActivity.kt (72%) delete mode 100755 experimental/examples/todoapp-lite/common/build.gradle.kts rename experimental/examples/todoapp-lite/{desktop => desktopApp}/build.gradle.kts (76%) rename experimental/examples/todoapp-lite/{desktop => desktopApp}/src/jvmMain/kotlin/example/todoapp/lite/Main.kt (72%) create mode 100644 experimental/examples/todoapp-lite/iosApp/Configuration/TeamId.xcconfig create mode 100644 experimental/examples/todoapp-lite/iosApp/Podfile create mode 100644 experimental/examples/todoapp-lite/iosApp/TodoAppLite.xcodeproj/project.pbxproj create mode 100644 experimental/examples/todoapp-lite/iosApp/iosApp/Info.plist create mode 100644 experimental/examples/todoapp-lite/iosApp/iosApp/iosApp.swift create mode 100644 experimental/examples/todoapp-lite/run-configurations.png delete mode 100644 experimental/examples/todoapp-lite/screenshots/desktop-run-configuration.png create mode 100755 experimental/examples/todoapp-lite/shared/build.gradle.kts rename experimental/examples/todoapp-lite/{common => shared}/src/androidMain/AndroidManifest.xml (100%) rename experimental/examples/todoapp-lite/{common => shared}/src/androidMain/kotlin/example/todoapp/lite/common/Utils.kt (100%) create mode 100644 experimental/examples/todoapp-lite/shared/src/androidMain/kotlin/main.android.kt rename experimental/examples/todoapp-lite/{common => shared}/src/androidMain/res/drawable-v24/ic_launcher_foreground.xml (100%) rename experimental/examples/todoapp-lite/{common => shared}/src/androidMain/res/drawable/ic_launcher_background.xml (100%) rename experimental/examples/todoapp-lite/{common => shared}/src/androidMain/res/mipmap-anydpi-v26/ic_launcher.xml (100%) rename experimental/examples/todoapp-lite/{common => shared}/src/androidMain/res/mipmap-anydpi-v26/ic_launcher_round.xml (100%) rename experimental/examples/todoapp-lite/{common => shared}/src/androidMain/res/mipmap-hdpi/ic_launcher.png (100%) rename experimental/examples/todoapp-lite/{common => shared}/src/androidMain/res/mipmap-hdpi/ic_launcher_round.png (100%) rename experimental/examples/todoapp-lite/{common => shared}/src/androidMain/res/mipmap-mdpi/ic_launcher.png (100%) rename experimental/examples/todoapp-lite/{common => shared}/src/androidMain/res/mipmap-mdpi/ic_launcher_round.png (100%) rename experimental/examples/todoapp-lite/{common => shared}/src/androidMain/res/mipmap-xhdpi/ic_launcher.png (100%) rename experimental/examples/todoapp-lite/{common => shared}/src/androidMain/res/mipmap-xhdpi/ic_launcher_round.png (100%) rename experimental/examples/todoapp-lite/{common => shared}/src/androidMain/res/mipmap-xxhdpi/ic_launcher.png (100%) rename experimental/examples/todoapp-lite/{common => shared}/src/androidMain/res/mipmap-xxhdpi/ic_launcher_round.png (100%) rename experimental/examples/todoapp-lite/{common => shared}/src/androidMain/res/mipmap-xxxhdpi/ic_launcher.png (100%) rename experimental/examples/todoapp-lite/{common => shared}/src/androidMain/res/mipmap-xxxhdpi/ic_launcher_round.png (100%) rename experimental/examples/todoapp-lite/{common => shared}/src/androidMain/res/values/strings.xml (100%) rename experimental/examples/todoapp-lite/{common => shared}/src/commonMain/kotlin/example/todoapp/lite/common/EditDialog.kt (100%) rename experimental/examples/todoapp-lite/{common => shared}/src/commonMain/kotlin/example/todoapp/lite/common/MainContent.kt (100%) rename experimental/examples/todoapp-lite/{common => shared}/src/commonMain/kotlin/example/todoapp/lite/common/RootContent.kt (95%) rename experimental/examples/todoapp-lite/{common => shared}/src/commonMain/kotlin/example/todoapp/lite/common/RootStore.kt (100%) rename experimental/examples/todoapp-lite/{common => shared}/src/commonMain/kotlin/example/todoapp/lite/common/TodoItem.kt (100%) rename experimental/examples/todoapp-lite/{common => shared}/src/commonMain/kotlin/example/todoapp/lite/common/Utils.kt (100%) rename experimental/examples/todoapp-lite/{common => shared}/src/desktopMain/kotlin/example/todoapp/lite/common/Utils.kt (100%) create mode 100644 experimental/examples/todoapp-lite/shared/src/desktopMain/kotlin/main.desktop.kt create mode 100644 experimental/examples/todoapp-lite/shared/src/iosMain/kotlin/example/todoapp/lite/common/Utils.kt create mode 100644 experimental/examples/todoapp-lite/shared/src/iosMain/kotlin/main.ios.kt diff --git a/experimental/examples/todoapp-lite/.gitignore b/experimental/examples/todoapp-lite/.gitignore index a32b16597b..cc4b0964f9 100644 --- a/experimental/examples/todoapp-lite/.gitignore +++ b/experimental/examples/todoapp-lite/.gitignore @@ -1,15 +1,15 @@ *.iml .gradle /local.properties -/.idea -/.idea/caches -/.idea/libraries -/.idea/modules.xml -/.idea/workspace.xml -/.idea/navEditor.xml -/.idea/assetWizardSettings.xml +/.idea/ .DS_Store build/ /captures .externalNativeBuild .cxx +iosApp/Podfile.lock +iosApp/Pods/* +iosApp/TodoAppLite.xcworkspace/* +iosApp/TodoAppLite.xcodeproj/* +!iosApp/TodoAppLite.xcodeproj/project.pbxproj +shared/shared.podspec \ No newline at end of file diff --git a/experimental/examples/todoapp-lite/.run/desktop.run.xml b/experimental/examples/todoapp-lite/.run/desktopApp.run.xml similarity index 70% rename from experimental/examples/todoapp-lite/.run/desktop.run.xml rename to experimental/examples/todoapp-lite/.run/desktopApp.run.xml index c10d50877a..2d56d7f072 100644 --- a/experimental/examples/todoapp-lite/.run/desktop.run.xml +++ b/experimental/examples/todoapp-lite/.run/desktopApp.run.xml @@ -1,6 +1,11 @@ - + +