From 1be0cc105cd5f404d5bf4894f9fd3d918699cc64 Mon Sep 17 00:00:00 2001 From: Nikita Lipsky Date: Tue, 7 Mar 2023 16:26:21 +0200 Subject: [PATCH] Arrange samples to the latest multiplatform template (#2835) --- experimental/examples/chat-mpp/README.md | 2 +- .../chat-mpp/androidApp/build.gradle.kts | 10 +- .../examples/chat-mpp/gradle.properties | 2 +- .../iosApp/Configuration/Config.xcconfig | 3 + .../iosApp/Configuration/TeamId.xcconfig | 1 - .../iosApp/iosApp.xcodeproj/project.pbxproj | 22 +-- .../examples/chat-mpp/shared/build.gradle.kts | 35 ++--- .../shared/src/iosMain/kotlin/main.ios.kt | 9 +- experimental/examples/codeviewer/README.md | 2 +- .../codeviewer/androidApp/build.gradle.kts | 8 +- .../examples/codeviewer/gradle.properties | 2 +- .../iosApp/Configuration/Config.xcconfig | 3 + .../iosApp/Configuration/TeamId.xcconfig | 1 - .../iosApp/iosApp.xcodeproj/project.pbxproj | 104 ++++++++------ .../AccentColor.colorset/Contents.json | 11 ++ .../AppIcon.appiconset/Contents.json | 98 +++++++++++++ .../iosApp/Assets.xcassets/Contents.json | 6 + .../iosApp/iosApp/ContentView.swift | 21 +++ .../Preview Assets.xcassets/Contents.json | 6 + .../codeviewer/iosApp/iosApp/iOSApp.swift | 10 ++ .../codeviewer/iosApp/iosApp/iosApp.swift | 15 -- .../codeviewer/shared/build.gradle.kts | 24 ++-- .../shared/src/iosMain/kotlin/main.ios.kt | 20 +-- .../examples/falling-balls-mpp/README.md | 2 +- .../androidApp/build.gradle.kts | 10 +- .../falling-balls-mpp/gradle.properties | 2 +- .../iosApp/Configuration/Config.xcconfig | 3 + .../iosApp/Configuration/TeamId.xcconfig | 1 - .../iosApp/iosApp.xcodeproj/project.pbxproj | 102 +++++++------ .../AccentColor.colorset/Contents.json | 11 ++ .../AppIcon.appiconset/Contents.json | 98 +++++++++++++ .../iosApp/Assets.xcassets/Contents.json | 6 + .../iosApp/iosApp/ContentView.swift | 21 +++ .../Preview Assets.xcassets/Contents.json | 6 + .../iosApp/iosApp/iOSApp.swift | 10 ++ .../iosApp/iosApp/iosApp.swift | 15 -- .../falling-balls-mpp/shared/build.gradle.kts | 40 ++---- .../shared/src/iosMain/kotlin/main.ios.kt | 21 +-- experimental/examples/imageviewer/README.md | 2 +- .../imageviewer/androidApp/build.gradle.kts | 10 +- .../examples/imageviewer/gradle.properties | 2 +- .../iosApp/Configuration/Config.xcconfig | 3 + .../iosApp/Configuration/TeamId.xcconfig | 1 - .../iosApp/iosApp.xcodeproj/project.pbxproj | 136 ++++++++++-------- .../AccentColor.colorset/Contents.json | 11 ++ .../AppIcon.appiconset/Contents.json | 98 +++++++++++++ .../iosApp/Assets.xcassets/Contents.json | 6 + .../iosApp/iosApp/ContentView.swift | 3 - .../Preview Assets.xcassets/Contents.json | 6 + .../imageviewer/iosApp/iosApp/iOSApp.swift | 10 ++ .../imageviewer/iosApp/iosApp/iosApp.swift | 10 -- .../imageviewer/shared/build.gradle.kts | 25 ++-- .../kotlin/example/imageviewer/main.ios.kt | 13 +- experimental/examples/minesweeper/README.md | 2 +- .../minesweeper/androidApp/build.gradle.kts | 8 +- .../examples/minesweeper/gradle.properties | 2 +- .../iosApp/Configuration/Config.xcconfig | 3 + .../iosApp/Configuration/TeamId.xcconfig | 1 - .../iosApp/iosApp.xcodeproj/project.pbxproj | 130 +++++++++-------- .../AccentColor.colorset/Contents.json | 11 ++ .../AppIcon.appiconset/Contents.json | 98 +++++++++++++ .../iosApp/Assets.xcassets/Contents.json | 6 + .../iosApp/iosApp/ContentView.swift | 21 +++ .../Preview Assets.xcassets/Contents.json | 6 + .../minesweeper/iosApp/iosApp/iOSApp.swift | 10 ++ .../minesweeper/iosApp/iosApp/iosApp.swift | 15 -- .../minesweeper/shared/build.gradle.kts | 36 ++--- .../shared/src/iosMain/kotlin/main.ios.kt | 8 +- experimental/examples/todoapp-lite/README.md | 2 +- .../todoapp-lite/androidApp/build.gradle.kts | 8 +- .../examples/todoapp-lite/gradle.properties | 2 +- .../iosApp/Configuration/Config.xcconfig | 3 + .../iosApp/Configuration/TeamId.xcconfig | 1 - .../iosApp/iosApp.xcodeproj/project.pbxproj | 102 +++++++------ .../AccentColor.colorset/Contents.json | 11 ++ .../AppIcon.appiconset/Contents.json | 98 +++++++++++++ .../iosApp/Assets.xcassets/Contents.json | 6 + .../iosApp/iosApp/ContentView.swift | 21 +++ .../Preview Assets.xcassets/Contents.json | 6 + .../todoapp-lite/iosApp/iosApp/iOSApp.swift | 10 ++ .../todoapp-lite/iosApp/iosApp/iosApp.swift | 15 -- .../todoapp-lite/shared/build.gradle.kts | 33 +++-- .../example/todoapp/lite/common/Utils.kt | 2 +- .../shared/src/iosMain/kotlin/main.ios.kt | 20 +-- .../examples/visual-effects/README.md | 2 +- .../androidApp/build.gradle.kts | 8 +- .../examples/visual-effects/gradle.properties | 2 +- .../iosApp/Configuration/Config.xcconfig | 3 + .../iosApp/Configuration/TeamId.xcconfig | 1 - .../iosApp/iosApp.xcodeproj/project.pbxproj | 104 ++++++++------ .../AccentColor.colorset/Contents.json | 11 ++ .../AppIcon.appiconset/Contents.json | 98 +++++++++++++ .../iosApp/Assets.xcassets/Contents.json | 6 + .../iosApp/iosApp/ContentView.swift | 21 +++ .../Preview Assets.xcassets/Contents.json | 6 + .../visual-effects/iosApp/iosApp/iOSApp.swift | 10 ++ .../visual-effects/iosApp/iosApp/iosApp.swift | 15 -- .../visual-effects/shared/build.gradle.kts | 19 ++- .../shared/src/iosMain/kotlin/main.ios.kt | 16 +-- .../examples/widgets-gallery/README.md | 2 +- .../androidApp/build.gradle.kts | 10 +- .../widgets-gallery/gradle.properties | 2 +- .../iosApp/Configuration/Config.xcconfig | 3 + .../iosApp/Configuration/TeamId.xcconfig | 1 - .../iosApp/iosApp.xcodeproj/project.pbxproj | 104 ++++++++------ .../AccentColor.colorset/Contents.json | 11 ++ .../AppIcon.appiconset/Contents.json | 98 +++++++++++++ .../iosApp/Assets.xcassets/Contents.json | 6 + .../iosApp/iosApp/ContentView.swift | 21 +++ .../Preview Assets.xcassets/Contents.json | 6 + .../iosApp/iosApp/iOSApp.swift | 10 ++ .../iosApp/iosApp/iosApp.swift | 15 -- .../widgets-gallery/shared/build.gradle.kts | 23 +-- .../compose/demo/widgets/platform/main.ios.kt | 19 +-- 114 files changed, 1702 insertions(+), 747 deletions(-) create mode 100644 experimental/examples/chat-mpp/iosApp/Configuration/Config.xcconfig delete mode 100644 experimental/examples/chat-mpp/iosApp/Configuration/TeamId.xcconfig create mode 100644 experimental/examples/codeviewer/iosApp/Configuration/Config.xcconfig delete mode 100644 experimental/examples/codeviewer/iosApp/Configuration/TeamId.xcconfig create mode 100644 experimental/examples/codeviewer/iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json create mode 100644 experimental/examples/codeviewer/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 experimental/examples/codeviewer/iosApp/iosApp/Assets.xcassets/Contents.json create mode 100644 experimental/examples/codeviewer/iosApp/iosApp/ContentView.swift create mode 100644 experimental/examples/codeviewer/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json create mode 100644 experimental/examples/codeviewer/iosApp/iosApp/iOSApp.swift delete mode 100644 experimental/examples/codeviewer/iosApp/iosApp/iosApp.swift create mode 100644 experimental/examples/falling-balls-mpp/iosApp/Configuration/Config.xcconfig delete mode 100644 experimental/examples/falling-balls-mpp/iosApp/Configuration/TeamId.xcconfig create mode 100644 experimental/examples/falling-balls-mpp/iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json create mode 100644 experimental/examples/falling-balls-mpp/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 experimental/examples/falling-balls-mpp/iosApp/iosApp/Assets.xcassets/Contents.json create mode 100644 experimental/examples/falling-balls-mpp/iosApp/iosApp/ContentView.swift create mode 100644 experimental/examples/falling-balls-mpp/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json create mode 100644 experimental/examples/falling-balls-mpp/iosApp/iosApp/iOSApp.swift delete mode 100644 experimental/examples/falling-balls-mpp/iosApp/iosApp/iosApp.swift create mode 100644 experimental/examples/imageviewer/iosApp/Configuration/Config.xcconfig delete mode 100644 experimental/examples/imageviewer/iosApp/Configuration/TeamId.xcconfig create mode 100644 experimental/examples/imageviewer/iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json create mode 100644 experimental/examples/imageviewer/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 experimental/examples/imageviewer/iosApp/iosApp/Assets.xcassets/Contents.json create mode 100644 experimental/examples/imageviewer/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json create mode 100644 experimental/examples/imageviewer/iosApp/iosApp/iOSApp.swift delete mode 100644 experimental/examples/imageviewer/iosApp/iosApp/iosApp.swift create mode 100644 experimental/examples/minesweeper/iosApp/Configuration/Config.xcconfig delete mode 100644 experimental/examples/minesweeper/iosApp/Configuration/TeamId.xcconfig create mode 100644 experimental/examples/minesweeper/iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json create mode 100644 experimental/examples/minesweeper/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 experimental/examples/minesweeper/iosApp/iosApp/Assets.xcassets/Contents.json create mode 100644 experimental/examples/minesweeper/iosApp/iosApp/ContentView.swift create mode 100644 experimental/examples/minesweeper/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json create mode 100644 experimental/examples/minesweeper/iosApp/iosApp/iOSApp.swift delete mode 100644 experimental/examples/minesweeper/iosApp/iosApp/iosApp.swift create mode 100644 experimental/examples/todoapp-lite/iosApp/Configuration/Config.xcconfig delete mode 100644 experimental/examples/todoapp-lite/iosApp/Configuration/TeamId.xcconfig create mode 100644 experimental/examples/todoapp-lite/iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json create mode 100644 experimental/examples/todoapp-lite/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 experimental/examples/todoapp-lite/iosApp/iosApp/Assets.xcassets/Contents.json create mode 100644 experimental/examples/todoapp-lite/iosApp/iosApp/ContentView.swift create mode 100644 experimental/examples/todoapp-lite/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json create mode 100644 experimental/examples/todoapp-lite/iosApp/iosApp/iOSApp.swift delete mode 100644 experimental/examples/todoapp-lite/iosApp/iosApp/iosApp.swift create mode 100644 experimental/examples/visual-effects/iosApp/Configuration/Config.xcconfig delete mode 100644 experimental/examples/visual-effects/iosApp/Configuration/TeamId.xcconfig create mode 100644 experimental/examples/visual-effects/iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json create mode 100644 experimental/examples/visual-effects/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 experimental/examples/visual-effects/iosApp/iosApp/Assets.xcassets/Contents.json create mode 100644 experimental/examples/visual-effects/iosApp/iosApp/ContentView.swift create mode 100644 experimental/examples/visual-effects/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json create mode 100644 experimental/examples/visual-effects/iosApp/iosApp/iOSApp.swift delete mode 100644 experimental/examples/visual-effects/iosApp/iosApp/iosApp.swift create mode 100644 experimental/examples/widgets-gallery/iosApp/Configuration/Config.xcconfig delete mode 100644 experimental/examples/widgets-gallery/iosApp/Configuration/TeamId.xcconfig create mode 100644 experimental/examples/widgets-gallery/iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json create mode 100644 experimental/examples/widgets-gallery/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 experimental/examples/widgets-gallery/iosApp/iosApp/Assets.xcassets/Contents.json create mode 100644 experimental/examples/widgets-gallery/iosApp/iosApp/ContentView.swift create mode 100644 experimental/examples/widgets-gallery/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json create mode 100644 experimental/examples/widgets-gallery/iosApp/iosApp/iOSApp.swift delete mode 100644 experimental/examples/widgets-gallery/iosApp/iosApp/iosApp.swift diff --git a/experimental/examples/chat-mpp/README.md b/experimental/examples/chat-mpp/README.md index b5058d70db..18635dc2fb 100644 --- a/experimental/examples/chat-mpp/README.md +++ b/experimental/examples/chat-mpp/README.md @@ -17,7 +17,7 @@ Choose a run configuration for an appropriate target in IDE and run it. ![run-configurations.png](run-configurations.png) -To run on iOS device, please correct `iosApp/Configuration/TeamId.xcconfig` with your Apple Team ID. +To run on iOS device, please correct `TEAM_ID` value in `iosApp/Configuration/Config.xcconfig` with your Apple Team ID. Alternatively, you may setup signing within XCode opening `iosApp/iosApp.xcworkspace` and then using "Signing & Capabilities" tab of `iosApp` target. diff --git a/experimental/examples/chat-mpp/androidApp/build.gradle.kts b/experimental/examples/chat-mpp/androidApp/build.gradle.kts index 148f74a370..7bde5c3baf 100644 --- a/experimental/examples/chat-mpp/androidApp/build.gradle.kts +++ b/experimental/examples/chat-mpp/androidApp/build.gradle.kts @@ -10,8 +10,6 @@ kotlin { val androidMain by getting { dependencies { implementation(project(":shared")) - implementation("androidx.appcompat:appcompat:1.5.1") - implementation("androidx.activity:activity-compose:1.6.1") } } } @@ -21,13 +19,13 @@ android { compileSdk = 33 defaultConfig { applicationId = "org.jetbrains.Chat" - minSdk = 24 + minSdk = 26 targetSdk = 33 versionCode = 1 versionName = "1.0" } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } -} \ No newline at end of file +} diff --git a/experimental/examples/chat-mpp/gradle.properties b/experimental/examples/chat-mpp/gradle.properties index 63a0e8dfb3..89945f096c 100644 --- a/experimental/examples/chat-mpp/gradle.properties +++ b/experimental/examples/chat-mpp/gradle.properties @@ -13,4 +13,4 @@ kotlin.mpp.androidSourceSetLayoutVersion=2 kotlin.native.binary.memoryModel=experimental kotlin.version=1.8.0 agp.version=7.1.3 -compose.version=1.4.0-alpha01-dev940 +compose.version=1.4.0-alpha01-dev954 \ No newline at end of file diff --git a/experimental/examples/chat-mpp/iosApp/Configuration/Config.xcconfig b/experimental/examples/chat-mpp/iosApp/Configuration/Config.xcconfig new file mode 100644 index 0000000000..bc0d5a73e6 --- /dev/null +++ b/experimental/examples/chat-mpp/iosApp/Configuration/Config.xcconfig @@ -0,0 +1,3 @@ +TEAM_ID= +BUNDLE_ID=org.jetbrains.Chat +APP_NAME=Chat diff --git a/experimental/examples/chat-mpp/iosApp/Configuration/TeamId.xcconfig b/experimental/examples/chat-mpp/iosApp/Configuration/TeamId.xcconfig deleted file mode 100644 index bf06eb27e9..0000000000 --- a/experimental/examples/chat-mpp/iosApp/Configuration/TeamId.xcconfig +++ /dev/null @@ -1 +0,0 @@ -TEAM_ID= diff --git a/experimental/examples/chat-mpp/iosApp/iosApp.xcodeproj/project.pbxproj b/experimental/examples/chat-mpp/iosApp/iosApp.xcodeproj/project.pbxproj index fd38c4550e..c4ca1d817d 100644 --- a/experimental/examples/chat-mpp/iosApp/iosApp.xcodeproj/project.pbxproj +++ b/experimental/examples/chat-mpp/iosApp/iosApp.xcodeproj/project.pbxproj @@ -25,10 +25,10 @@ 1EB65E27D2C0F884D0A1A133 /* Pods-iosApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosApp.debug.xcconfig"; path = "Target Support Files/Pods-iosApp/Pods-iosApp.debug.xcconfig"; sourceTree = ""; }; 2152FB032600AC8F00CF470E /* iosApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iosApp.swift; sourceTree = ""; }; 3D7A606AB0AD7636269BD9D0 /* Pods-iosApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosApp.release.xcconfig"; path = "Target Support Files/Pods-iosApp/Pods-iosApp.release.xcconfig"; sourceTree = ""; }; - 7555FF7B242A565900829871 /* Chat.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Chat.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 7555FF7B242A565900829871 /* iosApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iosApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; 7555FF8C242A565B00829871 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 8DE96E47030356CE6AD9794A /* Pods_iosApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_iosApp.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - AB3632DC29227652001CCB65 /* TeamId.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = TeamId.xcconfig; sourceTree = ""; }; + AB3632DC29227652001CCB65 /* Config.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Config.xcconfig; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -57,7 +57,7 @@ 7555FF7C242A565900829871 /* Products */ = { isa = PBXGroup; children = ( - 7555FF7B242A565900829871 /* Chat.app */, + 7555FF7B242A565900829871 /* iosApp.app */, ); name = Products; sourceTree = ""; @@ -79,7 +79,7 @@ AB1DB47929225F7C00F7AF9C /* Configuration */ = { isa = PBXGroup; children = ( - AB3632DC29227652001CCB65 /* TeamId.xcconfig */, + AB3632DC29227652001CCB65 /* Config.xcconfig */, ); path = Configuration; sourceTree = ""; @@ -119,7 +119,7 @@ ); name = iosApp; productName = iosApp; - productReference = 7555FF7B242A565900829871 /* Chat.app */; + productReference = 7555FF7B242A565900829871 /* iosApp.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ @@ -209,7 +209,7 @@ /* Begin XCBuildConfiguration section */ 7555FFA3242A565B00829871 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = AB3632DC29227652001CCB65 /* TeamId.xcconfig */; + baseConfigurationReference = AB3632DC29227652001CCB65 /* Config.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -271,7 +271,7 @@ }; 7555FFA4242A565B00829871 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = AB3632DC29227652001CCB65 /* TeamId.xcconfig */; + baseConfigurationReference = AB3632DC29227652001CCB65 /* Config.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -341,8 +341,8 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = "org.jetbrains.Chat${TEAM_ID}"; - PRODUCT_NAME = Chat; + PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}${TEAM_ID}"; + PRODUCT_NAME = "${APP_NAME}"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -365,8 +365,8 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = "org.jetbrains.Chat${TEAM_ID}"; - PRODUCT_NAME = Chat; + PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}${TEAM_ID}"; + PRODUCT_NAME = "${APP_NAME}"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; diff --git a/experimental/examples/chat-mpp/shared/build.gradle.kts b/experimental/examples/chat-mpp/shared/build.gradle.kts index 63071e1624..9d553b73b5 100644 --- a/experimental/examples/chat-mpp/shared/build.gradle.kts +++ b/experimental/examples/chat-mpp/shared/build.gradle.kts @@ -1,3 +1,5 @@ +@file:Suppress("OPT_IN_IS_NOT_ENABLED") + plugins { kotlin("multiplatform") kotlin("native.cocoapods") @@ -52,33 +54,21 @@ kotlin { implementation(compose.ui) implementation(compose.foundation) implementation(compose.material) - implementation(compose.runtime) - } - } - val commonTest by getting { - dependencies { - implementation(kotlin("test")) + @OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class) + implementation(compose.components.resources) } } val androidMain by getting { dependencies { - implementation("com.google.android.material:material:1.7.0") - } - } - val androidUnitTest by getting { - dependencies { - implementation("junit:junit:4.13.2") + api("androidx.activity:activity-compose:1.6.1") + api("androidx.appcompat:appcompat:1.6.1") + api("androidx.core:core-ktx:1.9.0") } } val iosMain by getting - val iosTest by getting val iosSimulatorArm64Main by getting { dependsOn(iosMain) } - val iosSimulatorArm64Test by getting { - dependsOn(iosTest) - } - val desktopMain by getting { dependencies { implementation(compose.desktop.common) @@ -100,12 +90,15 @@ kotlin { android { compileSdk = 33 sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml") + sourceSets["main"].res.srcDirs("src/androidMain/res") + sourceSets["main"].resources.srcDirs("src/commonMain/resources") + defaultConfig { - minSdk = 24 + minSdk = 26 targetSdk = 33 } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } -} \ No newline at end of file +} diff --git a/experimental/examples/chat-mpp/shared/src/iosMain/kotlin/main.ios.kt b/experimental/examples/chat-mpp/shared/src/iosMain/kotlin/main.ios.kt index 873970cfde..2a97fca260 100644 --- a/experimental/examples/chat-mpp/shared/src/iosMain/kotlin/main.ios.kt +++ b/experimental/examples/chat-mpp/shared/src/iosMain/kotlin/main.ios.kt @@ -1,10 +1,9 @@ -import androidx.compose.ui.window.Application +import androidx.compose.ui.window.ComposeUIViewController import platform.UIKit.UIViewController -fun ChatViewController(): UIViewController = - Application("Chat") { - ChatApp(displayTextField = false) - } +fun ChatViewController(): UIViewController = ComposeUIViewController { + ChatApp(displayTextField = false) +} fun sendMessage(text: String) { store.send(Action.SendMessage(Message(myUser, timestampMs(), text))) diff --git a/experimental/examples/codeviewer/README.md b/experimental/examples/codeviewer/README.md index 8f3b2e7efb..2489eae3dd 100644 --- a/experimental/examples/codeviewer/README.md +++ b/experimental/examples/codeviewer/README.md @@ -7,7 +7,7 @@ Choose a run configuration for an appropriate target in IDE and run it. ![run-configurations.png](run-configurations.png) -To run on iOS device, please correct `iosApp/Configuration/TeamId.xcconfig` with your Apple Team ID. +To run on iOS device, please correct `TEAM_ID` value in `iosApp/Configuration/Config.xcconfig` with your Apple Team ID. Alternatively, you may setup signing within XCode opening `iosApp/iosApp.xcworkspace` and then using "Signing & Capabilities" tab of `Codeviewer` target. diff --git a/experimental/examples/codeviewer/androidApp/build.gradle.kts b/experimental/examples/codeviewer/androidApp/build.gradle.kts index b65e1126a2..cb6f649578 100644 --- a/experimental/examples/codeviewer/androidApp/build.gradle.kts +++ b/experimental/examples/codeviewer/androidApp/build.gradle.kts @@ -10,8 +10,6 @@ kotlin { val androidMain by getting { dependencies { implementation(project(":shared")) - implementation("androidx.appcompat:appcompat:1.5.1") - implementation("androidx.activity:activity-compose:1.6.1") } } } @@ -21,13 +19,13 @@ android { compileSdk = 33 defaultConfig { applicationId = "org.jetbrains.Codeviewer" - minSdk = 24 + minSdk = 26 targetSdk = 33 versionCode = 1 versionName = "1.0" } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } } diff --git a/experimental/examples/codeviewer/gradle.properties b/experimental/examples/codeviewer/gradle.properties index 002855c0f5..5fcd45516e 100644 --- a/experimental/examples/codeviewer/gradle.properties +++ b/experimental/examples/codeviewer/gradle.properties @@ -13,4 +13,4 @@ kotlin.mpp.androidSourceSetLayoutVersion=2 kotlin.native.binary.memoryModel=experimental kotlin.version=1.8.0 agp.version=7.1.3 -compose.version=1.3.0 +compose.version=1.4.0-alpha01-dev954 diff --git a/experimental/examples/codeviewer/iosApp/Configuration/Config.xcconfig b/experimental/examples/codeviewer/iosApp/Configuration/Config.xcconfig new file mode 100644 index 0000000000..1393dc4f0b --- /dev/null +++ b/experimental/examples/codeviewer/iosApp/Configuration/Config.xcconfig @@ -0,0 +1,3 @@ +TEAM_ID= +BUNDLE_ID=org.jetbrains.Codeviewer +APP_NAME=Codeviewer diff --git a/experimental/examples/codeviewer/iosApp/Configuration/TeamId.xcconfig b/experimental/examples/codeviewer/iosApp/Configuration/TeamId.xcconfig deleted file mode 100644 index bf06eb27e9..0000000000 --- a/experimental/examples/codeviewer/iosApp/Configuration/TeamId.xcconfig +++ /dev/null @@ -1 +0,0 @@ -TEAM_ID= diff --git a/experimental/examples/codeviewer/iosApp/iosApp.xcodeproj/project.pbxproj b/experimental/examples/codeviewer/iosApp/iosApp.xcodeproj/project.pbxproj index 2dbe457e0e..d69b3b7011 100644 --- a/experimental/examples/codeviewer/iosApp/iosApp.xcodeproj/project.pbxproj +++ b/experimental/examples/codeviewer/iosApp/iosApp.xcodeproj/project.pbxproj @@ -7,47 +7,67 @@ objects = { /* Begin PBXBuildFile section */ - 2152FB042600AC8F00CF470E /* iosApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2152FB032600AC8F00CF470E /* iosApp.swift */; }; - C1FC908188C4E8695729CB06 /* Pods_iosApp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DE96E47030356CE6AD9794A /* Pods_iosApp.framework */; }; + 2152FB042600AC8F00CF470E /* iOSApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2152FB032600AC8F00CF470E /* iOSApp.swift */; }; + 7555FF83242A565900829871 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7555FF82242A565900829871 /* ContentView.swift */; }; + CFDB58B53BB94DE262B13C24 /* Pods_iosApp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6B1049432C0C2B312090ABF6 /* Pods_iosApp.framework */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 1EB65E27D2C0F884D0A1A133 /* Pods-iosApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosApp.debug.xcconfig"; path = "Target Support Files/Pods-iosApp/Pods-iosApp.debug.xcconfig"; sourceTree = ""; }; - 2152FB032600AC8F00CF470E /* iosApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iosApp.swift; sourceTree = ""; }; - 3D7A606AB0AD7636269BD9D0 /* Pods-iosApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosApp.release.xcconfig"; path = "Target Support Files/Pods-iosApp/Pods-iosApp.release.xcconfig"; sourceTree = ""; }; - 7555FF7B242A565900829871 /* Codeviewer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Codeviewer.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 058557BA273AAA24004C7B11 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 2152FB032600AC8F00CF470E /* iOSApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOSApp.swift; sourceTree = ""; }; + 4FF3202A603A284706412EDC /* Pods-iosApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosApp.debug.xcconfig"; path = "Target Support Files/Pods-iosApp/Pods-iosApp.debug.xcconfig"; sourceTree = ""; }; + 6B1049432C0C2B312090ABF6 /* Pods_iosApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_iosApp.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 7555FF7B242A565900829871 /* iosApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iosApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 7555FF82242A565900829871 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 7555FF8C242A565B00829871 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 8DE96E47030356CE6AD9794A /* Pods_iosApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_iosApp.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - AB3632DC29227652001CCB65 /* TeamId.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = TeamId.xcconfig; sourceTree = ""; }; + AB3632DC29227652001CCB65 /* Config.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Config.xcconfig; sourceTree = ""; }; + FF8CA3F5360CEAB49D74065F /* Pods-iosApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosApp.release.xcconfig"; path = "Target Support Files/Pods-iosApp/Pods-iosApp.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 9964867F0862B4D9FB6ABFC7 /* Frameworks */ = { + F85CB1118929364A9C6EFABC /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C1FC908188C4E8695729CB06 /* Pods_iosApp.framework in Frameworks */, + CFDB58B53BB94DE262B13C24 /* Pods_iosApp.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 058557D7273AAEEB004C7B11 /* Preview Content */ = { + isa = PBXGroup; + children = ( + 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + 42799AB246E5F90AF97AA0EF /* Frameworks */ = { + isa = PBXGroup; + children = ( + 6B1049432C0C2B312090ABF6 /* Pods_iosApp.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; 7555FF72242A565900829871 = { isa = PBXGroup; children = ( AB1DB47929225F7C00F7AF9C /* Configuration */, 7555FF7D242A565900829871 /* iosApp */, 7555FF7C242A565900829871 /* Products */, - E1DAFBE8E1CFC0878361EF0E /* Pods */, - B62309C7396AD7BF607A63B2 /* Frameworks */, + FEFF387C0A8D172AA4D59CAE /* Pods */, + 42799AB246E5F90AF97AA0EF /* Frameworks */, ); sourceTree = ""; }; 7555FF7C242A565900829871 /* Products */ = { isa = PBXGroup; children = ( - 7555FF7B242A565900829871 /* Codeviewer.app */, + 7555FF7B242A565900829871 /* iosApp.app */, ); name = Products; sourceTree = ""; @@ -55,8 +75,11 @@ 7555FF7D242A565900829871 /* iosApp */ = { isa = PBXGroup; children = ( + 058557BA273AAA24004C7B11 /* Assets.xcassets */, + 7555FF82242A565900829871 /* ContentView.swift */, 7555FF8C242A565B00829871 /* Info.plist */, - 2152FB032600AC8F00CF470E /* iosApp.swift */, + 2152FB032600AC8F00CF470E /* iOSApp.swift */, + 058557D7273AAEEB004C7B11 /* Preview Content */, ); path = iosApp; sourceTree = ""; @@ -64,24 +87,16 @@ AB1DB47929225F7C00F7AF9C /* Configuration */ = { isa = PBXGroup; children = ( - AB3632DC29227652001CCB65 /* TeamId.xcconfig */, + AB3632DC29227652001CCB65 /* Config.xcconfig */, ); path = Configuration; sourceTree = ""; }; - B62309C7396AD7BF607A63B2 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 8DE96E47030356CE6AD9794A /* Pods_iosApp.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - E1DAFBE8E1CFC0878361EF0E /* Pods */ = { + FEFF387C0A8D172AA4D59CAE /* Pods */ = { isa = PBXGroup; children = ( - 1EB65E27D2C0F884D0A1A133 /* Pods-iosApp.debug.xcconfig */, - 3D7A606AB0AD7636269BD9D0 /* Pods-iosApp.release.xcconfig */, + 4FF3202A603A284706412EDC /* Pods-iosApp.debug.xcconfig */, + FF8CA3F5360CEAB49D74065F /* Pods-iosApp.release.xcconfig */, ); path = Pods; sourceTree = ""; @@ -93,11 +108,11 @@ isa = PBXNativeTarget; buildConfigurationList = 7555FFA5242A565B00829871 /* Build configuration list for PBXNativeTarget "iosApp" */; buildPhases = ( - E8D673591E7196AEA2EA10E2 /* [CP] Check Pods Manifest.lock */, + 98D614C51D2DA07C614CC46E /* [CP] Check Pods Manifest.lock */, 7555FF77242A565900829871 /* Sources */, 7555FF79242A565900829871 /* Resources */, - 9964867F0862B4D9FB6ABFC7 /* Frameworks */, - 36D9E9FD1C89A17F9A69F669 /* [CP] Copy Pods Resources */, + F85CB1118929364A9C6EFABC /* Frameworks */, + 971F29506F07FFBDBFAC9671 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -105,7 +120,7 @@ ); name = iosApp; productName = iosApp; - productReference = 7555FF7B242A565900829871 /* Codeviewer.app */; + productReference = 7555FF7B242A565900829871 /* iosApp.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ @@ -116,7 +131,7 @@ attributes = { LastSwiftUpdateCheck = 1130; LastUpgradeCheck = 1130; - ORGANIZATIONNAME = org.jetbrains; + ORGANIZATIONNAME = orgName; TargetAttributes = { 7555FF7A242A565900829871 = { CreatedOnToolsVersion = 11.3.1; @@ -152,7 +167,7 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 36D9E9FD1C89A17F9A69F669 /* [CP] Copy Pods Resources */ = { + 971F29506F07FFBDBFAC9671 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -169,7 +184,7 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-resources.sh\"\n"; showEnvVarsInLog = 0; }; - E8D673591E7196AEA2EA10E2 /* [CP] Check Pods Manifest.lock */ = { + 98D614C51D2DA07C614CC46E /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -198,7 +213,8 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 2152FB042600AC8F00CF470E /* iosApp.swift in Sources */, + 2152FB042600AC8F00CF470E /* iOSApp.swift in Sources */, + 7555FF83242A565900829871 /* ContentView.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -207,7 +223,7 @@ /* Begin XCBuildConfiguration section */ 7555FFA3242A565B00829871 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = AB3632DC29227652001CCB65 /* TeamId.xcconfig */; + baseConfigurationReference = AB3632DC29227652001CCB65 /* Config.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -269,7 +285,7 @@ }; 7555FFA4242A565B00829871 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = AB3632DC29227652001CCB65 /* TeamId.xcconfig */; + baseConfigurationReference = AB3632DC29227652001CCB65 /* Config.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -325,12 +341,12 @@ }; 7555FFA6242A565B00829871 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 1EB65E27D2C0F884D0A1A133 /* Pods-iosApp.debug.xcconfig */; + baseConfigurationReference = 4FF3202A603A284706412EDC /* Pods-iosApp.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_ASSET_PATHS = ""; + DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\""; DEVELOPMENT_TEAM = "${TEAM_ID}"; ENABLE_PREVIEWS = YES; INFOPLIST_FILE = iosApp/Info.plist; @@ -339,8 +355,8 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = "org.jetbrains.Codeviewer${TEAM_ID}"; - PRODUCT_NAME = "Codeviewer"; + PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}${TEAM_ID}"; + PRODUCT_NAME = "${APP_NAME}"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -349,12 +365,12 @@ }; 7555FFA7242A565B00829871 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 3D7A606AB0AD7636269BD9D0 /* Pods-iosApp.release.xcconfig */; + baseConfigurationReference = FF8CA3F5360CEAB49D74065F /* Pods-iosApp.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_ASSET_PATHS = ""; + DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\""; DEVELOPMENT_TEAM = "${TEAM_ID}"; ENABLE_PREVIEWS = YES; INFOPLIST_FILE = iosApp/Info.plist; @@ -363,8 +379,8 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = "org.jetbrains.Codeviewer${TEAM_ID}"; - PRODUCT_NAME = "Codeviewer"; + PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}${TEAM_ID}"; + PRODUCT_NAME = "${APP_NAME}"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; diff --git a/experimental/examples/codeviewer/iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json b/experimental/examples/codeviewer/iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000000..ee7e3ca03f --- /dev/null +++ b/experimental/examples/codeviewer/iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} \ No newline at end of file diff --git a/experimental/examples/codeviewer/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json b/experimental/examples/codeviewer/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000000..fb88a396bf --- /dev/null +++ b/experimental/examples/codeviewer/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} \ No newline at end of file diff --git a/experimental/examples/codeviewer/iosApp/iosApp/Assets.xcassets/Contents.json b/experimental/examples/codeviewer/iosApp/iosApp/Assets.xcassets/Contents.json new file mode 100644 index 0000000000..4aa7c5350b --- /dev/null +++ b/experimental/examples/codeviewer/iosApp/iosApp/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} \ No newline at end of file diff --git a/experimental/examples/codeviewer/iosApp/iosApp/ContentView.swift b/experimental/examples/codeviewer/iosApp/iosApp/ContentView.swift new file mode 100644 index 0000000000..f7f6457b31 --- /dev/null +++ b/experimental/examples/codeviewer/iosApp/iosApp/ContentView.swift @@ -0,0 +1,21 @@ +import UIKit +import SwiftUI +import shared + +struct ComposeView: UIViewControllerRepresentable { + func makeUIViewController(context: Context) -> UIViewController { + Main_iosKt.MainViewController() + } + + func updateUIViewController(_ uiViewController: UIViewController, context: Context) {} +} + +struct ContentView: View { + var body: some View { + ComposeView() + .ignoresSafeArea(.keyboard) // Compose has own keyboard handler + } +} + + + diff --git a/experimental/examples/codeviewer/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json b/experimental/examples/codeviewer/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 0000000000..4aa7c5350b --- /dev/null +++ b/experimental/examples/codeviewer/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} \ No newline at end of file diff --git a/experimental/examples/codeviewer/iosApp/iosApp/iOSApp.swift b/experimental/examples/codeviewer/iosApp/iosApp/iOSApp.swift new file mode 100644 index 0000000000..0648e8602f --- /dev/null +++ b/experimental/examples/codeviewer/iosApp/iosApp/iOSApp.swift @@ -0,0 +1,10 @@ +import SwiftUI + +@main +struct iOSApp: App { + var body: some Scene { + WindowGroup { + ContentView() + } + } +} \ No newline at end of file diff --git a/experimental/examples/codeviewer/iosApp/iosApp/iosApp.swift b/experimental/examples/codeviewer/iosApp/iosApp/iosApp.swift deleted file mode 100644 index 0f563c50c9..0000000000 --- a/experimental/examples/codeviewer/iosApp/iosApp/iosApp.swift +++ /dev/null @@ -1,15 +0,0 @@ -import UIKit -import shared - -@main -class AppDelegate: UIResponder, UIApplicationDelegate { - var window: UIWindow? - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - window = UIWindow(frame: UIScreen.main.bounds) - let mainViewController = Main_iosKt.MainViewController() - window?.rootViewController = mainViewController - window?.makeKeyAndVisible() - return true - } -} diff --git a/experimental/examples/codeviewer/shared/build.gradle.kts b/experimental/examples/codeviewer/shared/build.gradle.kts index 4d76f3a04f..6fafaaa904 100644 --- a/experimental/examples/codeviewer/shared/build.gradle.kts +++ b/experimental/examples/codeviewer/shared/build.gradle.kts @@ -1,3 +1,5 @@ +@file:Suppress("OPT_IN_IS_NOT_ENABLED") + plugins { kotlin("multiplatform") kotlin("native.cocoapods") @@ -27,8 +29,6 @@ kotlin { extraSpecAttributes["resources"] = "['src/commonMain/resources/**', 'src/iosMain/resources/**']" } - val composeVersion = extra["compose.version"] as String - sourceSets { val commonMain by getting { dependencies { @@ -36,25 +36,21 @@ kotlin { implementation(compose.foundation) implementation(compose.material) implementation(compose.materialIconsExtended) - implementation("org.jetbrains.compose.components:components-resources:$composeVersion") - } + @OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class) + implementation(compose.components.resources) } } val androidMain by getting { kotlin.srcDirs("src/jvmMain/kotlin") dependencies { - implementation("androidx.appcompat:appcompat:1.5.1") - implementation("androidx.core:core-ktx:1.8.0") + api("androidx.activity:activity-compose:1.6.1") + api("androidx.appcompat:appcompat:1.6.1") + api("androidx.core:core-ktx:1.9.0") } } val iosMain by getting - val iosTest by getting val iosSimulatorArm64Main by getting { dependsOn(iosMain) } - val iosSimulatorArm64Test by getting { - dependsOn(iosTest) - } - val desktopMain by getting { kotlin.srcDirs("src/jvmMain/kotlin") dependencies { @@ -69,11 +65,11 @@ android { sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml") sourceSets["main"].res.srcDirs("src/androidMain/res", "src/commonMain/resources") defaultConfig { - minSdk = 24 + minSdk = 26 targetSdk = 33 } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } } diff --git a/experimental/examples/codeviewer/shared/src/iosMain/kotlin/main.ios.kt b/experimental/examples/codeviewer/shared/src/iosMain/kotlin/main.ios.kt index 1e3e239735..99fe5e5078 100644 --- a/experimental/examples/codeviewer/shared/src/iosMain/kotlin/main.ios.kt +++ b/experimental/examples/codeviewer/shared/src/iosMain/kotlin/main.ios.kt @@ -3,23 +3,9 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file. */ -import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.height -import androidx.compose.ui.Modifier -import androidx.compose.ui.unit.dp -import androidx.compose.ui.window.Application + +import androidx.compose.ui.window.ComposeUIViewController import platform.UIKit.UIViewController import org.jetbrains.codeviewer.ui.MainView -fun MainViewController() : UIViewController = - Application("Codeviewer") { - Column { - // To skip upper part of screen. - Box( - modifier = Modifier - .height(30.dp) - ) - MainView() - } - } +fun MainViewController() : UIViewController = ComposeUIViewController { MainView() } diff --git a/experimental/examples/falling-balls-mpp/README.md b/experimental/examples/falling-balls-mpp/README.md index a5ced8f794..a7d18ef15f 100644 --- a/experimental/examples/falling-balls-mpp/README.md +++ b/experimental/examples/falling-balls-mpp/README.md @@ -12,7 +12,7 @@ Choose a run configuration for an appropriate target in IDE and run it. ![run-configurations.png](run-configurations.png) -To run on iOS device, please correct `iosApp/Configuration/TeamId.xcconfig` with your Apple Team ID. +To run on iOS device, please correct `TEAM_ID` value in `iosApp/Configuration/Config.xcconfig` with your Apple Team ID. Alternatively, you may setup signing within XCode opening `iosApp/iosApp.xcworkspace` and then using "Signing & Capabilities" tab of `iosApp` target. See also how to prepare XCode section below. diff --git a/experimental/examples/falling-balls-mpp/androidApp/build.gradle.kts b/experimental/examples/falling-balls-mpp/androidApp/build.gradle.kts index 254be94225..8de9b994e5 100644 --- a/experimental/examples/falling-balls-mpp/androidApp/build.gradle.kts +++ b/experimental/examples/falling-balls-mpp/androidApp/build.gradle.kts @@ -10,8 +10,6 @@ kotlin { val androidMain by getting { dependencies { implementation(project(":shared")) - implementation("androidx.appcompat:appcompat:1.5.1") - implementation("androidx.activity:activity-compose:1.6.1") } } } @@ -21,13 +19,13 @@ android { compileSdk = 33 defaultConfig { applicationId = "org.jetbrains.FallingBalls" - minSdk = 24 + minSdk = 26 targetSdk = 33 versionCode = 1 versionName = "1.0" } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } -} \ No newline at end of file +} diff --git a/experimental/examples/falling-balls-mpp/gradle.properties b/experimental/examples/falling-balls-mpp/gradle.properties index 002855c0f5..5fcd45516e 100644 --- a/experimental/examples/falling-balls-mpp/gradle.properties +++ b/experimental/examples/falling-balls-mpp/gradle.properties @@ -13,4 +13,4 @@ kotlin.mpp.androidSourceSetLayoutVersion=2 kotlin.native.binary.memoryModel=experimental kotlin.version=1.8.0 agp.version=7.1.3 -compose.version=1.3.0 +compose.version=1.4.0-alpha01-dev954 diff --git a/experimental/examples/falling-balls-mpp/iosApp/Configuration/Config.xcconfig b/experimental/examples/falling-balls-mpp/iosApp/Configuration/Config.xcconfig new file mode 100644 index 0000000000..e6ec51dad2 --- /dev/null +++ b/experimental/examples/falling-balls-mpp/iosApp/Configuration/Config.xcconfig @@ -0,0 +1,3 @@ +TEAM_ID= +BUNDLE_ID=org.jetbrains.FallingBalls +APP_NAME=FallingBalls diff --git a/experimental/examples/falling-balls-mpp/iosApp/Configuration/TeamId.xcconfig b/experimental/examples/falling-balls-mpp/iosApp/Configuration/TeamId.xcconfig deleted file mode 100644 index bf06eb27e9..0000000000 --- a/experimental/examples/falling-balls-mpp/iosApp/Configuration/TeamId.xcconfig +++ /dev/null @@ -1 +0,0 @@ -TEAM_ID= diff --git a/experimental/examples/falling-balls-mpp/iosApp/iosApp.xcodeproj/project.pbxproj b/experimental/examples/falling-balls-mpp/iosApp/iosApp.xcodeproj/project.pbxproj index 623f6b9308..ba431831fe 100644 --- a/experimental/examples/falling-balls-mpp/iosApp/iosApp.xcodeproj/project.pbxproj +++ b/experimental/examples/falling-balls-mpp/iosApp/iosApp.xcodeproj/project.pbxproj @@ -7,47 +7,69 @@ objects = { /* Begin PBXBuildFile section */ - 2152FB042600AC8F00CF470E /* iosApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2152FB032600AC8F00CF470E /* iosApp.swift */; }; - C1FC908188C4E8695729CB06 /* Pods_iosApp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DE96E47030356CE6AD9794A /* Pods_iosApp.framework */; }; + 058557BB273AAA24004C7B11 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 058557BA273AAA24004C7B11 /* Assets.xcassets */; }; + 058557D9273AAEEB004C7B11 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */; }; + 2152FB042600AC8F00CF470E /* iOSApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2152FB032600AC8F00CF470E /* iOSApp.swift */; }; + 7555FF83242A565900829871 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7555FF82242A565900829871 /* ContentView.swift */; }; + CFDB58B53BB94DE262B13C24 /* Pods_iosApp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6B1049432C0C2B312090ABF6 /* Pods_iosApp.framework */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 1EB65E27D2C0F884D0A1A133 /* Pods-iosApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosApp.debug.xcconfig"; path = "Target Support Files/Pods-iosApp/Pods-iosApp.debug.xcconfig"; sourceTree = ""; }; - 2152FB032600AC8F00CF470E /* iosApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iosApp.swift; sourceTree = ""; }; - 3D7A606AB0AD7636269BD9D0 /* Pods-iosApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosApp.release.xcconfig"; path = "Target Support Files/Pods-iosApp/Pods-iosApp.release.xcconfig"; sourceTree = ""; }; - 7555FF7B242A565900829871 /* FallingBalls.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FallingBalls.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 058557BA273AAA24004C7B11 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 2152FB032600AC8F00CF470E /* iOSApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOSApp.swift; sourceTree = ""; }; + 4FF3202A603A284706412EDC /* Pods-iosApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosApp.debug.xcconfig"; path = "Target Support Files/Pods-iosApp/Pods-iosApp.debug.xcconfig"; sourceTree = ""; }; + 6B1049432C0C2B312090ABF6 /* Pods_iosApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_iosApp.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 7555FF7B242A565900829871 /* iosApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iosApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 7555FF82242A565900829871 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 7555FF8C242A565B00829871 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 8DE96E47030356CE6AD9794A /* Pods_iosApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_iosApp.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - AB3632DC29227652001CCB65 /* TeamId.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = TeamId.xcconfig; sourceTree = ""; }; + AB3632DC29227652001CCB65 /* Config.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Config.xcconfig; sourceTree = ""; }; + FF8CA3F5360CEAB49D74065F /* Pods-iosApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosApp.release.xcconfig"; path = "Target Support Files/Pods-iosApp/Pods-iosApp.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 9964867F0862B4D9FB6ABFC7 /* Frameworks */ = { + F85CB1118929364A9C6EFABC /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C1FC908188C4E8695729CB06 /* Pods_iosApp.framework in Frameworks */, + CFDB58B53BB94DE262B13C24 /* Pods_iosApp.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 058557D7273AAEEB004C7B11 /* Preview Content */ = { + isa = PBXGroup; + children = ( + 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + 42799AB246E5F90AF97AA0EF /* Frameworks */ = { + isa = PBXGroup; + children = ( + 6B1049432C0C2B312090ABF6 /* Pods_iosApp.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; 7555FF72242A565900829871 = { isa = PBXGroup; children = ( AB1DB47929225F7C00F7AF9C /* Configuration */, 7555FF7D242A565900829871 /* iosApp */, 7555FF7C242A565900829871 /* Products */, - E1DAFBE8E1CFC0878361EF0E /* Pods */, - B62309C7396AD7BF607A63B2 /* Frameworks */, + FEFF387C0A8D172AA4D59CAE /* Pods */, + 42799AB246E5F90AF97AA0EF /* Frameworks */, ); sourceTree = ""; }; 7555FF7C242A565900829871 /* Products */ = { isa = PBXGroup; children = ( - 7555FF7B242A565900829871 /* FallingBalls.app */, + 7555FF7B242A565900829871 /* iosApp.app */, ); name = Products; sourceTree = ""; @@ -55,8 +77,11 @@ 7555FF7D242A565900829871 /* iosApp */ = { isa = PBXGroup; children = ( + 058557BA273AAA24004C7B11 /* Assets.xcassets */, + 7555FF82242A565900829871 /* ContentView.swift */, 7555FF8C242A565B00829871 /* Info.plist */, - 2152FB032600AC8F00CF470E /* iosApp.swift */, + 2152FB032600AC8F00CF470E /* iOSApp.swift */, + 058557D7273AAEEB004C7B11 /* Preview Content */, ); path = iosApp; sourceTree = ""; @@ -64,24 +89,16 @@ AB1DB47929225F7C00F7AF9C /* Configuration */ = { isa = PBXGroup; children = ( - AB3632DC29227652001CCB65 /* TeamId.xcconfig */, + AB3632DC29227652001CCB65 /* Config.xcconfig */, ); path = Configuration; sourceTree = ""; }; - B62309C7396AD7BF607A63B2 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 8DE96E47030356CE6AD9794A /* Pods_iosApp.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - E1DAFBE8E1CFC0878361EF0E /* Pods */ = { + FEFF387C0A8D172AA4D59CAE /* Pods */ = { isa = PBXGroup; children = ( - 1EB65E27D2C0F884D0A1A133 /* Pods-iosApp.debug.xcconfig */, - 3D7A606AB0AD7636269BD9D0 /* Pods-iosApp.release.xcconfig */, + 4FF3202A603A284706412EDC /* Pods-iosApp.debug.xcconfig */, + FF8CA3F5360CEAB49D74065F /* Pods-iosApp.release.xcconfig */, ); path = Pods; sourceTree = ""; @@ -93,10 +110,10 @@ isa = PBXNativeTarget; buildConfigurationList = 7555FFA5242A565B00829871 /* Build configuration list for PBXNativeTarget "iosApp" */; buildPhases = ( - E8D673591E7196AEA2EA10E2 /* [CP] Check Pods Manifest.lock */, + 98D614C51D2DA07C614CC46E /* [CP] Check Pods Manifest.lock */, 7555FF77242A565900829871 /* Sources */, 7555FF79242A565900829871 /* Resources */, - 9964867F0862B4D9FB6ABFC7 /* Frameworks */, + F85CB1118929364A9C6EFABC /* Frameworks */, ); buildRules = ( ); @@ -104,7 +121,7 @@ ); name = iosApp; productName = iosApp; - productReference = 7555FF7B242A565900829871 /* FallingBalls.app */; + productReference = 7555FF7B242A565900829871 /* iosApp.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ @@ -115,7 +132,7 @@ attributes = { LastSwiftUpdateCheck = 1130; LastUpgradeCheck = 1130; - ORGANIZATIONNAME = org.jetbrains; + ORGANIZATIONNAME = orgName; TargetAttributes = { 7555FF7A242A565900829871 = { CreatedOnToolsVersion = 11.3.1; @@ -151,7 +168,7 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - E8D673591E7196AEA2EA10E2 /* [CP] Check Pods Manifest.lock */ = { + 98D614C51D2DA07C614CC46E /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -180,7 +197,8 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 2152FB042600AC8F00CF470E /* iosApp.swift in Sources */, + 2152FB042600AC8F00CF470E /* iOSApp.swift in Sources */, + 7555FF83242A565900829871 /* ContentView.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -189,7 +207,7 @@ /* Begin XCBuildConfiguration section */ 7555FFA3242A565B00829871 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = AB3632DC29227652001CCB65 /* TeamId.xcconfig */; + baseConfigurationReference = AB3632DC29227652001CCB65 /* Config.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -251,7 +269,7 @@ }; 7555FFA4242A565B00829871 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = AB3632DC29227652001CCB65 /* TeamId.xcconfig */; + baseConfigurationReference = AB3632DC29227652001CCB65 /* Config.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -307,12 +325,12 @@ }; 7555FFA6242A565B00829871 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 1EB65E27D2C0F884D0A1A133 /* Pods-iosApp.debug.xcconfig */; + baseConfigurationReference = 4FF3202A603A284706412EDC /* Pods-iosApp.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_ASSET_PATHS = ""; + DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\""; DEVELOPMENT_TEAM = "${TEAM_ID}"; ENABLE_PREVIEWS = YES; INFOPLIST_FILE = iosApp/Info.plist; @@ -321,8 +339,8 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = "org.jetbrains.FallingBalls${TEAM_ID}"; - PRODUCT_NAME = "FallingBalls"; + PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}${TEAM_ID}"; + PRODUCT_NAME = "${APP_NAME}"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -331,12 +349,12 @@ }; 7555FFA7242A565B00829871 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 3D7A606AB0AD7636269BD9D0 /* Pods-iosApp.release.xcconfig */; + baseConfigurationReference = FF8CA3F5360CEAB49D74065F /* Pods-iosApp.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_ASSET_PATHS = ""; + DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\""; DEVELOPMENT_TEAM = "${TEAM_ID}"; ENABLE_PREVIEWS = YES; INFOPLIST_FILE = iosApp/Info.plist; @@ -345,8 +363,8 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = "org.jetbrains.FallingBalls${TEAM_ID}"; - PRODUCT_NAME = "FallingBalls"; + PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}${TEAM_ID}"; + PRODUCT_NAME = "${APP_NAME}"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; diff --git a/experimental/examples/falling-balls-mpp/iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json b/experimental/examples/falling-balls-mpp/iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000000..ee7e3ca03f --- /dev/null +++ b/experimental/examples/falling-balls-mpp/iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} \ No newline at end of file diff --git a/experimental/examples/falling-balls-mpp/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json b/experimental/examples/falling-balls-mpp/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000000..fb88a396bf --- /dev/null +++ b/experimental/examples/falling-balls-mpp/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} \ No newline at end of file diff --git a/experimental/examples/falling-balls-mpp/iosApp/iosApp/Assets.xcassets/Contents.json b/experimental/examples/falling-balls-mpp/iosApp/iosApp/Assets.xcassets/Contents.json new file mode 100644 index 0000000000..4aa7c5350b --- /dev/null +++ b/experimental/examples/falling-balls-mpp/iosApp/iosApp/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} \ No newline at end of file diff --git a/experimental/examples/falling-balls-mpp/iosApp/iosApp/ContentView.swift b/experimental/examples/falling-balls-mpp/iosApp/iosApp/ContentView.swift new file mode 100644 index 0000000000..f7f6457b31 --- /dev/null +++ b/experimental/examples/falling-balls-mpp/iosApp/iosApp/ContentView.swift @@ -0,0 +1,21 @@ +import UIKit +import SwiftUI +import shared + +struct ComposeView: UIViewControllerRepresentable { + func makeUIViewController(context: Context) -> UIViewController { + Main_iosKt.MainViewController() + } + + func updateUIViewController(_ uiViewController: UIViewController, context: Context) {} +} + +struct ContentView: View { + var body: some View { + ComposeView() + .ignoresSafeArea(.keyboard) // Compose has own keyboard handler + } +} + + + diff --git a/experimental/examples/falling-balls-mpp/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json b/experimental/examples/falling-balls-mpp/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 0000000000..4aa7c5350b --- /dev/null +++ b/experimental/examples/falling-balls-mpp/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} \ No newline at end of file diff --git a/experimental/examples/falling-balls-mpp/iosApp/iosApp/iOSApp.swift b/experimental/examples/falling-balls-mpp/iosApp/iosApp/iOSApp.swift new file mode 100644 index 0000000000..0648e8602f --- /dev/null +++ b/experimental/examples/falling-balls-mpp/iosApp/iosApp/iOSApp.swift @@ -0,0 +1,10 @@ +import SwiftUI + +@main +struct iOSApp: App { + var body: some Scene { + WindowGroup { + ContentView() + } + } +} \ No newline at end of file diff --git a/experimental/examples/falling-balls-mpp/iosApp/iosApp/iosApp.swift b/experimental/examples/falling-balls-mpp/iosApp/iosApp/iosApp.swift deleted file mode 100644 index 0f563c50c9..0000000000 --- a/experimental/examples/falling-balls-mpp/iosApp/iosApp/iosApp.swift +++ /dev/null @@ -1,15 +0,0 @@ -import UIKit -import shared - -@main -class AppDelegate: UIResponder, UIApplicationDelegate { - var window: UIWindow? - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - window = UIWindow(frame: UIScreen.main.bounds) - let mainViewController = Main_iosKt.MainViewController() - window?.rootViewController = mainViewController - window?.makeKeyAndVisible() - return true - } -} diff --git a/experimental/examples/falling-balls-mpp/shared/build.gradle.kts b/experimental/examples/falling-balls-mpp/shared/build.gradle.kts index 63071e1624..11a8ee8560 100644 --- a/experimental/examples/falling-balls-mpp/shared/build.gradle.kts +++ b/experimental/examples/falling-balls-mpp/shared/build.gradle.kts @@ -1,3 +1,5 @@ +@file:Suppress("OPT_IN_IS_NOT_ENABLED") + plugins { kotlin("multiplatform") kotlin("native.cocoapods") @@ -50,47 +52,32 @@ kotlin { val commonMain by getting { dependencies { implementation(compose.ui) + implementation(compose.runtime) implementation(compose.foundation) implementation(compose.material) - implementation(compose.runtime) - } - } - val commonTest by getting { - dependencies { - implementation(kotlin("test")) + @OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class) + implementation(compose.components.resources) } } val androidMain by getting { dependencies { - implementation("com.google.android.material:material:1.7.0") - } - } - val androidUnitTest by getting { - dependencies { - implementation("junit:junit:4.13.2") + api("androidx.activity:activity-compose:1.6.1") + api("androidx.appcompat:appcompat:1.6.1") + api("androidx.core:core-ktx:1.9.0") } } val iosMain by getting - val iosTest by getting val iosSimulatorArm64Main by getting { dependsOn(iosMain) } - val iosSimulatorArm64Test by getting { - dependsOn(iosTest) - } - val desktopMain by getting { dependencies { implementation(compose.desktop.common) } } - val macosMain by creating { dependsOn(commonMain) } - val macosX64Main by getting { - dependsOn(macosMain) - } val macosArm64Main by getting { dependsOn(macosMain) } @@ -100,12 +87,15 @@ kotlin { android { compileSdk = 33 sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml") + sourceSets["main"].res.srcDirs("src/androidMain/res") + sourceSets["main"].resources.srcDirs("src/commonMain/resources") + defaultConfig { - minSdk = 24 + minSdk = 26 targetSdk = 33 } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } -} \ No newline at end of file +} diff --git a/experimental/examples/falling-balls-mpp/shared/src/iosMain/kotlin/main.ios.kt b/experimental/examples/falling-balls-mpp/shared/src/iosMain/kotlin/main.ios.kt index 53ee85154c..618bdd6d1d 100644 --- a/experimental/examples/falling-balls-mpp/shared/src/iosMain/kotlin/main.ios.kt +++ b/experimental/examples/falling-balls-mpp/shared/src/iosMain/kotlin/main.ios.kt @@ -3,26 +3,17 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file. */ -import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.height + import androidx.compose.runtime.remember -import androidx.compose.ui.Modifier -import androidx.compose.ui.unit.dp -import androidx.compose.ui.window.Application +import androidx.compose.ui.window.ComposeUIViewController import platform.UIKit.UIViewController object IosTime : Time { override fun now(): Long = kotlin.system.getTimeNanos() } -fun MainViewController() : UIViewController = - Application("Falling Balls") { - val game = remember { Game(IosTime) } - Column { - // To skip upper part of screen. - Box(modifier = Modifier - .height(100.dp)) - FallingBalls(game) - } +fun MainViewController() : UIViewController = ComposeUIViewController { + val game = remember { Game(IosTime) } + FallingBalls(game) } + diff --git a/experimental/examples/imageviewer/README.md b/experimental/examples/imageviewer/README.md index e25ea43104..cf4d6d3030 100755 --- a/experimental/examples/imageviewer/README.md +++ b/experimental/examples/imageviewer/README.md @@ -9,7 +9,7 @@ Choose a run configuration for an appropriate target in IDE and run it. ![run-configurations.png](run-configurations.png) -To run on iOS device, please correct `iosApp/Configuration/TeamId.xcconfig` with your Apple Team ID. +To run on iOS device, please correct `TEAM_ID` value in `iosApp/Configuration/Config.xcconfig` with your Apple Team ID. Alternatively, you may setup signing within XCode opening `iosApp/iosApp.xcworkspace` and then using "Signing & Capabilities" tab of `iosApp` target. diff --git a/experimental/examples/imageviewer/androidApp/build.gradle.kts b/experimental/examples/imageviewer/androidApp/build.gradle.kts index cdb92d493a..31b3047fe1 100755 --- a/experimental/examples/imageviewer/androidApp/build.gradle.kts +++ b/experimental/examples/imageviewer/androidApp/build.gradle.kts @@ -10,8 +10,6 @@ kotlin { val androidMain by getting { dependencies { implementation(project(":shared")) - implementation("androidx.appcompat:appcompat:1.5.1") - implementation("androidx.activity:activity-compose:1.6.1") } } } @@ -20,14 +18,14 @@ kotlin { android { compileSdk = 33 defaultConfig { - applicationId = "org.jetbrains.imageviewer" - minSdk = 24 + applicationId = "org.jetbrains.Imageviewer" + minSdk = 26 targetSdk = 33 versionCode = 1 versionName = "1.0" } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } } diff --git a/experimental/examples/imageviewer/gradle.properties b/experimental/examples/imageviewer/gradle.properties index f14bbe94d8..02949c20fd 100644 --- a/experimental/examples/imageviewer/gradle.properties +++ b/experimental/examples/imageviewer/gradle.properties @@ -13,5 +13,5 @@ kotlin.native.useEmbeddableCompilerJar=true kotlin.native.binary.memoryModel=experimental kotlin.version=1.8.0 agp.version=7.1.3 -compose.version=1.3.0 +compose.version=1.4.0-alpha01-dev954 ktor.version=2.2.1 diff --git a/experimental/examples/imageviewer/iosApp/Configuration/Config.xcconfig b/experimental/examples/imageviewer/iosApp/Configuration/Config.xcconfig new file mode 100644 index 0000000000..98f7be4528 --- /dev/null +++ b/experimental/examples/imageviewer/iosApp/Configuration/Config.xcconfig @@ -0,0 +1,3 @@ +TEAM_ID= +BUNDLE_ID=org.jetbrains.Imageviewer +APP_NAME=Imageviewer diff --git a/experimental/examples/imageviewer/iosApp/Configuration/TeamId.xcconfig b/experimental/examples/imageviewer/iosApp/Configuration/TeamId.xcconfig deleted file mode 100644 index bf06eb27e9..0000000000 --- a/experimental/examples/imageviewer/iosApp/Configuration/TeamId.xcconfig +++ /dev/null @@ -1 +0,0 @@ -TEAM_ID= diff --git a/experimental/examples/imageviewer/iosApp/iosApp.xcodeproj/project.pbxproj b/experimental/examples/imageviewer/iosApp/iosApp.xcodeproj/project.pbxproj index 8494f1218a..2f978dd84a 100644 --- a/experimental/examples/imageviewer/iosApp/iosApp.xcodeproj/project.pbxproj +++ b/experimental/examples/imageviewer/iosApp/iosApp.xcodeproj/project.pbxproj @@ -3,53 +3,71 @@ archiveVersion = 1; classes = { }; - objectVersion = 51; + objectVersion = 50; objects = { /* Begin PBXBuildFile section */ - 2152FB042600AC8F00CF470E /* iosApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2152FB032600AC8F00CF470E /* iosApp.swift */; }; - C1FC908188C4E8695729CB06 /* Pods_iosApp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DE96E47030356CE6AD9794A /* Pods_iosApp.framework */; }; - D5DE79A846260A9C7654FCD6 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5DE73F83209A8ECD8AB0ED9 /* ContentView.swift */; }; + 2152FB042600AC8F00CF470E /* iOSApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2152FB032600AC8F00CF470E /* iOSApp.swift */; }; + 7555FF83242A565900829871 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7555FF82242A565900829871 /* ContentView.swift */; }; + CFDB58B53BB94DE262B13C24 /* Pods_iosApp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6B1049432C0C2B312090ABF6 /* Pods_iosApp.framework */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 1EB65E27D2C0F884D0A1A133 /* Pods-iosApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosApp.debug.xcconfig"; path = "Target Support Files/Pods-iosApp/Pods-iosApp.debug.xcconfig"; sourceTree = ""; }; - 2152FB032600AC8F00CF470E /* iosApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iosApp.swift; sourceTree = ""; }; - 3D7A606AB0AD7636269BD9D0 /* Pods-iosApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosApp.release.xcconfig"; path = "Target Support Files/Pods-iosApp/Pods-iosApp.release.xcconfig"; sourceTree = ""; }; - 7555FF7B242A565900829871 /* Imageviewer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Imageviewer.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 058557BA273AAA24004C7B11 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 2152FB032600AC8F00CF470E /* iOSApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOSApp.swift; sourceTree = ""; }; + 4FF3202A603A284706412EDC /* Pods-iosApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosApp.debug.xcconfig"; path = "Target Support Files/Pods-iosApp/Pods-iosApp.debug.xcconfig"; sourceTree = ""; }; + 6B1049432C0C2B312090ABF6 /* Pods_iosApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_iosApp.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 7555FF7B242A565900829871 /* iosApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iosApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 7555FF82242A565900829871 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 7555FF8C242A565B00829871 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 8DE96E47030356CE6AD9794A /* Pods_iosApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_iosApp.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - AB3632DC29227652001CCB65 /* TeamId.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = TeamId.xcconfig; sourceTree = ""; }; - D5DE73F83209A8ECD8AB0ED9 /* ContentView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + AB3632DC29227652001CCB65 /* Config.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Config.xcconfig; sourceTree = ""; }; + FF8CA3F5360CEAB49D74065F /* Pods-iosApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosApp.release.xcconfig"; path = "Target Support Files/Pods-iosApp/Pods-iosApp.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 9964867F0862B4D9FB6ABFC7 /* Frameworks */ = { + F85CB1118929364A9C6EFABC /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C1FC908188C4E8695729CB06 /* Pods_iosApp.framework in Frameworks */, + CFDB58B53BB94DE262B13C24 /* Pods_iosApp.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 058557D7273AAEEB004C7B11 /* Preview Content */ = { + isa = PBXGroup; + children = ( + 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + 42799AB246E5F90AF97AA0EF /* Frameworks */ = { + isa = PBXGroup; + children = ( + 6B1049432C0C2B312090ABF6 /* Pods_iosApp.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; 7555FF72242A565900829871 = { isa = PBXGroup; children = ( AB1DB47929225F7C00F7AF9C /* Configuration */, 7555FF7D242A565900829871 /* iosApp */, 7555FF7C242A565900829871 /* Products */, - E1DAFBE8E1CFC0878361EF0E /* Pods */, - B62309C7396AD7BF607A63B2 /* Frameworks */, + FEFF387C0A8D172AA4D59CAE /* Pods */, + 42799AB246E5F90AF97AA0EF /* Frameworks */, ); sourceTree = ""; }; 7555FF7C242A565900829871 /* Products */ = { isa = PBXGroup; children = ( - 7555FF7B242A565900829871 /* Imageviewer.app */, + 7555FF7B242A565900829871 /* iosApp.app */, ); name = Products; sourceTree = ""; @@ -57,9 +75,11 @@ 7555FF7D242A565900829871 /* iosApp */ = { isa = PBXGroup; children = ( + 058557BA273AAA24004C7B11 /* Assets.xcassets */, + 7555FF82242A565900829871 /* ContentView.swift */, 7555FF8C242A565B00829871 /* Info.plist */, - 2152FB032600AC8F00CF470E /* iosApp.swift */, - D5DE73F83209A8ECD8AB0ED9 /* ContentView.swift */, + 2152FB032600AC8F00CF470E /* iOSApp.swift */, + 058557D7273AAEEB004C7B11 /* Preview Content */, ); path = iosApp; sourceTree = ""; @@ -67,24 +87,16 @@ AB1DB47929225F7C00F7AF9C /* Configuration */ = { isa = PBXGroup; children = ( - AB3632DC29227652001CCB65 /* TeamId.xcconfig */, + AB3632DC29227652001CCB65 /* Config.xcconfig */, ); path = Configuration; sourceTree = ""; }; - B62309C7396AD7BF607A63B2 /* Frameworks */ = { + FEFF387C0A8D172AA4D59CAE /* Pods */ = { isa = PBXGroup; children = ( - 8DE96E47030356CE6AD9794A /* Pods_iosApp.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - E1DAFBE8E1CFC0878361EF0E /* Pods */ = { - isa = PBXGroup; - children = ( - 1EB65E27D2C0F884D0A1A133 /* Pods-iosApp.debug.xcconfig */, - 3D7A606AB0AD7636269BD9D0 /* Pods-iosApp.release.xcconfig */, + 4FF3202A603A284706412EDC /* Pods-iosApp.debug.xcconfig */, + FF8CA3F5360CEAB49D74065F /* Pods-iosApp.release.xcconfig */, ); path = Pods; sourceTree = ""; @@ -96,11 +108,11 @@ isa = PBXNativeTarget; buildConfigurationList = 7555FFA5242A565B00829871 /* Build configuration list for PBXNativeTarget "iosApp" */; buildPhases = ( - E8D673591E7196AEA2EA10E2 /* [CP] Check Pods Manifest.lock */, + 98D614C51D2DA07C614CC46E /* [CP] Check Pods Manifest.lock */, 7555FF77242A565900829871 /* Sources */, 7555FF79242A565900829871 /* Resources */, - 9964867F0862B4D9FB6ABFC7 /* Frameworks */, - F34398AEB6C0D136D245A061 /* [CP] Copy Pods Resources */, + F85CB1118929364A9C6EFABC /* Frameworks */, + 94B9A73840D06546D27A50B8 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -108,7 +120,7 @@ ); name = iosApp; productName = iosApp; - productReference = 7555FF7B242A565900829871 /* Imageviewer.app */; + productReference = 7555FF7B242A565900829871 /* iosApp.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ @@ -119,7 +131,7 @@ attributes = { LastSwiftUpdateCheck = 1130; LastUpgradeCheck = 1130; - ORGANIZATIONNAME = org.jetbrains; + ORGANIZATIONNAME = orgName; TargetAttributes = { 7555FF7A242A565900829871 = { CreatedOnToolsVersion = 11.3.1; @@ -155,43 +167,43 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - E8D673591E7196AEA2EA10E2 /* [CP] Check Pods Manifest.lock */ = { + 94B9A73840D06546D27A50B8 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-resources-${CONFIGURATION}-input-files.xcfilelist", ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; + name = "[CP] Copy Pods Resources"; outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-iosApp-checkManifestLockResult.txt", + "${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-resources-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-resources.sh\"\n"; showEnvVarsInLog = 0; }; - F34398AEB6C0D136D245A061 /* [CP] Copy Pods Resources */ = { + 98D614C51D2DA07C614CC46E /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-resources-${CONFIGURATION}-input-files.xcfilelist", ); - name = "[CP] Copy Pods Resources"; + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-resources-${CONFIGURATION}-output-files.xcfilelist", + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-iosApp-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-resources.sh\"\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -201,8 +213,8 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 2152FB042600AC8F00CF470E /* iosApp.swift in Sources */, - D5DE79A846260A9C7654FCD6 /* ContentView.swift in Sources */, + 2152FB042600AC8F00CF470E /* iOSApp.swift in Sources */, + 7555FF83242A565900829871 /* ContentView.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -211,7 +223,7 @@ /* Begin XCBuildConfiguration section */ 7555FFA3242A565B00829871 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = AB3632DC29227652001CCB65 /* TeamId.xcconfig */; + baseConfigurationReference = AB3632DC29227652001CCB65 /* Config.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -273,7 +285,7 @@ }; 7555FFA4242A565B00829871 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = AB3632DC29227652001CCB65 /* TeamId.xcconfig */; + baseConfigurationReference = AB3632DC29227652001CCB65 /* Config.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -329,12 +341,12 @@ }; 7555FFA6242A565B00829871 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 1EB65E27D2C0F884D0A1A133 /* Pods-iosApp.debug.xcconfig */; + baseConfigurationReference = 4FF3202A603A284706412EDC /* Pods-iosApp.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_ASSET_PATHS = ""; + DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\""; DEVELOPMENT_TEAM = "${TEAM_ID}"; ENABLE_PREVIEWS = YES; INFOPLIST_FILE = iosApp/Info.plist; @@ -343,8 +355,8 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = "org.jetbrains.Imageviewer${TEAM_ID}"; - PRODUCT_NAME = Imageviewer; + PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}${TEAM_ID}"; + PRODUCT_NAME = "${APP_NAME}"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -353,12 +365,12 @@ }; 7555FFA7242A565B00829871 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 3D7A606AB0AD7636269BD9D0 /* Pods-iosApp.release.xcconfig */; + baseConfigurationReference = FF8CA3F5360CEAB49D74065F /* Pods-iosApp.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_ASSET_PATHS = ""; + DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\""; DEVELOPMENT_TEAM = "${TEAM_ID}"; ENABLE_PREVIEWS = YES; INFOPLIST_FILE = iosApp/Info.plist; @@ -367,8 +379,8 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = "org.jetbrains.Imageviewer${TEAM_ID}"; - PRODUCT_NAME = Imageviewer; + PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}${TEAM_ID}"; + PRODUCT_NAME = "${APP_NAME}"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; diff --git a/experimental/examples/imageviewer/iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json b/experimental/examples/imageviewer/iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000000..ee7e3ca03f --- /dev/null +++ b/experimental/examples/imageviewer/iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} \ No newline at end of file diff --git a/experimental/examples/imageviewer/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json b/experimental/examples/imageviewer/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000000..fb88a396bf --- /dev/null +++ b/experimental/examples/imageviewer/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} \ No newline at end of file diff --git a/experimental/examples/imageviewer/iosApp/iosApp/Assets.xcassets/Contents.json b/experimental/examples/imageviewer/iosApp/iosApp/Assets.xcassets/Contents.json new file mode 100644 index 0000000000..4aa7c5350b --- /dev/null +++ b/experimental/examples/imageviewer/iosApp/iosApp/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} \ No newline at end of file diff --git a/experimental/examples/imageviewer/iosApp/iosApp/ContentView.swift b/experimental/examples/imageviewer/iosApp/iosApp/ContentView.swift index 8fb58742a0..cb37889ef6 100644 --- a/experimental/examples/imageviewer/iosApp/iosApp/ContentView.swift +++ b/experimental/examples/imageviewer/iosApp/iosApp/ContentView.swift @@ -33,6 +33,3 @@ struct ContentView: View { }.preferredColorScheme(.dark) } } - - - diff --git a/experimental/examples/imageviewer/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json b/experimental/examples/imageviewer/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 0000000000..4aa7c5350b --- /dev/null +++ b/experimental/examples/imageviewer/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} \ No newline at end of file diff --git a/experimental/examples/imageviewer/iosApp/iosApp/iOSApp.swift b/experimental/examples/imageviewer/iosApp/iosApp/iOSApp.swift new file mode 100644 index 0000000000..0648e8602f --- /dev/null +++ b/experimental/examples/imageviewer/iosApp/iosApp/iOSApp.swift @@ -0,0 +1,10 @@ +import SwiftUI + +@main +struct iOSApp: App { + var body: some Scene { + WindowGroup { + ContentView() + } + } +} \ No newline at end of file diff --git a/experimental/examples/imageviewer/iosApp/iosApp/iosApp.swift b/experimental/examples/imageviewer/iosApp/iosApp/iosApp.swift deleted file mode 100644 index 927e0b97b8..0000000000 --- a/experimental/examples/imageviewer/iosApp/iosApp/iosApp.swift +++ /dev/null @@ -1,10 +0,0 @@ -import SwiftUI - -@main -struct iOSApp: App { - var body: some Scene { - WindowGroup { - ContentView() - } - } -} diff --git a/experimental/examples/imageviewer/shared/build.gradle.kts b/experimental/examples/imageviewer/shared/build.gradle.kts index 4cff047c11..be5eaddcfd 100755 --- a/experimental/examples/imageviewer/shared/build.gradle.kts +++ b/experimental/examples/imageviewer/shared/build.gradle.kts @@ -1,3 +1,5 @@ +@file:Suppress("OPT_IN_IS_NOT_ENABLED") + plugins { kotlin("multiplatform") kotlin("native.cocoapods") @@ -34,16 +36,17 @@ kotlin { implementation(compose.runtime) implementation(compose.foundation) implementation(compose.material) - implementation("org.jetbrains.compose.components:components-resources:1.4.0-alpha01-dev942") implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1") - @OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class) implementation(compose.material3) + @OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class) + implementation(compose.components.resources) } } val androidMain by getting { dependencies { - implementation("androidx.appcompat:appcompat:1.5.1") - implementation("androidx.core:core-ktx:1.9.0") + api("androidx.activity:activity-compose:1.6.1") + api("androidx.appcompat:appcompat:1.6.1") + api("androidx.core:core-ktx:1.9.0") implementation("io.ktor:ktor-client-okhttp:$ktorVersion") } } @@ -52,13 +55,10 @@ kotlin { implementation("io.ktor:ktor-client-darwin:$ktorVersion") } } - val iosTest by getting val iosSimulatorArm64Main by getting { dependsOn(iosMain) } - val iosSimulatorArm64Test by getting { - dependsOn(iosTest) - } + val desktopMain by getting { dependencies { @@ -74,13 +74,14 @@ android { compileSdk = 33 sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml") sourceSets["main"].res.srcDirs("src/androidMain/res") - sourceSets["main"].resources.srcDir("src/commonMain/resources") + sourceSets["main"].resources.srcDirs("src/commonMain/resources") + defaultConfig { - minSdk = 24 + minSdk = 26 targetSdk = 33 } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } } diff --git a/experimental/examples/imageviewer/shared/src/iosMain/kotlin/example/imageviewer/main.ios.kt b/experimental/examples/imageviewer/shared/src/iosMain/kotlin/example/imageviewer/main.ios.kt index b477d563ee..af77d4255d 100644 --- a/experimental/examples/imageviewer/shared/src/iosMain/kotlin/example/imageviewer/main.ios.kt +++ b/experimental/examples/imageviewer/shared/src/iosMain/kotlin/example/imageviewer/main.ios.kt @@ -1,14 +1,7 @@ package example.imageviewer -import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.height -import androidx.compose.ui.Modifier -import androidx.compose.ui.unit.dp -import androidx.compose.ui.window.Application +import androidx.compose.ui.window.ComposeUIViewController import platform.UIKit.UIViewController -fun MainViewController(): UIViewController = - Application("Imageviewer") { - ImageViewerIos() - } +fun MainViewController(): UIViewController = ComposeUIViewController { ImageViewerIos() } + diff --git a/experimental/examples/minesweeper/README.md b/experimental/examples/minesweeper/README.md index 898c1163bd..34e2258188 100644 --- a/experimental/examples/minesweeper/README.md +++ b/experimental/examples/minesweeper/README.md @@ -14,7 +14,7 @@ Choose a run configuration for an appropriate target in IDE and run it. ![run-configurations.png](run-configurations.png) -To run on iOS device, please correct `iosApp/Configuration/TeamId.xcconfig` with your Apple Team ID. +To run on iOS device, please correct `TEAM_ID` value in `iosApp/Configuration/Config.xcconfig` with your Apple Team ID. Alternatively, you may setup signing within XCode opening `iosApp/iosApp.xcworkspace` and then using "Signing & Capabilities" tab of `iosApp` target. diff --git a/experimental/examples/minesweeper/androidApp/build.gradle.kts b/experimental/examples/minesweeper/androidApp/build.gradle.kts index 0c592a144c..fa39d4d64d 100644 --- a/experimental/examples/minesweeper/androidApp/build.gradle.kts +++ b/experimental/examples/minesweeper/androidApp/build.gradle.kts @@ -10,8 +10,6 @@ kotlin { val androidMain by getting { dependencies { implementation(project(":shared")) - implementation("androidx.appcompat:appcompat:1.5.1") - implementation("androidx.activity:activity-compose:1.6.1") } } } @@ -21,13 +19,13 @@ android { compileSdk = 33 defaultConfig { applicationId = "org.jetbrains.ComposeMinesweeper" - minSdk = 24 + minSdk = 26 targetSdk = 33 versionCode = 1 versionName = "1.0" } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } } diff --git a/experimental/examples/minesweeper/gradle.properties b/experimental/examples/minesweeper/gradle.properties index 002855c0f5..5fcd45516e 100644 --- a/experimental/examples/minesweeper/gradle.properties +++ b/experimental/examples/minesweeper/gradle.properties @@ -13,4 +13,4 @@ kotlin.mpp.androidSourceSetLayoutVersion=2 kotlin.native.binary.memoryModel=experimental kotlin.version=1.8.0 agp.version=7.1.3 -compose.version=1.3.0 +compose.version=1.4.0-alpha01-dev954 diff --git a/experimental/examples/minesweeper/iosApp/Configuration/Config.xcconfig b/experimental/examples/minesweeper/iosApp/Configuration/Config.xcconfig new file mode 100644 index 0000000000..f752d0e2f8 --- /dev/null +++ b/experimental/examples/minesweeper/iosApp/Configuration/Config.xcconfig @@ -0,0 +1,3 @@ +TEAM_ID= +BUNDLE_ID=org.jetbrains.Minesweeper +APP_NAME=Minesweeper diff --git a/experimental/examples/minesweeper/iosApp/Configuration/TeamId.xcconfig b/experimental/examples/minesweeper/iosApp/Configuration/TeamId.xcconfig deleted file mode 100644 index bf06eb27e9..0000000000 --- a/experimental/examples/minesweeper/iosApp/Configuration/TeamId.xcconfig +++ /dev/null @@ -1 +0,0 @@ -TEAM_ID= diff --git a/experimental/examples/minesweeper/iosApp/iosApp.xcodeproj/project.pbxproj b/experimental/examples/minesweeper/iosApp/iosApp.xcodeproj/project.pbxproj index 17872b50ea..2d4c34dfc3 100644 --- a/experimental/examples/minesweeper/iosApp/iosApp.xcodeproj/project.pbxproj +++ b/experimental/examples/minesweeper/iosApp/iosApp.xcodeproj/project.pbxproj @@ -7,47 +7,67 @@ objects = { /* Begin PBXBuildFile section */ - 2152FB042600AC8F00CF470E /* iosApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2152FB032600AC8F00CF470E /* iosApp.swift */; }; - C1FC908188C4E8695729CB06 /* Pods_iosApp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DE96E47030356CE6AD9794A /* Pods_iosApp.framework */; }; + 2152FB042600AC8F00CF470E /* iOSApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2152FB032600AC8F00CF470E /* iOSApp.swift */; }; + 7555FF83242A565900829871 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7555FF82242A565900829871 /* ContentView.swift */; }; + CFDB58B53BB94DE262B13C24 /* Pods_iosApp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6B1049432C0C2B312090ABF6 /* Pods_iosApp.framework */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 1EB65E27D2C0F884D0A1A133 /* Pods-iosApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosApp.debug.xcconfig"; path = "Target Support Files/Pods-iosApp/Pods-iosApp.debug.xcconfig"; sourceTree = ""; }; - 2152FB032600AC8F00CF470E /* iosApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iosApp.swift; sourceTree = ""; }; - 3D7A606AB0AD7636269BD9D0 /* Pods-iosApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosApp.release.xcconfig"; path = "Target Support Files/Pods-iosApp/Pods-iosApp.release.xcconfig"; sourceTree = ""; }; - 7555FF7B242A565900829871 /* Minesweeper.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Minesweeper.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 058557BA273AAA24004C7B11 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 2152FB032600AC8F00CF470E /* iOSApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOSApp.swift; sourceTree = ""; }; + 4FF3202A603A284706412EDC /* Pods-iosApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosApp.debug.xcconfig"; path = "Target Support Files/Pods-iosApp/Pods-iosApp.debug.xcconfig"; sourceTree = ""; }; + 6B1049432C0C2B312090ABF6 /* Pods_iosApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_iosApp.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 7555FF7B242A565900829871 /* iosApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iosApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 7555FF82242A565900829871 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 7555FF8C242A565B00829871 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 8DE96E47030356CE6AD9794A /* Pods_iosApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_iosApp.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - AB3632DC29227652001CCB65 /* TeamId.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = TeamId.xcconfig; sourceTree = ""; }; + AB3632DC29227652001CCB65 /* Config.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Config.xcconfig; sourceTree = ""; }; + FF8CA3F5360CEAB49D74065F /* Pods-iosApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosApp.release.xcconfig"; path = "Target Support Files/Pods-iosApp/Pods-iosApp.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 9964867F0862B4D9FB6ABFC7 /* Frameworks */ = { + F85CB1118929364A9C6EFABC /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C1FC908188C4E8695729CB06 /* Pods_iosApp.framework in Frameworks */, + CFDB58B53BB94DE262B13C24 /* Pods_iosApp.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 058557D7273AAEEB004C7B11 /* Preview Content */ = { + isa = PBXGroup; + children = ( + 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + 42799AB246E5F90AF97AA0EF /* Frameworks */ = { + isa = PBXGroup; + children = ( + 6B1049432C0C2B312090ABF6 /* Pods_iosApp.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; 7555FF72242A565900829871 = { isa = PBXGroup; children = ( AB1DB47929225F7C00F7AF9C /* Configuration */, 7555FF7D242A565900829871 /* iosApp */, 7555FF7C242A565900829871 /* Products */, - E1DAFBE8E1CFC0878361EF0E /* Pods */, - B62309C7396AD7BF607A63B2 /* Frameworks */, + FEFF387C0A8D172AA4D59CAE /* Pods */, + 42799AB246E5F90AF97AA0EF /* Frameworks */, ); sourceTree = ""; }; 7555FF7C242A565900829871 /* Products */ = { isa = PBXGroup; children = ( - 7555FF7B242A565900829871 /* Minesweeper.app */, + 7555FF7B242A565900829871 /* iosApp.app */, ); name = Products; sourceTree = ""; @@ -55,8 +75,11 @@ 7555FF7D242A565900829871 /* iosApp */ = { isa = PBXGroup; children = ( + 058557BA273AAA24004C7B11 /* Assets.xcassets */, + 7555FF82242A565900829871 /* ContentView.swift */, 7555FF8C242A565B00829871 /* Info.plist */, - 2152FB032600AC8F00CF470E /* iosApp.swift */, + 2152FB032600AC8F00CF470E /* iOSApp.swift */, + 058557D7273AAEEB004C7B11 /* Preview Content */, ); path = iosApp; sourceTree = ""; @@ -64,24 +87,16 @@ AB1DB47929225F7C00F7AF9C /* Configuration */ = { isa = PBXGroup; children = ( - AB3632DC29227652001CCB65 /* TeamId.xcconfig */, + AB3632DC29227652001CCB65 /* Config.xcconfig */, ); path = Configuration; sourceTree = ""; }; - B62309C7396AD7BF607A63B2 /* Frameworks */ = { + FEFF387C0A8D172AA4D59CAE /* Pods */ = { isa = PBXGroup; children = ( - 8DE96E47030356CE6AD9794A /* Pods_iosApp.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - E1DAFBE8E1CFC0878361EF0E /* Pods */ = { - isa = PBXGroup; - children = ( - 1EB65E27D2C0F884D0A1A133 /* Pods-iosApp.debug.xcconfig */, - 3D7A606AB0AD7636269BD9D0 /* Pods-iosApp.release.xcconfig */, + 4FF3202A603A284706412EDC /* Pods-iosApp.debug.xcconfig */, + FF8CA3F5360CEAB49D74065F /* Pods-iosApp.release.xcconfig */, ); path = Pods; sourceTree = ""; @@ -93,11 +108,11 @@ isa = PBXNativeTarget; buildConfigurationList = 7555FFA5242A565B00829871 /* Build configuration list for PBXNativeTarget "iosApp" */; buildPhases = ( - E8D673591E7196AEA2EA10E2 /* [CP] Check Pods Manifest.lock */, + 98D614C51D2DA07C614CC46E /* [CP] Check Pods Manifest.lock */, 7555FF77242A565900829871 /* Sources */, 7555FF79242A565900829871 /* Resources */, - 9964867F0862B4D9FB6ABFC7 /* Frameworks */, - AC9253D086E81B65FAE159E1 /* [CP] Copy Pods Resources */, + F85CB1118929364A9C6EFABC /* Frameworks */, + A9E803822715990B8A260D69 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -105,7 +120,7 @@ ); name = iosApp; productName = iosApp; - productReference = 7555FF7B242A565900829871 /* Minesweeper.app */; + productReference = 7555FF7B242A565900829871 /* iosApp.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ @@ -116,7 +131,7 @@ attributes = { LastSwiftUpdateCheck = 1130; LastUpgradeCheck = 1130; - ORGANIZATIONNAME = org.jetbrains; + ORGANIZATIONNAME = orgName; TargetAttributes = { 7555FF7A242A565900829871 = { CreatedOnToolsVersion = 11.3.1; @@ -152,43 +167,43 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - AC9253D086E81B65FAE159E1 /* [CP] Copy Pods Resources */ = { + 98D614C51D2DA07C614CC46E /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-resources-${CONFIGURATION}-input-files.xcfilelist", ); - name = "[CP] Copy Pods Resources"; + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-resources-${CONFIGURATION}-output-files.xcfilelist", + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-iosApp-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-resources.sh\"\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - E8D673591E7196AEA2EA10E2 /* [CP] Check Pods Manifest.lock */ = { + A9E803822715990B8A260D69 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-resources-${CONFIGURATION}-input-files.xcfilelist", ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; + name = "[CP] Copy Pods Resources"; outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-iosApp-checkManifestLockResult.txt", + "${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-resources-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-resources.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -198,7 +213,8 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 2152FB042600AC8F00CF470E /* iosApp.swift in Sources */, + 2152FB042600AC8F00CF470E /* iOSApp.swift in Sources */, + 7555FF83242A565900829871 /* ContentView.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -207,7 +223,7 @@ /* Begin XCBuildConfiguration section */ 7555FFA3242A565B00829871 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = AB3632DC29227652001CCB65 /* TeamId.xcconfig */; + baseConfigurationReference = AB3632DC29227652001CCB65 /* Config.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -269,7 +285,7 @@ }; 7555FFA4242A565B00829871 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = AB3632DC29227652001CCB65 /* TeamId.xcconfig */; + baseConfigurationReference = AB3632DC29227652001CCB65 /* Config.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -325,12 +341,12 @@ }; 7555FFA6242A565B00829871 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 1EB65E27D2C0F884D0A1A133 /* Pods-iosApp.debug.xcconfig */; + baseConfigurationReference = 4FF3202A603A284706412EDC /* Pods-iosApp.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_ASSET_PATHS = ""; + DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\""; DEVELOPMENT_TEAM = "${TEAM_ID}"; ENABLE_PREVIEWS = YES; INFOPLIST_FILE = iosApp/Info.plist; @@ -339,8 +355,8 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = "org.jetbrains.Minesweeper${TEAM_ID}"; - PRODUCT_NAME = "Minesweeper"; + PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}${TEAM_ID}"; + PRODUCT_NAME = "${APP_NAME}"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -349,12 +365,12 @@ }; 7555FFA7242A565B00829871 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 3D7A606AB0AD7636269BD9D0 /* Pods-iosApp.release.xcconfig */; + baseConfigurationReference = FF8CA3F5360CEAB49D74065F /* Pods-iosApp.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_ASSET_PATHS = ""; + DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\""; DEVELOPMENT_TEAM = "${TEAM_ID}"; ENABLE_PREVIEWS = YES; INFOPLIST_FILE = iosApp/Info.plist; @@ -363,8 +379,8 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = "org.jetbrains.Minesweeper${TEAM_ID}"; - PRODUCT_NAME = "Minesweeper"; + PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}${TEAM_ID}"; + PRODUCT_NAME = "${APP_NAME}"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; diff --git a/experimental/examples/minesweeper/iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json b/experimental/examples/minesweeper/iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000000..ee7e3ca03f --- /dev/null +++ b/experimental/examples/minesweeper/iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} \ No newline at end of file diff --git a/experimental/examples/minesweeper/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json b/experimental/examples/minesweeper/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000000..fb88a396bf --- /dev/null +++ b/experimental/examples/minesweeper/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} \ No newline at end of file diff --git a/experimental/examples/minesweeper/iosApp/iosApp/Assets.xcassets/Contents.json b/experimental/examples/minesweeper/iosApp/iosApp/Assets.xcassets/Contents.json new file mode 100644 index 0000000000..4aa7c5350b --- /dev/null +++ b/experimental/examples/minesweeper/iosApp/iosApp/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} \ No newline at end of file diff --git a/experimental/examples/minesweeper/iosApp/iosApp/ContentView.swift b/experimental/examples/minesweeper/iosApp/iosApp/ContentView.swift new file mode 100644 index 0000000000..f7f6457b31 --- /dev/null +++ b/experimental/examples/minesweeper/iosApp/iosApp/ContentView.swift @@ -0,0 +1,21 @@ +import UIKit +import SwiftUI +import shared + +struct ComposeView: UIViewControllerRepresentable { + func makeUIViewController(context: Context) -> UIViewController { + Main_iosKt.MainViewController() + } + + func updateUIViewController(_ uiViewController: UIViewController, context: Context) {} +} + +struct ContentView: View { + var body: some View { + ComposeView() + .ignoresSafeArea(.keyboard) // Compose has own keyboard handler + } +} + + + diff --git a/experimental/examples/minesweeper/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json b/experimental/examples/minesweeper/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 0000000000..4aa7c5350b --- /dev/null +++ b/experimental/examples/minesweeper/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} \ No newline at end of file diff --git a/experimental/examples/minesweeper/iosApp/iosApp/iOSApp.swift b/experimental/examples/minesweeper/iosApp/iosApp/iOSApp.swift new file mode 100644 index 0000000000..0648e8602f --- /dev/null +++ b/experimental/examples/minesweeper/iosApp/iosApp/iOSApp.swift @@ -0,0 +1,10 @@ +import SwiftUI + +@main +struct iOSApp: App { + var body: some Scene { + WindowGroup { + ContentView() + } + } +} \ No newline at end of file diff --git a/experimental/examples/minesweeper/iosApp/iosApp/iosApp.swift b/experimental/examples/minesweeper/iosApp/iosApp/iosApp.swift deleted file mode 100644 index 0f563c50c9..0000000000 --- a/experimental/examples/minesweeper/iosApp/iosApp/iosApp.swift +++ /dev/null @@ -1,15 +0,0 @@ -import UIKit -import shared - -@main -class AppDelegate: UIResponder, UIApplicationDelegate { - var window: UIWindow? - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - window = UIWindow(frame: UIScreen.main.bounds) - let mainViewController = Main_iosKt.MainViewController() - window?.rootViewController = mainViewController - window?.makeKeyAndVisible() - return true - } -} diff --git a/experimental/examples/minesweeper/shared/build.gradle.kts b/experimental/examples/minesweeper/shared/build.gradle.kts index b548ff1177..8e6466ca57 100644 --- a/experimental/examples/minesweeper/shared/build.gradle.kts +++ b/experimental/examples/minesweeper/shared/build.gradle.kts @@ -1,3 +1,5 @@ +@file:Suppress("OPT_IN_IS_NOT_ENABLED") + plugins { kotlin("multiplatform") kotlin("native.cocoapods") @@ -46,43 +48,28 @@ kotlin { extraSpecAttributes["resources"] = "['src/commonMain/resources/**', 'src/iosMain/resources/**']" } - val composeVersion = extra["compose.version"] as String - sourceSets { val commonMain by getting { dependencies { implementation(compose.ui) + implementation(compose.runtime) implementation(compose.foundation) implementation(compose.material) - implementation(compose.runtime) - implementation("org.jetbrains.compose.components:components-resources:1.4.0-alpha01-dev942") + @OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class) + implementation(compose.components.resources) } } - val commonTest by getting { - dependencies { - implementation(kotlin("test")) - implementation(kotlin("test-annotations-common")) } - } - val androidMain by getting { dependencies { - implementation("com.google.android.material:material:1.7.0") - } - } - val androidUnitTest by getting { - dependencies { - implementation("junit:junit:4.13.2") + api("androidx.activity:activity-compose:1.6.1") + api("androidx.appcompat:appcompat:1.6.1") + api("androidx.core:core-ktx:1.9.0") } } val iosMain by getting - val iosTest by getting val iosSimulatorArm64Main by getting { dependsOn(iosMain) } - val iosSimulatorArm64Test by getting { - dependsOn(iosTest) - } - val desktopMain by getting { dependencies { implementation(compose.desktop.common) @@ -106,12 +93,13 @@ android { sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml") sourceSets["main"].res.srcDirs("src/androidMain/res") sourceSets["main"].resources.srcDirs("src/commonMain/resources") + defaultConfig { - minSdk = 24 + minSdk = 26 targetSdk = 33 } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } } diff --git a/experimental/examples/minesweeper/shared/src/iosMain/kotlin/main.ios.kt b/experimental/examples/minesweeper/shared/src/iosMain/kotlin/main.ios.kt index 0ccba7c43a..ef0837a8c9 100644 --- a/experimental/examples/minesweeper/shared/src/iosMain/kotlin/main.ios.kt +++ b/experimental/examples/minesweeper/shared/src/iosMain/kotlin/main.ios.kt @@ -3,13 +3,9 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file. */ -import androidx.compose.ui.window.Application +import androidx.compose.ui.window.ComposeUIViewController import platform.UIKit.UIViewController -fun MainViewController() : UIViewController = - Application("Minesweeper") { - Game() - } - +fun MainViewController() : UIViewController = ComposeUIViewController { Game() } actual fun hasRightClick() = false \ No newline at end of file diff --git a/experimental/examples/todoapp-lite/README.md b/experimental/examples/todoapp-lite/README.md index ff7d9e2f0f..b072b23540 100755 --- a/experimental/examples/todoapp-lite/README.md +++ b/experimental/examples/todoapp-lite/README.md @@ -10,7 +10,7 @@ Choose a run configuration for an appropriate target in IDE and run it. ![run-configurations.png](run-configurations.png) -To run on iOS device, please correct `iosApp/Configuration/TeamId.xcconfig` with your Apple Team ID. +To run on iOS device, please correct `TEAM_ID` value in `iosApp/Configuration/Config.xcconfig` with your Apple Team ID. Alternatively, you may setup signing within XCode opening `iosApp/iosApp.xcworkspace` and then using "Signing & Capabilities" tab of `iosApp` target. diff --git a/experimental/examples/todoapp-lite/androidApp/build.gradle.kts b/experimental/examples/todoapp-lite/androidApp/build.gradle.kts index bba65e3c53..4859f67690 100755 --- a/experimental/examples/todoapp-lite/androidApp/build.gradle.kts +++ b/experimental/examples/todoapp-lite/androidApp/build.gradle.kts @@ -10,8 +10,6 @@ kotlin { val androidMain by getting { dependencies { implementation(project(":shared")) - implementation("androidx.appcompat:appcompat:1.5.1") - implementation("androidx.activity:activity-compose:1.6.1") implementation(compose.material) } } @@ -22,13 +20,13 @@ android { compileSdk = 33 defaultConfig { applicationId = "org.jetbrains.TodoAppLite" - minSdk = 24 + minSdk = 26 targetSdk = 33 versionCode = 1 versionName = "1.0" } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } } diff --git a/experimental/examples/todoapp-lite/gradle.properties b/experimental/examples/todoapp-lite/gradle.properties index 002855c0f5..5fcd45516e 100755 --- a/experimental/examples/todoapp-lite/gradle.properties +++ b/experimental/examples/todoapp-lite/gradle.properties @@ -13,4 +13,4 @@ kotlin.mpp.androidSourceSetLayoutVersion=2 kotlin.native.binary.memoryModel=experimental kotlin.version=1.8.0 agp.version=7.1.3 -compose.version=1.3.0 +compose.version=1.4.0-alpha01-dev954 diff --git a/experimental/examples/todoapp-lite/iosApp/Configuration/Config.xcconfig b/experimental/examples/todoapp-lite/iosApp/Configuration/Config.xcconfig new file mode 100644 index 0000000000..169ad39e92 --- /dev/null +++ b/experimental/examples/todoapp-lite/iosApp/Configuration/Config.xcconfig @@ -0,0 +1,3 @@ +TEAM_ID= +BUNDLE_ID=org.jetbrains.TodoAppLite +APP_NAME=TodoAppLite diff --git a/experimental/examples/todoapp-lite/iosApp/Configuration/TeamId.xcconfig b/experimental/examples/todoapp-lite/iosApp/Configuration/TeamId.xcconfig deleted file mode 100644 index bf06eb27e9..0000000000 --- a/experimental/examples/todoapp-lite/iosApp/Configuration/TeamId.xcconfig +++ /dev/null @@ -1 +0,0 @@ -TEAM_ID= diff --git a/experimental/examples/todoapp-lite/iosApp/iosApp.xcodeproj/project.pbxproj b/experimental/examples/todoapp-lite/iosApp/iosApp.xcodeproj/project.pbxproj index 90dbd7bdaf..ba431831fe 100644 --- a/experimental/examples/todoapp-lite/iosApp/iosApp.xcodeproj/project.pbxproj +++ b/experimental/examples/todoapp-lite/iosApp/iosApp.xcodeproj/project.pbxproj @@ -7,47 +7,69 @@ objects = { /* Begin PBXBuildFile section */ - 2152FB042600AC8F00CF470E /* iosApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2152FB032600AC8F00CF470E /* iosApp.swift */; }; - C1FC908188C4E8695729CB06 /* Pods_iosApp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DE96E47030356CE6AD9794A /* Pods_iosApp.framework */; }; + 058557BB273AAA24004C7B11 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 058557BA273AAA24004C7B11 /* Assets.xcassets */; }; + 058557D9273AAEEB004C7B11 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */; }; + 2152FB042600AC8F00CF470E /* iOSApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2152FB032600AC8F00CF470E /* iOSApp.swift */; }; + 7555FF83242A565900829871 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7555FF82242A565900829871 /* ContentView.swift */; }; + CFDB58B53BB94DE262B13C24 /* Pods_iosApp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6B1049432C0C2B312090ABF6 /* Pods_iosApp.framework */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 1EB65E27D2C0F884D0A1A133 /* Pods-iosApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosApp.debug.xcconfig"; path = "Target Support Files/Pods-iosApp/Pods-iosApp.debug.xcconfig"; sourceTree = ""; }; - 2152FB032600AC8F00CF470E /* iosApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iosApp.swift; sourceTree = ""; }; - 3D7A606AB0AD7636269BD9D0 /* Pods-iosApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosApp.release.xcconfig"; path = "Target Support Files/Pods-iosApp/Pods-iosApp.release.xcconfig"; sourceTree = ""; }; - 7555FF7B242A565900829871 /* TodoAppLite.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TodoAppLite.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 058557BA273AAA24004C7B11 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 2152FB032600AC8F00CF470E /* iOSApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOSApp.swift; sourceTree = ""; }; + 4FF3202A603A284706412EDC /* Pods-iosApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosApp.debug.xcconfig"; path = "Target Support Files/Pods-iosApp/Pods-iosApp.debug.xcconfig"; sourceTree = ""; }; + 6B1049432C0C2B312090ABF6 /* Pods_iosApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_iosApp.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 7555FF7B242A565900829871 /* iosApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iosApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 7555FF82242A565900829871 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 7555FF8C242A565B00829871 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 8DE96E47030356CE6AD9794A /* Pods_iosApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_iosApp.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - AB3632DC29227652001CCB65 /* TeamId.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = TeamId.xcconfig; sourceTree = ""; }; + AB3632DC29227652001CCB65 /* Config.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Config.xcconfig; sourceTree = ""; }; + FF8CA3F5360CEAB49D74065F /* Pods-iosApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosApp.release.xcconfig"; path = "Target Support Files/Pods-iosApp/Pods-iosApp.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 9964867F0862B4D9FB6ABFC7 /* Frameworks */ = { + F85CB1118929364A9C6EFABC /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C1FC908188C4E8695729CB06 /* Pods_iosApp.framework in Frameworks */, + CFDB58B53BB94DE262B13C24 /* Pods_iosApp.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 058557D7273AAEEB004C7B11 /* Preview Content */ = { + isa = PBXGroup; + children = ( + 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + 42799AB246E5F90AF97AA0EF /* Frameworks */ = { + isa = PBXGroup; + children = ( + 6B1049432C0C2B312090ABF6 /* Pods_iosApp.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; 7555FF72242A565900829871 = { isa = PBXGroup; children = ( AB1DB47929225F7C00F7AF9C /* Configuration */, 7555FF7D242A565900829871 /* iosApp */, 7555FF7C242A565900829871 /* Products */, - E1DAFBE8E1CFC0878361EF0E /* Pods */, - B62309C7396AD7BF607A63B2 /* Frameworks */, + FEFF387C0A8D172AA4D59CAE /* Pods */, + 42799AB246E5F90AF97AA0EF /* Frameworks */, ); sourceTree = ""; }; 7555FF7C242A565900829871 /* Products */ = { isa = PBXGroup; children = ( - 7555FF7B242A565900829871 /* TodoAppLite.app */, + 7555FF7B242A565900829871 /* iosApp.app */, ); name = Products; sourceTree = ""; @@ -55,8 +77,11 @@ 7555FF7D242A565900829871 /* iosApp */ = { isa = PBXGroup; children = ( + 058557BA273AAA24004C7B11 /* Assets.xcassets */, + 7555FF82242A565900829871 /* ContentView.swift */, 7555FF8C242A565B00829871 /* Info.plist */, - 2152FB032600AC8F00CF470E /* iosApp.swift */, + 2152FB032600AC8F00CF470E /* iOSApp.swift */, + 058557D7273AAEEB004C7B11 /* Preview Content */, ); path = iosApp; sourceTree = ""; @@ -64,24 +89,16 @@ AB1DB47929225F7C00F7AF9C /* Configuration */ = { isa = PBXGroup; children = ( - AB3632DC29227652001CCB65 /* TeamId.xcconfig */, + AB3632DC29227652001CCB65 /* Config.xcconfig */, ); path = Configuration; sourceTree = ""; }; - B62309C7396AD7BF607A63B2 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 8DE96E47030356CE6AD9794A /* Pods_iosApp.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - E1DAFBE8E1CFC0878361EF0E /* Pods */ = { + FEFF387C0A8D172AA4D59CAE /* Pods */ = { isa = PBXGroup; children = ( - 1EB65E27D2C0F884D0A1A133 /* Pods-iosApp.debug.xcconfig */, - 3D7A606AB0AD7636269BD9D0 /* Pods-iosApp.release.xcconfig */, + 4FF3202A603A284706412EDC /* Pods-iosApp.debug.xcconfig */, + FF8CA3F5360CEAB49D74065F /* Pods-iosApp.release.xcconfig */, ); path = Pods; sourceTree = ""; @@ -93,10 +110,10 @@ isa = PBXNativeTarget; buildConfigurationList = 7555FFA5242A565B00829871 /* Build configuration list for PBXNativeTarget "iosApp" */; buildPhases = ( - E8D673591E7196AEA2EA10E2 /* [CP] Check Pods Manifest.lock */, + 98D614C51D2DA07C614CC46E /* [CP] Check Pods Manifest.lock */, 7555FF77242A565900829871 /* Sources */, 7555FF79242A565900829871 /* Resources */, - 9964867F0862B4D9FB6ABFC7 /* Frameworks */, + F85CB1118929364A9C6EFABC /* Frameworks */, ); buildRules = ( ); @@ -104,7 +121,7 @@ ); name = iosApp; productName = iosApp; - productReference = 7555FF7B242A565900829871 /* TodoAppLite.app */; + productReference = 7555FF7B242A565900829871 /* iosApp.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ @@ -115,7 +132,7 @@ attributes = { LastSwiftUpdateCheck = 1130; LastUpgradeCheck = 1130; - ORGANIZATIONNAME = org.jetbrains; + ORGANIZATIONNAME = orgName; TargetAttributes = { 7555FF7A242A565900829871 = { CreatedOnToolsVersion = 11.3.1; @@ -151,7 +168,7 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - E8D673591E7196AEA2EA10E2 /* [CP] Check Pods Manifest.lock */ = { + 98D614C51D2DA07C614CC46E /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -180,7 +197,8 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 2152FB042600AC8F00CF470E /* iosApp.swift in Sources */, + 2152FB042600AC8F00CF470E /* iOSApp.swift in Sources */, + 7555FF83242A565900829871 /* ContentView.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -189,7 +207,7 @@ /* Begin XCBuildConfiguration section */ 7555FFA3242A565B00829871 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = AB3632DC29227652001CCB65 /* TeamId.xcconfig */; + baseConfigurationReference = AB3632DC29227652001CCB65 /* Config.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -251,7 +269,7 @@ }; 7555FFA4242A565B00829871 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = AB3632DC29227652001CCB65 /* TeamId.xcconfig */; + baseConfigurationReference = AB3632DC29227652001CCB65 /* Config.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -307,12 +325,12 @@ }; 7555FFA6242A565B00829871 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 1EB65E27D2C0F884D0A1A133 /* Pods-iosApp.debug.xcconfig */; + baseConfigurationReference = 4FF3202A603A284706412EDC /* Pods-iosApp.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_ASSET_PATHS = ""; + DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\""; DEVELOPMENT_TEAM = "${TEAM_ID}"; ENABLE_PREVIEWS = YES; INFOPLIST_FILE = iosApp/Info.plist; @@ -321,8 +339,8 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = "org.jetbrains.TodoAppLite${TEAM_ID}"; - PRODUCT_NAME = "TodoAppLite"; + PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}${TEAM_ID}"; + PRODUCT_NAME = "${APP_NAME}"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -331,12 +349,12 @@ }; 7555FFA7242A565B00829871 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 3D7A606AB0AD7636269BD9D0 /* Pods-iosApp.release.xcconfig */; + baseConfigurationReference = FF8CA3F5360CEAB49D74065F /* Pods-iosApp.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_ASSET_PATHS = ""; + DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\""; DEVELOPMENT_TEAM = "${TEAM_ID}"; ENABLE_PREVIEWS = YES; INFOPLIST_FILE = iosApp/Info.plist; @@ -345,8 +363,8 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = "org.jetbrains.TodoAppLite${TEAM_ID}"; - PRODUCT_NAME = "TodoAppLite"; + PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}${TEAM_ID}"; + PRODUCT_NAME = "${APP_NAME}"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; diff --git a/experimental/examples/todoapp-lite/iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json b/experimental/examples/todoapp-lite/iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000000..ee7e3ca03f --- /dev/null +++ b/experimental/examples/todoapp-lite/iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} \ No newline at end of file diff --git a/experimental/examples/todoapp-lite/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json b/experimental/examples/todoapp-lite/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000000..fb88a396bf --- /dev/null +++ b/experimental/examples/todoapp-lite/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} \ No newline at end of file diff --git a/experimental/examples/todoapp-lite/iosApp/iosApp/Assets.xcassets/Contents.json b/experimental/examples/todoapp-lite/iosApp/iosApp/Assets.xcassets/Contents.json new file mode 100644 index 0000000000..4aa7c5350b --- /dev/null +++ b/experimental/examples/todoapp-lite/iosApp/iosApp/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} \ No newline at end of file diff --git a/experimental/examples/todoapp-lite/iosApp/iosApp/ContentView.swift b/experimental/examples/todoapp-lite/iosApp/iosApp/ContentView.swift new file mode 100644 index 0000000000..f7f6457b31 --- /dev/null +++ b/experimental/examples/todoapp-lite/iosApp/iosApp/ContentView.swift @@ -0,0 +1,21 @@ +import UIKit +import SwiftUI +import shared + +struct ComposeView: UIViewControllerRepresentable { + func makeUIViewController(context: Context) -> UIViewController { + Main_iosKt.MainViewController() + } + + func updateUIViewController(_ uiViewController: UIViewController, context: Context) {} +} + +struct ContentView: View { + var body: some View { + ComposeView() + .ignoresSafeArea(.keyboard) // Compose has own keyboard handler + } +} + + + diff --git a/experimental/examples/todoapp-lite/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json b/experimental/examples/todoapp-lite/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 0000000000..4aa7c5350b --- /dev/null +++ b/experimental/examples/todoapp-lite/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} \ No newline at end of file diff --git a/experimental/examples/todoapp-lite/iosApp/iosApp/iOSApp.swift b/experimental/examples/todoapp-lite/iosApp/iosApp/iOSApp.swift new file mode 100644 index 0000000000..0648e8602f --- /dev/null +++ b/experimental/examples/todoapp-lite/iosApp/iosApp/iOSApp.swift @@ -0,0 +1,10 @@ +import SwiftUI + +@main +struct iOSApp: App { + var body: some Scene { + WindowGroup { + ContentView() + } + } +} \ No newline at end of file diff --git a/experimental/examples/todoapp-lite/iosApp/iosApp/iosApp.swift b/experimental/examples/todoapp-lite/iosApp/iosApp/iosApp.swift deleted file mode 100644 index 0f563c50c9..0000000000 --- a/experimental/examples/todoapp-lite/iosApp/iosApp/iosApp.swift +++ /dev/null @@ -1,15 +0,0 @@ -import UIKit -import shared - -@main -class AppDelegate: UIResponder, UIApplicationDelegate { - var window: UIWindow? - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - window = UIWindow(frame: UIScreen.main.bounds) - let mainViewController = Main_iosKt.MainViewController() - window?.rootViewController = mainViewController - window?.makeKeyAndVisible() - return true - } -} diff --git a/experimental/examples/todoapp-lite/shared/build.gradle.kts b/experimental/examples/todoapp-lite/shared/build.gradle.kts index 8f770eda2f..fff63d294b 100755 --- a/experimental/examples/todoapp-lite/shared/build.gradle.kts +++ b/experimental/examples/todoapp-lite/shared/build.gradle.kts @@ -1,3 +1,5 @@ +@file:Suppress("OPT_IN_IS_NOT_ENABLED") + plugins { kotlin("multiplatform") kotlin("native.cocoapods") @@ -24,6 +26,7 @@ kotlin { baseName = "shared" isStatic = true } + extraSpecAttributes["resources"] = "['src/commonMain/resources/**', 'src/iosMain/resources/**']" } sourceSets { @@ -32,33 +35,41 @@ kotlin { implementation(compose.runtime) implementation(compose.foundation) implementation(compose.material) - implementation(compose.ui) + @OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class) + implementation(compose.components.resources) + } + } + val androidMain by getting { + dependencies { + api("androidx.activity:activity-compose:1.6.1") + api("androidx.appcompat:appcompat:1.6.1") + api("androidx.core:core-ktx:1.9.0") } } - val androidMain by getting val iosMain by getting - val iosTest by getting val iosSimulatorArm64Main by getting { dependsOn(iosMain) } - val iosSimulatorArm64Test by getting { - dependsOn(iosTest) + val desktopMain by getting { + dependencies { + implementation(compose.desktop.common) + } } - - val desktopMain by getting } } android { compileSdk = 33 sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml") - sourceSets["main"].res.srcDirs("src/androidMain/res", "src/commonMain/resources") + sourceSets["main"].res.srcDirs("src/androidMain/res") + sourceSets["main"].resources.srcDirs("src/commonMain/resources") + defaultConfig { - minSdk = 24 + minSdk = 26 targetSdk = 33 } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } } diff --git a/experimental/examples/todoapp-lite/shared/src/desktopMain/kotlin/example/todoapp/lite/common/Utils.kt b/experimental/examples/todoapp-lite/shared/src/desktopMain/kotlin/example/todoapp/lite/common/Utils.kt index 1e36024aa1..fa16ba1c4f 100644 --- a/experimental/examples/todoapp-lite/shared/src/desktopMain/kotlin/example/todoapp/lite/common/Utils.kt +++ b/experimental/examples/todoapp-lite/shared/src/desktopMain/kotlin/example/todoapp/lite/common/Utils.kt @@ -15,7 +15,7 @@ import androidx.compose.ui.unit.dp internal actual val MARGIN_SCROLLBAR: Dp = 8.dp @Suppress("ACTUAL_WITHOUT_EXPECT") // Workaround https://youtrack.jetbrains.com/issue/KT-37316 -internal actual typealias ScrollbarAdapter = androidx.compose.foundation.ScrollbarAdapter +internal actual typealias ScrollbarAdapter = androidx.compose.foundation.v2.ScrollbarAdapter @Composable internal actual fun rememberScrollbarAdapter(scrollState: LazyListState): ScrollbarAdapter = diff --git a/experimental/examples/todoapp-lite/shared/src/iosMain/kotlin/main.ios.kt b/experimental/examples/todoapp-lite/shared/src/iosMain/kotlin/main.ios.kt index 502f616d69..3b53134278 100644 --- a/experimental/examples/todoapp-lite/shared/src/iosMain/kotlin/main.ios.kt +++ b/experimental/examples/todoapp-lite/shared/src/iosMain/kotlin/main.ios.kt @@ -3,24 +3,12 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file. */ -import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.foundation.layout.height import androidx.compose.ui.Modifier -import androidx.compose.ui.unit.dp -import androidx.compose.ui.window.Application +import androidx.compose.ui.window.ComposeUIViewController import example.todoapp.lite.common.RootContent import platform.UIKit.UIViewController -fun MainViewController() : UIViewController = - Application("Todo") { - Column { - // To skip upper part of screen. - Box( - modifier = Modifier - .height(30.dp) - ) - RootContent(modifier = Modifier.fillMaxSize()) - } - } +fun MainViewController() : UIViewController = ComposeUIViewController { + RootContent(modifier = Modifier.fillMaxSize()) +} \ No newline at end of file diff --git a/experimental/examples/visual-effects/README.md b/experimental/examples/visual-effects/README.md index 8adffa9f90..ba75334da2 100644 --- a/experimental/examples/visual-effects/README.md +++ b/experimental/examples/visual-effects/README.md @@ -12,7 +12,7 @@ Choose a run configuration for an appropriate target in IDE and run it. ![run-configurations.png](run-configurations.png) -To run on iOS device, please correct `iosApp/Configuration/TeamId.xcconfig` with your Apple Team ID. +To run on iOS device, please correct `TEAM_ID` value in `iosApp/Configuration/Config.xcconfig` with your Apple Team ID. Alternatively, you may setup signing within XCode opening `iosApp/iosApp.xcworkspace` and then using "Signing & Capabilities" tab of `iosApp` target. diff --git a/experimental/examples/visual-effects/androidApp/build.gradle.kts b/experimental/examples/visual-effects/androidApp/build.gradle.kts index 4fb3819b6a..61a9bd4d72 100644 --- a/experimental/examples/visual-effects/androidApp/build.gradle.kts +++ b/experimental/examples/visual-effects/androidApp/build.gradle.kts @@ -10,8 +10,6 @@ kotlin { val androidMain by getting { dependencies { implementation(project(":shared")) - implementation("androidx.appcompat:appcompat:1.5.1") - implementation("androidx.activity:activity-compose:1.6.1") } } } @@ -21,13 +19,13 @@ android { compileSdk = 33 defaultConfig { applicationId = "org.jetbrains.VisualEffects" - minSdk = 24 + minSdk = 26 targetSdk = 33 versionCode = 1 versionName = "1.0" } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } } diff --git a/experimental/examples/visual-effects/gradle.properties b/experimental/examples/visual-effects/gradle.properties index 201df576ce..63f8d55d08 100644 --- a/experimental/examples/visual-effects/gradle.properties +++ b/experimental/examples/visual-effects/gradle.properties @@ -13,4 +13,4 @@ kotlin.native.useEmbeddableCompilerJar=true kotlin.native.binary.memoryModel=experimental kotlin.version=1.8.0 agp.version=7.1.3 -compose.version=1.3.0 +compose.version=1.4.0-alpha01-dev954 diff --git a/experimental/examples/visual-effects/iosApp/Configuration/Config.xcconfig b/experimental/examples/visual-effects/iosApp/Configuration/Config.xcconfig new file mode 100644 index 0000000000..bad995c745 --- /dev/null +++ b/experimental/examples/visual-effects/iosApp/Configuration/Config.xcconfig @@ -0,0 +1,3 @@ +TEAM_ID= +BUNDLE_ID=org.jetbrains.VisualEffects +APP_NAME=VisualEffects diff --git a/experimental/examples/visual-effects/iosApp/Configuration/TeamId.xcconfig b/experimental/examples/visual-effects/iosApp/Configuration/TeamId.xcconfig deleted file mode 100644 index 73f52f87e4..0000000000 --- a/experimental/examples/visual-effects/iosApp/Configuration/TeamId.xcconfig +++ /dev/null @@ -1 +0,0 @@ -TEAM_ID= \ No newline at end of file diff --git a/experimental/examples/visual-effects/iosApp/iosApp.xcodeproj/project.pbxproj b/experimental/examples/visual-effects/iosApp/iosApp.xcodeproj/project.pbxproj index cf6c635c60..5a8686e252 100644 --- a/experimental/examples/visual-effects/iosApp/iosApp.xcodeproj/project.pbxproj +++ b/experimental/examples/visual-effects/iosApp/iosApp.xcodeproj/project.pbxproj @@ -7,47 +7,67 @@ objects = { /* Begin PBXBuildFile section */ - 2152FB042600AC8F00CF470E /* iosApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2152FB032600AC8F00CF470E /* iosApp.swift */; }; - C1FC908188C4E8695729CB06 /* Pods_iosApp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DE96E47030356CE6AD9794A /* Pods_iosApp.framework */; }; + 2152FB042600AC8F00CF470E /* iOSApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2152FB032600AC8F00CF470E /* iOSApp.swift */; }; + 7555FF83242A565900829871 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7555FF82242A565900829871 /* ContentView.swift */; }; + CFDB58B53BB94DE262B13C24 /* Pods_iosApp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6B1049432C0C2B312090ABF6 /* Pods_iosApp.framework */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 1EB65E27D2C0F884D0A1A133 /* Pods-iosApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosApp.debug.xcconfig"; path = "Target Support Files/Pods-iosApp/Pods-iosApp.debug.xcconfig"; sourceTree = ""; }; - 2152FB032600AC8F00CF470E /* iosApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iosApp.swift; sourceTree = ""; }; - 3D7A606AB0AD7636269BD9D0 /* Pods-iosApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosApp.release.xcconfig"; path = "Target Support Files/Pods-iosApp/Pods-iosApp.release.xcconfig"; sourceTree = ""; }; - 7555FF7B242A565900829871 /* VisualEffects.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = VisualEffects.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 058557BA273AAA24004C7B11 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 2152FB032600AC8F00CF470E /* iOSApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOSApp.swift; sourceTree = ""; }; + 4FF3202A603A284706412EDC /* Pods-iosApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosApp.debug.xcconfig"; path = "Target Support Files/Pods-iosApp/Pods-iosApp.debug.xcconfig"; sourceTree = ""; }; + 6B1049432C0C2B312090ABF6 /* Pods_iosApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_iosApp.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 7555FF7B242A565900829871 /* iosApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iosApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 7555FF82242A565900829871 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 7555FF8C242A565B00829871 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 8DE96E47030356CE6AD9794A /* Pods_iosApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_iosApp.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - AB3632DC29227652001CCB65 /* TeamId.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = TeamId.xcconfig; sourceTree = ""; }; + AB3632DC29227652001CCB65 /* Config.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Config.xcconfig; sourceTree = ""; }; + FF8CA3F5360CEAB49D74065F /* Pods-iosApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosApp.release.xcconfig"; path = "Target Support Files/Pods-iosApp/Pods-iosApp.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 9964867F0862B4D9FB6ABFC7 /* Frameworks */ = { + F85CB1118929364A9C6EFABC /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C1FC908188C4E8695729CB06 /* Pods_iosApp.framework in Frameworks */, + CFDB58B53BB94DE262B13C24 /* Pods_iosApp.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 058557D7273AAEEB004C7B11 /* Preview Content */ = { + isa = PBXGroup; + children = ( + 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + 42799AB246E5F90AF97AA0EF /* Frameworks */ = { + isa = PBXGroup; + children = ( + 6B1049432C0C2B312090ABF6 /* Pods_iosApp.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; 7555FF72242A565900829871 = { isa = PBXGroup; children = ( AB1DB47929225F7C00F7AF9C /* Configuration */, 7555FF7D242A565900829871 /* iosApp */, 7555FF7C242A565900829871 /* Products */, - E1DAFBE8E1CFC0878361EF0E /* Pods */, - B62309C7396AD7BF607A63B2 /* Frameworks */, + FEFF387C0A8D172AA4D59CAE /* Pods */, + 42799AB246E5F90AF97AA0EF /* Frameworks */, ); sourceTree = ""; }; 7555FF7C242A565900829871 /* Products */ = { isa = PBXGroup; children = ( - 7555FF7B242A565900829871 /* VisualEffects.app */, + 7555FF7B242A565900829871 /* iosApp.app */, ); name = Products; sourceTree = ""; @@ -55,8 +75,11 @@ 7555FF7D242A565900829871 /* iosApp */ = { isa = PBXGroup; children = ( + 058557BA273AAA24004C7B11 /* Assets.xcassets */, + 7555FF82242A565900829871 /* ContentView.swift */, 7555FF8C242A565B00829871 /* Info.plist */, - 2152FB032600AC8F00CF470E /* iosApp.swift */, + 2152FB032600AC8F00CF470E /* iOSApp.swift */, + 058557D7273AAEEB004C7B11 /* Preview Content */, ); path = iosApp; sourceTree = ""; @@ -64,24 +87,16 @@ AB1DB47929225F7C00F7AF9C /* Configuration */ = { isa = PBXGroup; children = ( - AB3632DC29227652001CCB65 /* TeamId.xcconfig */, + AB3632DC29227652001CCB65 /* Config.xcconfig */, ); path = Configuration; sourceTree = ""; }; - B62309C7396AD7BF607A63B2 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 8DE96E47030356CE6AD9794A /* Pods_iosApp.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - E1DAFBE8E1CFC0878361EF0E /* Pods */ = { + FEFF387C0A8D172AA4D59CAE /* Pods */ = { isa = PBXGroup; children = ( - 1EB65E27D2C0F884D0A1A133 /* Pods-iosApp.debug.xcconfig */, - 3D7A606AB0AD7636269BD9D0 /* Pods-iosApp.release.xcconfig */, + 4FF3202A603A284706412EDC /* Pods-iosApp.debug.xcconfig */, + FF8CA3F5360CEAB49D74065F /* Pods-iosApp.release.xcconfig */, ); path = Pods; sourceTree = ""; @@ -93,11 +108,11 @@ isa = PBXNativeTarget; buildConfigurationList = 7555FFA5242A565B00829871 /* Build configuration list for PBXNativeTarget "iosApp" */; buildPhases = ( - E8D673591E7196AEA2EA10E2 /* [CP] Check Pods Manifest.lock */, + 98D614C51D2DA07C614CC46E /* [CP] Check Pods Manifest.lock */, 7555FF77242A565900829871 /* Sources */, 7555FF79242A565900829871 /* Resources */, - 9964867F0862B4D9FB6ABFC7 /* Frameworks */, - C64736A3E64D105DF1EF6621 /* [CP] Copy Pods Resources */, + F85CB1118929364A9C6EFABC /* Frameworks */, + 7694444BC13DD49B4B2626ED /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -105,7 +120,7 @@ ); name = iosApp; productName = iosApp; - productReference = 7555FF7B242A565900829871 /* VisualEffects.app */; + productReference = 7555FF7B242A565900829871 /* iosApp.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ @@ -116,7 +131,7 @@ attributes = { LastSwiftUpdateCheck = 1130; LastUpgradeCheck = 1130; - ORGANIZATIONNAME = org.jetbrains; + ORGANIZATIONNAME = orgName; TargetAttributes = { 7555FF7A242A565900829871 = { CreatedOnToolsVersion = 11.3.1; @@ -152,7 +167,7 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - C64736A3E64D105DF1EF6621 /* [CP] Copy Pods Resources */ = { + 7694444BC13DD49B4B2626ED /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -169,7 +184,7 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-resources.sh\"\n"; showEnvVarsInLog = 0; }; - E8D673591E7196AEA2EA10E2 /* [CP] Check Pods Manifest.lock */ = { + 98D614C51D2DA07C614CC46E /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -198,7 +213,8 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 2152FB042600AC8F00CF470E /* iosApp.swift in Sources */, + 2152FB042600AC8F00CF470E /* iOSApp.swift in Sources */, + 7555FF83242A565900829871 /* ContentView.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -207,7 +223,7 @@ /* Begin XCBuildConfiguration section */ 7555FFA3242A565B00829871 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = AB3632DC29227652001CCB65 /* TeamId.xcconfig */; + baseConfigurationReference = AB3632DC29227652001CCB65 /* Config.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -269,7 +285,7 @@ }; 7555FFA4242A565B00829871 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = AB3632DC29227652001CCB65 /* TeamId.xcconfig */; + baseConfigurationReference = AB3632DC29227652001CCB65 /* Config.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -325,12 +341,12 @@ }; 7555FFA6242A565B00829871 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 1EB65E27D2C0F884D0A1A133 /* Pods-iosApp.debug.xcconfig */; + baseConfigurationReference = 4FF3202A603A284706412EDC /* Pods-iosApp.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_ASSET_PATHS = ""; + DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\""; DEVELOPMENT_TEAM = "${TEAM_ID}"; ENABLE_PREVIEWS = YES; INFOPLIST_FILE = iosApp/Info.plist; @@ -339,8 +355,8 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = "org.jetbrains.VisualEffects${TEAM_ID}"; - PRODUCT_NAME = "VisualEffects"; + PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}${TEAM_ID}"; + PRODUCT_NAME = "${APP_NAME}"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -349,12 +365,12 @@ }; 7555FFA7242A565B00829871 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 3D7A606AB0AD7636269BD9D0 /* Pods-iosApp.release.xcconfig */; + baseConfigurationReference = FF8CA3F5360CEAB49D74065F /* Pods-iosApp.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_ASSET_PATHS = ""; + DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\""; DEVELOPMENT_TEAM = "${TEAM_ID}"; ENABLE_PREVIEWS = YES; INFOPLIST_FILE = iosApp/Info.plist; @@ -363,8 +379,8 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = "org.jetbrains.VisualEffects${TEAM_ID}"; - PRODUCT_NAME = "VisualEffects"; + PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}${TEAM_ID}"; + PRODUCT_NAME = "${APP_NAME}"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; diff --git a/experimental/examples/visual-effects/iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json b/experimental/examples/visual-effects/iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000000..ee7e3ca03f --- /dev/null +++ b/experimental/examples/visual-effects/iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} \ No newline at end of file diff --git a/experimental/examples/visual-effects/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json b/experimental/examples/visual-effects/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000000..fb88a396bf --- /dev/null +++ b/experimental/examples/visual-effects/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} \ No newline at end of file diff --git a/experimental/examples/visual-effects/iosApp/iosApp/Assets.xcassets/Contents.json b/experimental/examples/visual-effects/iosApp/iosApp/Assets.xcassets/Contents.json new file mode 100644 index 0000000000..4aa7c5350b --- /dev/null +++ b/experimental/examples/visual-effects/iosApp/iosApp/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} \ No newline at end of file diff --git a/experimental/examples/visual-effects/iosApp/iosApp/ContentView.swift b/experimental/examples/visual-effects/iosApp/iosApp/ContentView.swift new file mode 100644 index 0000000000..f7f6457b31 --- /dev/null +++ b/experimental/examples/visual-effects/iosApp/iosApp/ContentView.swift @@ -0,0 +1,21 @@ +import UIKit +import SwiftUI +import shared + +struct ComposeView: UIViewControllerRepresentable { + func makeUIViewController(context: Context) -> UIViewController { + Main_iosKt.MainViewController() + } + + func updateUIViewController(_ uiViewController: UIViewController, context: Context) {} +} + +struct ContentView: View { + var body: some View { + ComposeView() + .ignoresSafeArea(.keyboard) // Compose has own keyboard handler + } +} + + + diff --git a/experimental/examples/visual-effects/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json b/experimental/examples/visual-effects/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 0000000000..4aa7c5350b --- /dev/null +++ b/experimental/examples/visual-effects/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} \ No newline at end of file diff --git a/experimental/examples/visual-effects/iosApp/iosApp/iOSApp.swift b/experimental/examples/visual-effects/iosApp/iosApp/iOSApp.swift new file mode 100644 index 0000000000..0648e8602f --- /dev/null +++ b/experimental/examples/visual-effects/iosApp/iosApp/iOSApp.swift @@ -0,0 +1,10 @@ +import SwiftUI + +@main +struct iOSApp: App { + var body: some Scene { + WindowGroup { + ContentView() + } + } +} \ No newline at end of file diff --git a/experimental/examples/visual-effects/iosApp/iosApp/iosApp.swift b/experimental/examples/visual-effects/iosApp/iosApp/iosApp.swift deleted file mode 100644 index 0f563c50c9..0000000000 --- a/experimental/examples/visual-effects/iosApp/iosApp/iosApp.swift +++ /dev/null @@ -1,15 +0,0 @@ -import UIKit -import shared - -@main -class AppDelegate: UIResponder, UIApplicationDelegate { - var window: UIWindow? - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - window = UIWindow(frame: UIScreen.main.bounds) - let mainViewController = Main_iosKt.MainViewController() - window?.rootViewController = mainViewController - window?.makeKeyAndVisible() - return true - } -} diff --git a/experimental/examples/visual-effects/shared/build.gradle.kts b/experimental/examples/visual-effects/shared/build.gradle.kts index 55f9c1c67e..de48622f63 100644 --- a/experimental/examples/visual-effects/shared/build.gradle.kts +++ b/experimental/examples/visual-effects/shared/build.gradle.kts @@ -34,24 +34,21 @@ kotlin { implementation(compose.foundation) implementation(compose.material) implementation(compose.materialIconsExtended) - implementation("org.jetbrains.compose.components:components-resources:1.4.0-alpha01-dev942") + @OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class) + implementation(compose.components.resources) } } val androidMain by getting { dependencies { - implementation("androidx.appcompat:appcompat:1.5.1") - implementation("androidx.core:core-ktx:1.8.0") + api("androidx.activity:activity-compose:1.6.1") + api("androidx.appcompat:appcompat:1.6.1") + api("androidx.core:core-ktx:1.9.0") } } val iosMain by getting - val iosTest by getting val iosSimulatorArm64Main by getting { dependsOn(iosMain) } - val iosSimulatorArm64Test by getting { - dependsOn(iosTest) - } - val desktopMain by getting { dependencies { implementation(compose.desktop.common) @@ -67,11 +64,11 @@ android { sourceSets["main"].resources.srcDirs("src/commonMain/resources") defaultConfig { - minSdk = 24 + minSdk = 26 targetSdk = 33 } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } } diff --git a/experimental/examples/visual-effects/shared/src/iosMain/kotlin/main.ios.kt b/experimental/examples/visual-effects/shared/src/iosMain/kotlin/main.ios.kt index f2ac75bb8c..c8004b488b 100644 --- a/experimental/examples/visual-effects/shared/src/iosMain/kotlin/main.ios.kt +++ b/experimental/examples/visual-effects/shared/src/iosMain/kotlin/main.ios.kt @@ -3,20 +3,8 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file. */ -import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.height -import androidx.compose.ui.Modifier -import androidx.compose.ui.unit.dp -import androidx.compose.ui.window.Application +import androidx.compose.ui.window.ComposeUIViewController import org.jetbrains.compose.demo.visuals.AllSamplesView import platform.UIKit.UIViewController -fun MainViewController() : UIViewController = - Application("Visual Effects") { - Column { - // To skip upper part of screen. - Box(modifier = Modifier.height(30.dp)) - AllSamplesView() - } -} +fun MainViewController() : UIViewController = ComposeUIViewController { AllSamplesView() } diff --git a/experimental/examples/widgets-gallery/README.md b/experimental/examples/widgets-gallery/README.md index 7b275f4b90..0121f321d1 100644 --- a/experimental/examples/widgets-gallery/README.md +++ b/experimental/examples/widgets-gallery/README.md @@ -14,7 +14,7 @@ Choose a run configuration for an appropriate target in IDE and run it. ![run-configurations.png](run-configurations.png) -To run on iOS device, please correct `iosApp/Configuration/TeamId.xcconfig` with your Apple Team ID. +To run on iOS device, please correct `TEAM_ID` value in `iosApp/Configuration/Config.xcconfig` with your Apple Team ID. Alternatively, you may setup signing within XCode opening `iosApp/iosApp.xcworkspace` and then using "Signing & Capabilities" tab of `iosApp` target. diff --git a/experimental/examples/widgets-gallery/androidApp/build.gradle.kts b/experimental/examples/widgets-gallery/androidApp/build.gradle.kts index ca1d24e891..0e3faf6949 100644 --- a/experimental/examples/widgets-gallery/androidApp/build.gradle.kts +++ b/experimental/examples/widgets-gallery/androidApp/build.gradle.kts @@ -10,8 +10,6 @@ kotlin { val androidMain by getting { dependencies { implementation(project(":shared")) - implementation("androidx.appcompat:appcompat:1.5.1") - implementation("androidx.activity:activity-compose:1.6.1") } } } @@ -20,14 +18,14 @@ kotlin { android { compileSdk = 33 defaultConfig { - applicationId = "org.jetbrains.FallingBalls" - minSdk = 24 + applicationId = "org.jetbrains.WidgetsGallery" + minSdk = 26 targetSdk = 33 versionCode = 1 versionName = "1.0" } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } } diff --git a/experimental/examples/widgets-gallery/gradle.properties b/experimental/examples/widgets-gallery/gradle.properties index 002855c0f5..5fcd45516e 100644 --- a/experimental/examples/widgets-gallery/gradle.properties +++ b/experimental/examples/widgets-gallery/gradle.properties @@ -13,4 +13,4 @@ kotlin.mpp.androidSourceSetLayoutVersion=2 kotlin.native.binary.memoryModel=experimental kotlin.version=1.8.0 agp.version=7.1.3 -compose.version=1.3.0 +compose.version=1.4.0-alpha01-dev954 diff --git a/experimental/examples/widgets-gallery/iosApp/Configuration/Config.xcconfig b/experimental/examples/widgets-gallery/iosApp/Configuration/Config.xcconfig new file mode 100644 index 0000000000..341043a1b1 --- /dev/null +++ b/experimental/examples/widgets-gallery/iosApp/Configuration/Config.xcconfig @@ -0,0 +1,3 @@ +TEAM_ID= +BUNDLE_ID=org.jetbrains.WidgetsGallery +APP_NAME=WidgetsGallery diff --git a/experimental/examples/widgets-gallery/iosApp/Configuration/TeamId.xcconfig b/experimental/examples/widgets-gallery/iosApp/Configuration/TeamId.xcconfig deleted file mode 100644 index bf06eb27e9..0000000000 --- a/experimental/examples/widgets-gallery/iosApp/Configuration/TeamId.xcconfig +++ /dev/null @@ -1 +0,0 @@ -TEAM_ID= diff --git a/experimental/examples/widgets-gallery/iosApp/iosApp.xcodeproj/project.pbxproj b/experimental/examples/widgets-gallery/iosApp/iosApp.xcodeproj/project.pbxproj index ce77d0e217..3543f7fa83 100644 --- a/experimental/examples/widgets-gallery/iosApp/iosApp.xcodeproj/project.pbxproj +++ b/experimental/examples/widgets-gallery/iosApp/iosApp.xcodeproj/project.pbxproj @@ -7,47 +7,67 @@ objects = { /* Begin PBXBuildFile section */ - 2152FB042600AC8F00CF470E /* iosApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2152FB032600AC8F00CF470E /* iosApp.swift */; }; - C1FC908188C4E8695729CB06 /* Pods_iosApp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DE96E47030356CE6AD9794A /* Pods_iosApp.framework */; }; + 2152FB042600AC8F00CF470E /* iOSApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2152FB032600AC8F00CF470E /* iOSApp.swift */; }; + 7555FF83242A565900829871 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7555FF82242A565900829871 /* ContentView.swift */; }; + CFDB58B53BB94DE262B13C24 /* Pods_iosApp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6B1049432C0C2B312090ABF6 /* Pods_iosApp.framework */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 1EB65E27D2C0F884D0A1A133 /* Pods-iosApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosApp.debug.xcconfig"; path = "Target Support Files/Pods-iosApp/Pods-iosApp.debug.xcconfig"; sourceTree = ""; }; - 2152FB032600AC8F00CF470E /* iosApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iosApp.swift; sourceTree = ""; }; - 3D7A606AB0AD7636269BD9D0 /* Pods-iosApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosApp.release.xcconfig"; path = "Target Support Files/Pods-iosApp/Pods-iosApp.release.xcconfig"; sourceTree = ""; }; - 7555FF7B242A565900829871 /* WidgetsGallery.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WidgetsGallery.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 058557BA273AAA24004C7B11 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 2152FB032600AC8F00CF470E /* iOSApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOSApp.swift; sourceTree = ""; }; + 4FF3202A603A284706412EDC /* Pods-iosApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosApp.debug.xcconfig"; path = "Target Support Files/Pods-iosApp/Pods-iosApp.debug.xcconfig"; sourceTree = ""; }; + 6B1049432C0C2B312090ABF6 /* Pods_iosApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_iosApp.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 7555FF7B242A565900829871 /* iosApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iosApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 7555FF82242A565900829871 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 7555FF8C242A565B00829871 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 8DE96E47030356CE6AD9794A /* Pods_iosApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_iosApp.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - AB3632DC29227652001CCB65 /* TeamId.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = TeamId.xcconfig; sourceTree = ""; }; + AB3632DC29227652001CCB65 /* Config.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Config.xcconfig; sourceTree = ""; }; + FF8CA3F5360CEAB49D74065F /* Pods-iosApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosApp.release.xcconfig"; path = "Target Support Files/Pods-iosApp/Pods-iosApp.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 9964867F0862B4D9FB6ABFC7 /* Frameworks */ = { + F85CB1118929364A9C6EFABC /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C1FC908188C4E8695729CB06 /* Pods_iosApp.framework in Frameworks */, + CFDB58B53BB94DE262B13C24 /* Pods_iosApp.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 058557D7273AAEEB004C7B11 /* Preview Content */ = { + isa = PBXGroup; + children = ( + 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + 42799AB246E5F90AF97AA0EF /* Frameworks */ = { + isa = PBXGroup; + children = ( + 6B1049432C0C2B312090ABF6 /* Pods_iosApp.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; 7555FF72242A565900829871 = { isa = PBXGroup; children = ( AB1DB47929225F7C00F7AF9C /* Configuration */, 7555FF7D242A565900829871 /* iosApp */, 7555FF7C242A565900829871 /* Products */, - E1DAFBE8E1CFC0878361EF0E /* Pods */, - B62309C7396AD7BF607A63B2 /* Frameworks */, + FEFF387C0A8D172AA4D59CAE /* Pods */, + 42799AB246E5F90AF97AA0EF /* Frameworks */, ); sourceTree = ""; }; 7555FF7C242A565900829871 /* Products */ = { isa = PBXGroup; children = ( - 7555FF7B242A565900829871 /* WidgetsGallery.app */, + 7555FF7B242A565900829871 /* iosApp.app */, ); name = Products; sourceTree = ""; @@ -55,8 +75,11 @@ 7555FF7D242A565900829871 /* iosApp */ = { isa = PBXGroup; children = ( + 058557BA273AAA24004C7B11 /* Assets.xcassets */, + 7555FF82242A565900829871 /* ContentView.swift */, 7555FF8C242A565B00829871 /* Info.plist */, - 2152FB032600AC8F00CF470E /* iosApp.swift */, + 2152FB032600AC8F00CF470E /* iOSApp.swift */, + 058557D7273AAEEB004C7B11 /* Preview Content */, ); path = iosApp; sourceTree = ""; @@ -64,24 +87,16 @@ AB1DB47929225F7C00F7AF9C /* Configuration */ = { isa = PBXGroup; children = ( - AB3632DC29227652001CCB65 /* TeamId.xcconfig */, + AB3632DC29227652001CCB65 /* Config.xcconfig */, ); path = Configuration; sourceTree = ""; }; - B62309C7396AD7BF607A63B2 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 8DE96E47030356CE6AD9794A /* Pods_iosApp.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - E1DAFBE8E1CFC0878361EF0E /* Pods */ = { + FEFF387C0A8D172AA4D59CAE /* Pods */ = { isa = PBXGroup; children = ( - 1EB65E27D2C0F884D0A1A133 /* Pods-iosApp.debug.xcconfig */, - 3D7A606AB0AD7636269BD9D0 /* Pods-iosApp.release.xcconfig */, + 4FF3202A603A284706412EDC /* Pods-iosApp.debug.xcconfig */, + FF8CA3F5360CEAB49D74065F /* Pods-iosApp.release.xcconfig */, ); path = Pods; sourceTree = ""; @@ -93,11 +108,11 @@ isa = PBXNativeTarget; buildConfigurationList = 7555FFA5242A565B00829871 /* Build configuration list for PBXNativeTarget "iosApp" */; buildPhases = ( - E8D673591E7196AEA2EA10E2 /* [CP] Check Pods Manifest.lock */, + 98D614C51D2DA07C614CC46E /* [CP] Check Pods Manifest.lock */, 7555FF77242A565900829871 /* Sources */, 7555FF79242A565900829871 /* Resources */, - 9964867F0862B4D9FB6ABFC7 /* Frameworks */, - CBBA0A6E6533DD46A6901419 /* [CP] Copy Pods Resources */, + F85CB1118929364A9C6EFABC /* Frameworks */, + 57B00ABD2F9FD565E2B9F147 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -105,7 +120,7 @@ ); name = iosApp; productName = iosApp; - productReference = 7555FF7B242A565900829871 /* WidgetsGallery.app */; + productReference = 7555FF7B242A565900829871 /* iosApp.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ @@ -116,7 +131,7 @@ attributes = { LastSwiftUpdateCheck = 1130; LastUpgradeCheck = 1130; - ORGANIZATIONNAME = org.jetbrains; + ORGANIZATIONNAME = orgName; TargetAttributes = { 7555FF7A242A565900829871 = { CreatedOnToolsVersion = 11.3.1; @@ -152,7 +167,7 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - CBBA0A6E6533DD46A6901419 /* [CP] Copy Pods Resources */ = { + 57B00ABD2F9FD565E2B9F147 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -169,7 +184,7 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-resources.sh\"\n"; showEnvVarsInLog = 0; }; - E8D673591E7196AEA2EA10E2 /* [CP] Check Pods Manifest.lock */ = { + 98D614C51D2DA07C614CC46E /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -198,7 +213,8 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 2152FB042600AC8F00CF470E /* iosApp.swift in Sources */, + 2152FB042600AC8F00CF470E /* iOSApp.swift in Sources */, + 7555FF83242A565900829871 /* ContentView.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -207,7 +223,7 @@ /* Begin XCBuildConfiguration section */ 7555FFA3242A565B00829871 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = AB3632DC29227652001CCB65 /* TeamId.xcconfig */; + baseConfigurationReference = AB3632DC29227652001CCB65 /* Config.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -269,7 +285,7 @@ }; 7555FFA4242A565B00829871 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = AB3632DC29227652001CCB65 /* TeamId.xcconfig */; + baseConfigurationReference = AB3632DC29227652001CCB65 /* Config.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -325,12 +341,12 @@ }; 7555FFA6242A565B00829871 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 1EB65E27D2C0F884D0A1A133 /* Pods-iosApp.debug.xcconfig */; + baseConfigurationReference = 4FF3202A603A284706412EDC /* Pods-iosApp.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_ASSET_PATHS = ""; + DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\""; DEVELOPMENT_TEAM = "${TEAM_ID}"; ENABLE_PREVIEWS = YES; INFOPLIST_FILE = iosApp/Info.plist; @@ -339,8 +355,8 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = "org.jetbrains.WidgetsGallery${TEAM_ID}"; - PRODUCT_NAME = "WidgetsGallery"; + PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}${TEAM_ID}"; + PRODUCT_NAME = "${APP_NAME}"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -349,12 +365,12 @@ }; 7555FFA7242A565B00829871 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 3D7A606AB0AD7636269BD9D0 /* Pods-iosApp.release.xcconfig */; + baseConfigurationReference = FF8CA3F5360CEAB49D74065F /* Pods-iosApp.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_ASSET_PATHS = ""; + DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\""; DEVELOPMENT_TEAM = "${TEAM_ID}"; ENABLE_PREVIEWS = YES; INFOPLIST_FILE = iosApp/Info.plist; @@ -363,8 +379,8 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = "org.jetbrains.WidgetsGallery${TEAM_ID}"; - PRODUCT_NAME = "WidgetsGallery"; + PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}${TEAM_ID}"; + PRODUCT_NAME = "${APP_NAME}"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; diff --git a/experimental/examples/widgets-gallery/iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json b/experimental/examples/widgets-gallery/iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000000..ee7e3ca03f --- /dev/null +++ b/experimental/examples/widgets-gallery/iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} \ No newline at end of file diff --git a/experimental/examples/widgets-gallery/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json b/experimental/examples/widgets-gallery/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000000..fb88a396bf --- /dev/null +++ b/experimental/examples/widgets-gallery/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} \ No newline at end of file diff --git a/experimental/examples/widgets-gallery/iosApp/iosApp/Assets.xcassets/Contents.json b/experimental/examples/widgets-gallery/iosApp/iosApp/Assets.xcassets/Contents.json new file mode 100644 index 0000000000..4aa7c5350b --- /dev/null +++ b/experimental/examples/widgets-gallery/iosApp/iosApp/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} \ No newline at end of file diff --git a/experimental/examples/widgets-gallery/iosApp/iosApp/ContentView.swift b/experimental/examples/widgets-gallery/iosApp/iosApp/ContentView.swift new file mode 100644 index 0000000000..f7f6457b31 --- /dev/null +++ b/experimental/examples/widgets-gallery/iosApp/iosApp/ContentView.swift @@ -0,0 +1,21 @@ +import UIKit +import SwiftUI +import shared + +struct ComposeView: UIViewControllerRepresentable { + func makeUIViewController(context: Context) -> UIViewController { + Main_iosKt.MainViewController() + } + + func updateUIViewController(_ uiViewController: UIViewController, context: Context) {} +} + +struct ContentView: View { + var body: some View { + ComposeView() + .ignoresSafeArea(.keyboard) // Compose has own keyboard handler + } +} + + + diff --git a/experimental/examples/widgets-gallery/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json b/experimental/examples/widgets-gallery/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 0000000000..4aa7c5350b --- /dev/null +++ b/experimental/examples/widgets-gallery/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} \ No newline at end of file diff --git a/experimental/examples/widgets-gallery/iosApp/iosApp/iOSApp.swift b/experimental/examples/widgets-gallery/iosApp/iosApp/iOSApp.swift new file mode 100644 index 0000000000..0648e8602f --- /dev/null +++ b/experimental/examples/widgets-gallery/iosApp/iosApp/iOSApp.swift @@ -0,0 +1,10 @@ +import SwiftUI + +@main +struct iOSApp: App { + var body: some Scene { + WindowGroup { + ContentView() + } + } +} \ No newline at end of file diff --git a/experimental/examples/widgets-gallery/iosApp/iosApp/iosApp.swift b/experimental/examples/widgets-gallery/iosApp/iosApp/iosApp.swift deleted file mode 100644 index 0f563c50c9..0000000000 --- a/experimental/examples/widgets-gallery/iosApp/iosApp/iosApp.swift +++ /dev/null @@ -1,15 +0,0 @@ -import UIKit -import shared - -@main -class AppDelegate: UIResponder, UIApplicationDelegate { - var window: UIWindow? - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - window = UIWindow(frame: UIScreen.main.bounds) - let mainViewController = Main_iosKt.MainViewController() - window?.rootViewController = mainViewController - window?.makeKeyAndVisible() - return true - } -} diff --git a/experimental/examples/widgets-gallery/shared/build.gradle.kts b/experimental/examples/widgets-gallery/shared/build.gradle.kts index 701c661983..1179c0907e 100644 --- a/experimental/examples/widgets-gallery/shared/build.gradle.kts +++ b/experimental/examples/widgets-gallery/shared/build.gradle.kts @@ -1,3 +1,5 @@ +@file:Suppress("OPT_IN_IS_NOT_ENABLED") + plugins { kotlin("multiplatform") kotlin("native.cocoapods") @@ -34,24 +36,21 @@ kotlin { implementation(compose.foundation) implementation(compose.material) implementation(compose.materialIconsExtended) - implementation("org.jetbrains.compose.components:components-resources:1.4.0-alpha01-dev942") + @OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class) + implementation(compose.components.resources) } } val androidMain by getting { dependencies { - implementation("androidx.appcompat:appcompat:1.5.1") - implementation("androidx.core:core-ktx:1.8.0") + api("androidx.activity:activity-compose:1.6.1") + api("androidx.appcompat:appcompat:1.6.1") + api("androidx.core:core-ktx:1.9.0") } } val iosMain by getting - val iosTest by getting val iosSimulatorArm64Main by getting { dependsOn(iosMain) } - val iosSimulatorArm64Test by getting { - dependsOn(iosTest) - } - val desktopMain by getting { dependencies { implementation(compose.desktop.common) @@ -63,13 +62,15 @@ kotlin { android { compileSdk = 33 sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml") + sourceSets["main"].res.srcDirs("src/androidMain/res") sourceSets["main"].resources.srcDirs("src/commonMain/resources") + defaultConfig { - minSdk = 24 + minSdk = 26 targetSdk = 33 } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } } diff --git a/experimental/examples/widgets-gallery/shared/src/iosMain/kotlin/org/jetbrains/compose/demo/widgets/platform/main.ios.kt b/experimental/examples/widgets-gallery/shared/src/iosMain/kotlin/org/jetbrains/compose/demo/widgets/platform/main.ios.kt index 06d4a6836b..4fa782a91e 100644 --- a/experimental/examples/widgets-gallery/shared/src/iosMain/kotlin/org/jetbrains/compose/demo/widgets/platform/main.ios.kt +++ b/experimental/examples/widgets-gallery/shared/src/iosMain/kotlin/org/jetbrains/compose/demo/widgets/platform/main.ios.kt @@ -5,23 +5,8 @@ package org.jetbrains.compose.demo.widgets.platform -import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.height -import androidx.compose.ui.Modifier -import androidx.compose.ui.unit.dp -import androidx.compose.ui.window.Application +import androidx.compose.ui.window.ComposeUIViewController import org.jetbrains.compose.demo.widgets.ui.MainView import platform.UIKit.UIViewController -fun MainViewController() : UIViewController = - Application("WidgetsGallery") { - Column { - // To skip upper part of screen. - Box( - modifier = Modifier - .height(30.dp) - ) - MainView() - } - } +fun MainViewController() : UIViewController = ComposeUIViewController { MainView() } \ No newline at end of file