diff --git a/.gitignore b/.gitignore index fca62f6..6ff1dde 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ xcuserdata/ Pods/ *.jks *yarn.lock +/.kotlin diff --git a/build.gradle.kts b/build.gradle.kts index d58c567..cfffe71 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,6 @@ plugins { alias(libs.plugins.multiplatform).apply(false) + alias(libs.plugins.compose.compiler).apply(false) alias(libs.plugins.compose).apply(false) alias(libs.plugins.cocoapods).apply(false) alias(libs.plugins.android.application).apply(false) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 57d802c..0a5d1fe 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,17 +1,17 @@ [versions] kronos = "0.0.1" lyft-kronos = "0.0.1-alpha11" -kotlin = "1.9.0" -agp = "8.1.0" -compose = "1.5.0-rc01" -androidx-appcompat = "1.6.1" -androidx-activityCompose = "1.7.2" -androidx-test = "1.5.0" -compose-uitooling = "1.5.0" -napier = "2.6.1" -kotlinx-coroutines = "1.7.3" -kotlinx-datetime = "0.4.0" -swift-klib = "0.2.1" +kotlin = "2.0.21" +agp = "8.7.2" +compose = "1.7.1" +androidx-appcompat = "1.7.0" +androidx-activityCompose = "1.9.3" +androidx-test = "1.6.1" +compose-uitooling = "1.7.5" +napier = "2.7.1" +kotlinx-coroutines = "1.9.0" +kotlinx-datetime = "0.6.1" +swift-klib = "0.6.4" [libraries] kronos = { module = "io.github.softartdev:kronos", version.ref = "kronos" } @@ -30,6 +30,7 @@ kotlinx-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version. [plugins] multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } cocoapods = { id = "org.jetbrains.kotlin.native.cocoapods", version.ref = "kotlin" } +compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } compose = { id = "org.jetbrains.compose", version.ref = "compose" } android-application = { id = "com.android.application", version.ref = "agp" } android-library = { id = "com.android.library", version.ref = "agp" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f5b296d..e9aa8ba 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,8 @@ -#Sun Aug 20 02:04:34 GET 2023 +#Sun Nov 24 21:32:10 GET 2024 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/iosApp/Podfile.lock b/iosApp/Podfile.lock index c7f8770..d76c12a 100644 --- a/iosApp/Podfile.lock +++ b/iosApp/Podfile.lock @@ -9,7 +9,7 @@ EXTERNAL SOURCES: :path: "../sampleApp" SPEC CHECKSUMS: - sampleApp: f9d38db31c891574361846981da83fb394e5f331 + sampleApp: 74ffcffb09857e525c843f48fcd5511e65e94800 PODFILE CHECKSUM: 31aecb1c889393f7cb5f9aac6f63f896eb049a8e diff --git a/iosApp/iosApp.xcodeproj/project.pbxproj b/iosApp/iosApp.xcodeproj/project.pbxproj index c487cce..1f1497d 100644 --- a/iosApp/iosApp.xcodeproj/project.pbxproj +++ b/iosApp/iosApp.xcodeproj/project.pbxproj @@ -16,6 +16,7 @@ /* Begin PBXFileReference section */ 05E67C72B2BDBC81379103CB /* 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 = ""; }; 73FFDDCA9C728FEE3DFEF2F4 /* 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 = ""; }; + 751C49B92CF2A16F00D81888 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; A93A953729CC810C00F8E227 /* Kronos Multiplatform.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Kronos Multiplatform.app"; sourceTree = BUILT_PRODUCTS_DIR; }; A93A953A29CC810C00F8E227 /* iosApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iosApp.swift; sourceTree = ""; }; A93A953E29CC810D00F8E227 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; @@ -65,6 +66,7 @@ A93A953929CC810C00F8E227 /* iosApp */ = { isa = PBXGroup; children = ( + 751C49B92CF2A16F00D81888 /* Info.plist */, A93A953A29CC810C00F8E227 /* iosApp.swift */, A93A953E29CC810D00F8E227 /* Assets.xcassets */, A93A954029CC810D00F8E227 /* Preview Content */, @@ -334,6 +336,7 @@ DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\""; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = iosApp/Info.plist; INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchScreen_Generation = YES; @@ -363,6 +366,7 @@ DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\""; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = iosApp/Info.plist; INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchScreen_Generation = YES; diff --git a/iosApp/iosApp/Info.plist b/iosApp/iosApp/Info.plist new file mode 100644 index 0000000..11845e1 --- /dev/null +++ b/iosApp/iosApp/Info.plist @@ -0,0 +1,8 @@ + + + + + CADisableMinimumFrameDurationOnPhone + + + diff --git a/kronos/src/iosMain/kotlin/com/softartdev/kronos/IosNetworkClock.kt b/kronos/src/iosMain/kotlin/com/softartdev/kronos/IosNetworkClock.kt index a2ce4a2..5eb115a 100644 --- a/kronos/src/iosMain/kotlin/com/softartdev/kronos/IosNetworkClock.kt +++ b/kronos/src/iosMain/kotlin/com/softartdev/kronos/IosNetworkClock.kt @@ -1,5 +1,8 @@ +@file:OptIn(ExperimentalForeignApi::class) + package com.softartdev.kronos +import kotlinx.cinterop.ExperimentalForeignApi import platform.Foundation.NSDate import platform.Foundation.NSNumber import platform.Foundation.timeIntervalSince1970 diff --git a/sampleApp/build.gradle.kts b/sampleApp/build.gradle.kts index 64deb14..342f13d 100644 --- a/sampleApp/build.gradle.kts +++ b/sampleApp/build.gradle.kts @@ -5,6 +5,7 @@ import org.jetbrains.compose.desktop.application.dsl.TargetFormat plugins { alias(libs.plugins.multiplatform) + alias(libs.plugins.compose.compiler) alias(libs.plugins.compose) alias(libs.plugins.cocoapods) alias(libs.plugins.android.application) @@ -14,13 +15,7 @@ group = "com.softartdev.kronos.sample" kotlin { jvmToolchain(11) jvm("desktop") - android { - compilations.all { - kotlinOptions { - jvmTarget = "11" - } - } - } + androidTarget() iosX64() iosArm64() iosSimulatorArm64() diff --git a/sampleApp/sampleApp.podspec b/sampleApp/sampleApp.podspec index 3dfd1f7..4acdf66 100644 --- a/sampleApp/sampleApp.podspec +++ b/sampleApp/sampleApp.podspec @@ -8,9 +8,24 @@ Pod::Spec.new do |spec| spec.summary = 'Compose application framework' spec.vendored_frameworks = 'build/cocoapods/framework/ComposeApp.framework' spec.libraries = 'c++' - spec.ios.deployment_target = '14.1' + spec.ios.deployment_target = '14.1' + if !Dir.exist?('build/cocoapods/framework/ComposeApp.framework') || Dir.empty?('build/cocoapods/framework/ComposeApp.framework') + raise " + + Kotlin framework 'ComposeApp' doesn't exist yet, so a proper Xcode project can't be generated. + 'pod install' should be executed after running ':generateDummyFramework' Gradle task: + + ./gradlew :sampleApp:generateDummyFramework + + Alternatively, proper pod installation is performed during Gradle sync in the IDE (if Podfile location is set)" + end + + spec.xcconfig = { + 'ENABLE_USER_SCRIPT_SANDBOXING' => 'NO', + } + spec.pod_target_xcconfig = { 'KOTLIN_PROJECT_PATH' => ':sampleApp', 'PRODUCT_MODULE_NAME' => 'ComposeApp', @@ -35,5 +50,5 @@ Pod::Spec.new do |spec| SCRIPT } ] - spec.resources = ['build/compose/ios/ComposeApp/compose-resources'] + spec.resources = ['build/compose/cocoapods/compose-resources'] end \ No newline at end of file