Skip to content

Commit

Permalink
Show file tree
Hide file tree
Showing 28 changed files with 56 additions and 44 deletions.
4 changes: 3 additions & 1 deletion VERSIONING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion ci/compose-uber-jar/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
compose.version=1.4.1
compose.version=1.4.3
kotlin.code.style=official
4 changes: 2 additions & 2 deletions ci/templates/desktop-template/gradle.properties
Original file line number Diff line number Diff line change
@@ -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 changes: 2 additions & 2 deletions ci/templates/html-library-template/gradle.properties
Original file line number Diff line number Diff line change
@@ -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 changes: 2 additions & 2 deletions ci/templates/multiplatform-template/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 2 additions & 2 deletions examples/chat/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 2 additions & 2 deletions examples/codeviewer/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 2 additions & 2 deletions examples/falling-balls/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 2 additions & 2 deletions examples/html/compose-bird/gradle.properties
Original file line number Diff line number Diff line change
@@ -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 changes: 2 additions & 2 deletions examples/html/compose-in-js/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 2 additions & 2 deletions examples/html/landing/gradle.properties
Original file line number Diff line number Diff line change
@@ -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 changes: 2 additions & 2 deletions examples/html/with-react/gradle.properties
Original file line number Diff line number Diff line change
@@ -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 changes: 2 additions & 2 deletions examples/imageviewer/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -41,6 +42,7 @@ class IosStorableImage(

actual typealias PlatformStorableImage = IosStorableImage

@OptIn(ExperimentalForeignApi::class)
actual fun createUUID(): String =
CFBridgingRelease(CFUUIDCreateString(null, CFUUIDCreate(null))) as String

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@file:OptIn(ExperimentalForeignApi::class)

package example.imageviewer.storage

import kotlinx.cinterop.*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -122,6 +123,7 @@ class IosImageStorage(
}
}

@OptIn(ExperimentalForeignApi::class)
private fun UIImage.fitInto(px: Int): UIImage {
val targetScale = maxOf(
px.toFloat() / size.useContents { width },
Expand All @@ -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 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.*
Expand Down Expand Up @@ -121,6 +122,7 @@ private fun BoxScope.AuthorizedCamera(
}
}

@OptIn(ExperimentalForeignApi::class)
@Composable
private fun BoxScope.RealDeviceCamera(
camera: AVCaptureDevice,
Expand Down Expand Up @@ -272,6 +274,7 @@ private fun BoxScope.RealDeviceCamera(
}
}

@OptIn(ExperimentalForeignApi::class)
fun CLLocation.toGps() =
GpsPosition(
latitude = coordinate.useContents { latitude },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions examples/intellij-plugin/gradle.properties
Original file line number Diff line number Diff line change
@@ -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 changes: 2 additions & 2 deletions examples/issues/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 2 additions & 2 deletions examples/minesweeper/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 2 additions & 2 deletions examples/notepad/gradle.properties
Original file line number Diff line number Diff line change
@@ -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 changes: 2 additions & 2 deletions examples/todoapp-lite/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 2 additions & 2 deletions examples/todoapp/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 2 additions & 2 deletions examples/visual-effects/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 2 additions & 2 deletions examples/widgets-gallery/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 0 additions & 2 deletions tools/replaceVersion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
4 changes: 2 additions & 2 deletions tutorials/HTML/Getting_Started/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 43a4086

Please sign in to comment.