Browse Source

Components. Downgrade to Kotlin 1.8.22 (#3390)

Dowgrading to Kotlin 1.8 will allow to use `components` in Kotlin 1.8 and Kotlin 1.9 projects (iOS, JS targets). Now it is supported only in Kotlin 1.9 projects.
release/1.4.2
Igor Demin 1 year ago committed by Igor Demin
parent
commit
d2b7936b18
  1. 2
      components/gradle.properties
  2. 2
      components/resources/library/src/iosMain/kotlin/org/jetbrains/compose/resources/Resource.ios.kt
  3. 2
      components/resources/library/src/macosMain/kotlin/org/jetbrains/compose/resources/Resource.macos.kt

2
components/gradle.properties

@ -3,7 +3,7 @@ android.useAndroidX=true
android.enableJetifier=true
kotlin.code.style=official
# __KOTLIN_COMPOSE_VERSION__
kotlin.version=1.9.0
kotlin.version=1.8.22
# __LATEST_COMPOSE_RELEASE_VERSION__
compose.version=1.5.0-dev1112
agp.version=7.3.1

2
components/resources/library/src/iosMain/kotlin/org/jetbrains/compose/resources/Resource.ios.kt

@ -5,7 +5,6 @@
package org.jetbrains.compose.resources
import kotlinx.cinterop.ExperimentalForeignApi
import kotlinx.cinterop.addressOf
import kotlinx.cinterop.usePinned
import platform.Foundation.NSBundle
@ -18,7 +17,6 @@ actual fun resource(path: String): Resource = UIKitResourceImpl(path)
@ExperimentalResourceApi
private class UIKitResourceImpl(path: String) : AbstractResourceImpl(path) {
@OptIn(ExperimentalForeignApi::class)
override suspend fun readBytes(): ByteArray {
val absolutePath = NSBundle.mainBundle.resourcePath + "/" + path
val contentsAtPath: NSData? = NSFileManager.defaultManager().contentsAtPath(absolutePath)

2
components/resources/library/src/macosMain/kotlin/org/jetbrains/compose/resources/Resource.macos.kt

@ -5,7 +5,6 @@
package org.jetbrains.compose.resources
import kotlinx.cinterop.ExperimentalForeignApi
import kotlinx.cinterop.addressOf
import kotlinx.cinterop.usePinned
import platform.Foundation.NSData
@ -17,7 +16,6 @@ actual fun resource(path: String): Resource = MacOSResourceImpl(path)
@ExperimentalResourceApi
private class MacOSResourceImpl(path: String) : AbstractResourceImpl(path) {
@OptIn(ExperimentalForeignApi::class)
override suspend fun readBytes(): ByteArray {
val currentDirectoryPath = NSFileManager.defaultManager().currentDirectoryPath
val contentsAtPath: NSData? = NSFileManager.defaultManager().run {

Loading…
Cancel
Save