Browse Source

Migrate examples to 1.4.3 (#3410)

[Changelog](https://github.com/JetBrains/compose-multiplatform/releases/tag/v1.4.3)

Changed templates:
bbf71f754c
ba91acf5d6
5204842894
36d1554dee
repr_unbound_symbols_knative v1.5.0-beta01
Igor Demin 1 year ago committed by GitHub
parent
commit
43a4086ba4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      VERSIONING.md
  2. 2
      ci/compose-uber-jar/gradle.properties
  3. 4
      ci/templates/desktop-template/gradle.properties
  4. 4
      ci/templates/html-library-template/gradle.properties
  5. 4
      ci/templates/multiplatform-template/gradle.properties
  6. 4
      examples/chat/gradle.properties
  7. 4
      examples/codeviewer/gradle.properties
  8. 4
      examples/falling-balls/gradle.properties
  9. 4
      examples/html/compose-bird/gradle.properties
  10. 4
      examples/html/compose-in-js/gradle.properties
  11. 4
      examples/html/landing/gradle.properties
  12. 4
      examples/html/with-react/gradle.properties
  13. 4
      examples/imageviewer/gradle.properties
  14. 2
      examples/imageviewer/shared/src/iosMain/kotlin/example/imageviewer/platform.ios.kt
  15. 2
      examples/imageviewer/shared/src/iosMain/kotlin/example/imageviewer/storage/FileExtensions.kt
  16. 3
      examples/imageviewer/shared/src/iosMain/kotlin/example/imageviewer/storage/IosImageStorage.ios.kt
  17. 3
      examples/imageviewer/shared/src/iosMain/kotlin/example/imageviewer/view/CameraView.ios.kt
  18. 2
      examples/imageviewer/shared/src/iosMain/kotlin/example/imageviewer/view/LocationVisualizer.ios.kt
  19. 4
      examples/intellij-plugin/gradle.properties
  20. 4
      examples/issues/gradle.properties
  21. 4
      examples/minesweeper/gradle.properties
  22. 4
      examples/notepad/gradle.properties
  23. 4
      examples/todoapp-lite/gradle.properties
  24. 4
      examples/todoapp/gradle.properties
  25. 4
      examples/visual-effects/gradle.properties
  26. 4
      examples/widgets-gallery/gradle.properties
  27. 2
      tools/replaceVersion.sh
  28. 4
      tutorials/HTML/Getting_Started/README.md

4
VERSIONING.md

@ -37,7 +37,9 @@ Kotlin version | Minimal Compose version | Notes
1.8.0 | 1.3.0 | 1.3.0 is not supported by earlier k/native versions
1.8.10 | 1.3.1
1.8.20 | 1.4.0
1.8.20 | 1.4.1
1.8.21 | 1.4.3
1.8.22 | 1.4.3
1.9.0 | 1.4.3
### Using the latest Kotlin version

2
ci/compose-uber-jar/gradle.properties

@ -1,2 +1,2 @@
compose.version=1.4.1
compose.version=1.4.3
kotlin.code.style=official

4
ci/templates/desktop-template/gradle.properties

@ -1,4 +1,4 @@
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
kotlin.code.style=official
kotlin.version=1.8.20
compose.version=1.4.1
kotlin.version=1.9.0
compose.version=1.4.3

4
ci/templates/html-library-template/gradle.properties

@ -1,4 +1,4 @@
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
kotlin.code.style=official
kotlin.version=1.8.20
compose.version=1.4.1
kotlin.version=1.9.0
compose.version=1.4.3

4
ci/templates/multiplatform-template/gradle.properties

@ -2,6 +2,6 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
android.useAndroidX=true
android.enableJetifier=true
kotlin.code.style=official
kotlin.version=1.8.20
kotlin.version=1.9.0
agp.version=7.1.3
compose.version=1.4.1
compose.version=1.4.3

4
examples/chat/gradle.properties

@ -11,6 +11,6 @@ kotlin.native.useEmbeddableCompilerJar=true
kotlin.mpp.androidSourceSetLayoutVersion=2
# Enable kotlin/native experimental memory model
kotlin.native.binary.memoryModel=experimental
kotlin.version=1.8.20
kotlin.version=1.9.0
agp.version=7.1.3
compose.version=1.4.1
compose.version=1.4.3

4
examples/codeviewer/gradle.properties

@ -11,6 +11,6 @@ kotlin.native.useEmbeddableCompilerJar=true
kotlin.mpp.androidSourceSetLayoutVersion=2
# Enable kotlin/native experimental memory model
kotlin.native.binary.memoryModel=experimental
kotlin.version=1.8.20
kotlin.version=1.9.0
agp.version=7.1.3
compose.version=1.4.1
compose.version=1.4.3

4
examples/falling-balls/gradle.properties

@ -11,6 +11,6 @@ kotlin.native.useEmbeddableCompilerJar=true
kotlin.mpp.androidSourceSetLayoutVersion=2
# Enable kotlin/native experimental memory model
kotlin.native.binary.memoryModel=experimental
kotlin.version=1.8.20
kotlin.version=1.9.0
agp.version=7.1.3
compose.version=1.4.1
compose.version=1.4.3

4
examples/html/compose-bird/gradle.properties

@ -1,3 +1,3 @@
kotlin.code.style=official
kotlin.version=1.8.20
compose.version=1.4.1
kotlin.version=1.9.0
compose.version=1.4.3

4
examples/html/compose-in-js/gradle.properties

@ -2,5 +2,5 @@ kotlin.code.style=official
kotlin.mpp.enableGranularSourceSetsMetadata=true
kotlin.native.enableDependencyPropagation=false
kotlin.js.webpack.major.version=4
kotlin.version=1.8.20
compose.version=1.4.1
kotlin.version=1.9.0
compose.version=1.4.3

4
examples/html/landing/gradle.properties

@ -1,3 +1,3 @@
kotlin.code.style=official
kotlin.version=1.8.20
compose.version=1.4.1
kotlin.version=1.9.0
compose.version=1.4.3

4
examples/html/with-react/gradle.properties

@ -1,3 +1,3 @@
kotlin.code.style=official
kotlin.version=1.8.20
compose.version=1.4.1
kotlin.version=1.9.0
compose.version=1.4.3

4
examples/imageviewer/gradle.properties

@ -11,6 +11,6 @@ kotlin.mpp.androidSourceSetLayoutVersion=2
kotlin.native.useEmbeddableCompilerJar=true
# Enable kotlin/native experimental memory model
kotlin.native.binary.memoryModel=experimental
kotlin.version=1.8.20
kotlin.version=1.9.0
agp.version=7.1.3
compose.version=1.4.1
compose.version=1.4.3

2
examples/imageviewer/shared/src/iosMain/kotlin/example/imageviewer/platform.ios.kt

@ -8,6 +8,7 @@ import androidx.compose.ui.unit.Density
import androidx.compose.ui.unit.LayoutDirection
import example.imageviewer.icon.IconIosShare
import kotlinx.cinterop.useContents
import kotlinx.cinterop.ExperimentalForeignApi
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.IO
import platform.CoreFoundation.CFUUIDCreate
@ -41,6 +42,7 @@ class IosStorableImage(
actual typealias PlatformStorableImage = IosStorableImage
@OptIn(ExperimentalForeignApi::class)
actual fun createUUID(): String =
CFBridgingRelease(CFUUIDCreateString(null, CFUUIDCreate(null))) as String

2
examples/imageviewer/shared/src/iosMain/kotlin/example/imageviewer/storage/FileExtensions.kt

@ -1,3 +1,5 @@
@file:OptIn(ExperimentalForeignApi::class)
package example.imageviewer.storage
import kotlinx.cinterop.*

3
examples/imageviewer/shared/src/iosMain/kotlin/example/imageviewer/storage/IosImageStorage.ios.kt

@ -7,6 +7,7 @@ import example.imageviewer.PlatformStorableImage
import example.imageviewer.model.PictureData
import example.imageviewer.toImageBitmap
import kotlinx.cinterop.CValue
import kotlinx.cinterop.ExperimentalForeignApi
import kotlinx.cinterop.useContents
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
@ -122,6 +123,7 @@ class IosImageStorage(
}
}
@OptIn(ExperimentalForeignApi::class)
private fun UIImage.fitInto(px: Int): UIImage {
val targetScale = maxOf(
px.toFloat() / size.useContents { width },
@ -131,6 +133,7 @@ private fun UIImage.fitInto(px: Int): UIImage {
return resize(newSize)
}
@OptIn(ExperimentalForeignApi::class)
private fun UIImage.resize(targetSize: CValue<CGSize>): UIImage {
val currentSize = this.size
val widthRatio = targetSize.useContents { width } / currentSize.useContents { width }

3
examples/imageviewer/shared/src/iosMain/kotlin/example/imageviewer/view/CameraView.ios.kt

@ -18,6 +18,7 @@ import example.imageviewer.model.GpsPosition
import example.imageviewer.model.PictureData
import example.imageviewer.model.createCameraPictureData
import kotlinx.cinterop.CValue
import kotlinx.cinterop.ExperimentalForeignApi
import kotlinx.cinterop.ObjCAction
import kotlinx.cinterop.useContents
import platform.AVFoundation.*
@ -121,6 +122,7 @@ private fun BoxScope.AuthorizedCamera(
}
}
@OptIn(ExperimentalForeignApi::class)
@Composable
private fun BoxScope.RealDeviceCamera(
camera: AVCaptureDevice,
@ -272,6 +274,7 @@ private fun BoxScope.RealDeviceCamera(
}
}
@OptIn(ExperimentalForeignApi::class)
fun CLLocation.toGps() =
GpsPosition(
latitude = coordinate.useContents { latitude },

2
examples/imageviewer/shared/src/iosMain/kotlin/example/imageviewer/view/LocationVisualizer.ios.kt

@ -6,11 +6,13 @@ import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.interop.UIKitView
import example.imageviewer.model.GpsPosition
import kotlinx.cinterop.ExperimentalForeignApi
import platform.CoreLocation.CLLocationCoordinate2DMake
import platform.MapKit.MKCoordinateRegionMakeWithDistance
import platform.MapKit.MKMapView
import platform.MapKit.MKPointAnnotation
@OptIn(ExperimentalForeignApi::class)
@Composable
actual fun LocationVisualizer(
modifier: Modifier,

4
examples/intellij-plugin/gradle.properties

@ -1,3 +1,3 @@
kotlin.code.style=official
kotlin.version=1.8.20
compose.version=1.4.1
kotlin.version=1.9.0
compose.version=1.4.3

4
examples/issues/gradle.properties

@ -19,6 +19,6 @@ kotlin.code.style=official
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
kotlin.version=1.8.20
kotlin.version=1.9.0
agp.version=7.1.3
compose.version=1.4.1
compose.version=1.4.3

4
examples/minesweeper/gradle.properties

@ -11,6 +11,6 @@ kotlin.native.useEmbeddableCompilerJar=true
kotlin.mpp.androidSourceSetLayoutVersion=2
# Enable kotlin/native experimental memory model
kotlin.native.binary.memoryModel=experimental
kotlin.version=1.8.20
kotlin.version=1.9.0
agp.version=7.1.3
compose.version=1.4.1
compose.version=1.4.3

4
examples/notepad/gradle.properties

@ -1,4 +1,4 @@
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
kotlin.code.style=official
kotlin.version=1.8.20
compose.version=1.4.1
kotlin.version=1.9.0
compose.version=1.4.3

4
examples/todoapp-lite/gradle.properties

@ -11,6 +11,6 @@ kotlin.native.useEmbeddableCompilerJar=true
kotlin.mpp.androidSourceSetLayoutVersion=2
# Enable kotlin/native experimental memory model
kotlin.native.binary.memoryModel=experimental
kotlin.version=1.8.20
kotlin.version=1.9.0
agp.version=7.1.3
compose.version=1.4.1
compose.version=1.4.3

4
examples/todoapp/gradle.properties

@ -27,5 +27,5 @@ kotlin.native.disableCompilerDaemon=true
# After updating Compose Multiplatform version, update corresponding Jetpack Compose versions
# in Android module (search "Workaround for https://github.com/JetBrains/compose-jb/issues/2340")
#TODO also change version in buildSrc/gradle.properties
kotlin.version=1.8.20
compose.version=1.4.1
kotlin.version=1.9.0
compose.version=1.4.3

4
examples/visual-effects/gradle.properties

@ -11,6 +11,6 @@ kotlin.native.cacheKind=none
kotlin.native.useEmbeddableCompilerJar=true
# Enable kotlin/native experimental memory model
kotlin.native.binary.memoryModel=experimental
kotlin.version=1.8.20
kotlin.version=1.9.0
agp.version=7.1.3
compose.version=1.4.1
compose.version=1.4.3

4
examples/widgets-gallery/gradle.properties

@ -11,6 +11,6 @@ kotlin.native.useEmbeddableCompilerJar=true
kotlin.mpp.androidSourceSetLayoutVersion=2
# Enable kotlin/native experimental memory model
kotlin.native.binary.memoryModel=experimental
kotlin.version=1.8.20
kotlin.version=1.9.0
agp.version=7.1.3
compose.version=1.4.1
compose.version=1.4.3

2
tools/replaceVersion.sh

@ -8,9 +8,7 @@ ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/..
declare -a folders=(
"$ROOT/examples"
"$ROOT/gradle-plugins"
"$ROOT/components"
"$ROOT/ci"
"$ROOT/html"
"$ROOT/tutorials"
)

4
tutorials/HTML/Getting_Started/README.md

@ -36,8 +36,8 @@ pluginManagement {
``` kotlin
// Add compose gradle plugin
plugins {
kotlin("multiplatform") version "1.8.20"
id("org.jetbrains.compose") version "1.4.1"
kotlin("multiplatform") version "1.9.0"
id("org.jetbrains.compose") version "1.4.3"
}
// Add maven repositories

Loading…
Cancel
Save