Skip to content

Commit 15f5ca2

Browse files
committed
Upgrade Kotlin
Upgrade Kotlin to the latest stable version. Upgrade other dependencies like AGP at the same time.
1 parent 7bbf6bc commit 15f5ca2

File tree

6 files changed

+31
-1637
lines changed

6 files changed

+31
-1637
lines changed

docs/di.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -567,12 +567,6 @@ and generated wrong code. This ticket is [metro/997](https://github.com/ZacSweer
567567

568568
Other IC issues are reported under [KT-75865](https://youtrack.jetbrains.com/issue/KT-75865).
569569

570-
#### `exclude` / `replaces` not support
571-
572-
`kotlin-inject-anvil` allows you to exclude and replace contribution that use custom annotations like
573-
`@ContributesRenderer`. Metro is missing this feature and the generated files have to be referenced instead. The
574-
ticket is [metro/1020](https://github.com/ZacSweers/metro/issues/1020).
575-
576570
#### Missing integrations
577571

578572
Almost all App Platform specific custom extensions for `kotlin-inject-anvil` were migrated to Metro, including

gradle.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ kotlin.mpp.stability.nowarn=true
1313
kotlin.mpp.androidSourceSetLayoutVersion=2
1414
kotlin.mpp.enableCInteropCommonization=true
1515
kotlin.native.distribution.downloadFromMaven=true
16-
kotlin.native.enableKlibsCrossCompilation=true
16+
# There are sometimes build errors and the error suggests to enable this flag.
17+
kotlin.native.cacheKind.iosSimulatorArm64=none
1718

1819
ksp.useKSP2=true
1920

gradle/libs.versions.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[versions]
2-
agp = "8.12.0"
2+
agp = "8.13.0"
33
android-compileSdk = "36"
44
# https://developer.android.com/jetpack/androidx/releases/compose-ui
55
# https://maven.google.com/web/index.html#androidx.compose.ui:ui
@@ -35,7 +35,7 @@ detekt = "1.23.8"
3535
graphviz-java = "0.18.1"
3636
jvm-compatibility = "11"
3737
jvm-gradle = "17"
38-
kotlin = "2.2.10"
38+
kotlin = "2.2.20"
3939
kotlin-atomicfu = "0.29.0"
4040
kotlin-compile-testing = "0.8.0"
4141
kotlin-hierarchy = "1.1"
@@ -44,9 +44,9 @@ kotlin-inject-anvil = "0.1.6"
4444
kotlin-poet = "2.2.0"
4545
kotlinx-binaryCompatibilityValidator = "0.18.1"
4646
ktfmt-gradle = "0.23.0"
47-
ksp = "2.2.10-2.0.2"
47+
ksp = "2.2.20-2.0.2"
4848
maven-publish = "0.34.0"
49-
metro = "0.6.5"
49+
metro = "0.6.6"
5050
molecule = "2.1.0"
5151
navigation3 = "1.0.0-alpha06"
5252
#noinspection GradleDependency

kotlin-inject/public/src/commonMain/kotlin/software/amazon/app/platform/scope/di/ComponentService.kt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,7 @@ public inline fun <reified T : Any> Scope.diComponent(): T = kotlinInjectCompone
3030
*/
3131
public inline fun <reified T : Any> Scope.kotlinInjectComponent(): T {
3232
parents(includeSelf = true)
33-
.firstNotNullOfOrNull { scope ->
34-
val component = scope.getService<T>(DI_COMPONENT_KEY)
35-
if (T::class.isInstance(component)) {
36-
component
37-
} else {
38-
null
39-
}
40-
}
33+
.firstNotNullOfOrNull { scope -> scope.getService<Any>(DI_COMPONENT_KEY) as? T }
4134
?.let {
4235
return it
4336
}

0 commit comments

Comments
 (0)