Skip to content

Commit 3255d12

Browse files
authored
[RKOTLIN-986] K2 Support (#1764)
1 parent 80bcec4 commit 3255d12

File tree

77 files changed

+661
-1580
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+661
-1580
lines changed

.github/actions/run-android-device-farm-test/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,4 @@ runs:
7878
7979
shell: pwsh
8080
if: always()
81-
name: Device Farm Output
81+
name: Device Farm Output

.github/workflows/include-integration-tests.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -200,19 +200,13 @@ jobs:
200200
gradle-plugin-integration:
201201
strategy:
202202
matrix:
203-
type: [current, currentK2, gradle6, gradle71, gradle75]
203+
type: [current, gradle72, gradle75]
204204
include:
205205
- type: current
206206
path: integration-tests/gradle/current
207207
arguments: integrationTest
208-
- type: currentK2
209-
path: integration-tests/gradle/current
210-
arguments: -Pkotlin.experimental.tryK2=true integrationTest
211-
- type: gradle6
212-
path: integration-tests/gradle/gradle6-test
213-
arguments: integrationTest
214-
- type: gradle71
215-
path: integration-tests/gradle/gradle71-test
208+
- type: gradle72
209+
path: integration-tests/gradle/gradle72-test
216210
arguments: integrationTest
217211
- type: gradle75
218212
path: integration-tests/gradle/gradle75-test
@@ -290,11 +284,14 @@ jobs:
290284
gradle-plugin-integration-java-17:
291285
strategy:
292286
matrix:
293-
type: [gradle8]
287+
type: [gradle8, gradle85]
294288
include:
295289
- type: gradle8
296290
path: integration-tests/gradle/gradle8-test
297291
arguments: integrationTest
292+
- type: gradle85
293+
path: integration-tests/gradle/gradle85-test
294+
arguments: integrationTest
298295
runs-on: macos-12
299296
steps:
300297
- uses: actions/checkout@v3

.github/workflows/pr.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,7 +1643,7 @@ jobs:
16431643
endsWith(needs.check-cache.outputs.version-label, '-SNAPSHOT') &&
16441644
!contains(needs.*.result, 'failure') &&
16451645
!contains(needs.*.result, 'cancelled') &&
1646-
(github.ref == 'refs/heads/main' || github.ref == 'refs/heads/releases')
1646+
(github.ref == 'refs/heads/main' || github.ref == 'refs/heads/releases' || github.ref == 'refs/heads/release/k2')
16471647
16481648
secrets: inherit
16491649
with:
@@ -1706,10 +1706,10 @@ jobs:
17061706
!endsWith(needs.check-cache.outputs.version-label, '-SNAPSHOT') &&
17071707
!contains(needs.*.result, 'failure') &&
17081708
!contains(needs.*.result, 'cancelled') &&
1709-
(github.ref == 'refs/heads/main' || github.ref == 'refs/heads/releases') &&
1709+
(github.ref == 'refs/heads/main' || github.ref == 'refs/heads/releases' || github.ref == 'refs/heads/release/k2') &&
17101710
(needs.check-release-build.outputs.is_publish_build == 'true')
17111711
17121712
secrets: inherit
17131713
with:
17141714
version-label: ${{ needs.check-cache.outputs.version-label }}
1715-
packages-sha-label: ${{ needs.check-cache.outputs.packages-sha }}
1715+
packages-sha-label: ${{ needs.check-cache.outputs.packages-sha }}

CHANGELOG.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,23 @@ This release will bump the Realm file format 24. Opening a file with an older fo
2828
* File format: Generates Realms with file format v24 (reads and upgrades file format v10 or later).
2929
* Realm Studio 15.0.0 or above is required to open Realms created by this version.
3030
* This release is compatible with the following Kotlin releases:
31-
* Kotlin 1.9.0 and above. Support for experimental K2-compilation with `kotlin.experimental.tryK2=true`.
31+
* Kotlin 2.0.0 and above. Support for experimental K2-compilation with `kotlin.experimental.tryK2=true`.
3232
* Ktor 2.1.2 and above.
3333
* Coroutines 1.7.0 and above.
3434
* AtomicFu 0.18.3 and above.
3535
* The new memory model only. See https://github.com/realm/realm-kotlin#kotlin-memory-model-and-coroutine-compatibility
36-
* Minimum Kbson 0.3.0.
37-
* Minimum Gradle version: 6.8.3.
38-
* Minimum Android Gradle Plugin version: 4.1.3.
36+
* Minimum Kbson 0.4.0.
37+
* Minimum Gradle version: 7.2.
38+
* Minimum Android Gradle Plugin version: 7.1.3.
3939
* Minimum Android SDK: 16.
4040
* Minimum R8: 8.0.34.
4141

4242
### Internal
4343
* Updated to Realm Core 14.7.0 commit c280bdb17522323d5c30dc32a2b9efc9dc80ca3b.
44+
* Changed Kotlin compiler testing framework to https://github.com/zacsweers/kotlin-compile-testing
45+
46+
47+
## 1.16.0 (2024-05-01)
4448

4549

4650
## 1.16.0 (2024-05-01)

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,10 @@ SDK supports. In the matrix below, you will find the minimum supported version f
328328

329329
| Realm Version | Requirements |
330330
|---------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
331+
| 2.0.0 | <ul><li>Kotlin 2.0.0+</li><li>AtomicFu 0.18.3+.</li><li>Ktor 2.1.2+.</li><li>Coroutines 1.7.0+.</li><li>Gradle 7.2 - 8.5</li><li>The new memory model only.</li></ul> |
332+
| 1.16.0 | <ul><li>Kotlin 1.9.0+</li><li>AtomicFu 0.18.3+.</li><li>Ktor 2.1.2+.</li><li>Coroutines 1.7.0+.</li><li>Gradle 6.8.3 - 8.5</li><li>The new memory model only.</li></ul> |
333+
| 1.15.0 | <ul><li>Kotlin 1.9.0+</li><li>AtomicFu 0.18.3+.</li><li>Ktor 2.1.2+.</li><li>Coroutines 1.7.0+.</li><li>Gradle 6.8.3 - 8.5</li><li>The new memory model only.</li></ul> |
334+
| 1.14.0 | <ul><li>Kotlin 1.9.0+</li><li>AtomicFu 0.18.3+.</li><li>Ktor 2.1.2+.</li><li>Coroutines 1.7.0+.</li><li>Gradle 6.8.3 - 8.5</li><li>The new memory model only.</li></ul> |
331335
| 1.13.0 | <ul><li>Kotlin 1.9.0+</li><li>AtomicFu 0.18.3+.</li><li>Ktor 2.1.2+.</li><li>Coroutines 1.7.0+.</li><li>Gradle 6.8.3 - 8.5</li><li>The new memory model only.</li></ul> |
332336
| 1.12.0 | <ul><li>Kotlin 1.8.20+</li><li>AtomicFu 0.18.3+.</li><li>Ktor 2.1.2+.</li><li>Coroutines 1.7.0+.</li><li>Gradle 6.8.3 - 7.6.1.</li><li>The new memory model only.</li></ul> |
333337
| 1.11.0 | <ul><li>Kotlin 1.8.0+</li><li>AtomicFu 0.18.3+.</li><li>Ktor 2.1.2+.</li><li>Coroutines 1.7.0+.</li><li>Gradle 6.8.3 - 7.6.1.</li><li>The new memory model only.</li></ul> |

benchmarks/gradle.properties

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,3 @@ kotlin.code.style=official
66

77
#Android
88
android.useAndroidX=true
9-
10-
#MPP
11-
kotlin.mpp.enableGranularSourceSetsMetadata=true
12-
kotlin.native.enableDependencyPropagation=false
13-
kotlin.mpp.enableCInteropCommonization=true

buildSrc/src/main/kotlin/Config.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,10 @@ object Versions {
123123
const val junit = "4.13.2" // https://mvnrepository.com/artifact/junit/junit
124124
const val kbson = "0.4.0" // https://github.com/mongodb/kbson
125125
// When updating the Kotlin version, also remember to update /examples/min-android-sample/build.gradle.kts
126-
const val kotlin = "1.9.0" // https://github.com/JetBrains/kotlin and https://kotlinlang.org/docs/releases.html#release-details
126+
const val kotlin = "2.0.0" // https://github.com/JetBrains/kotlin and https://kotlinlang.org/docs/releases.html#release-details
127127
const val kotlinJvmTarget = "1.8" // Which JVM bytecode version is kotlin compiled to.
128-
const val latestKotlin = "1.9.20" // https://kotlinlang.org/docs/eap.html#build-details
129-
const val kotlinCompileTesting = "1.5.0" // https://github.com/tschuchortdev/kotlin-compile-testing
128+
const val latestKotlin = "2.0.0" // https://kotlinlang.org/docs/eap.html#build-details
129+
const val kotlinCompileTesting = "0.5.0-alpha07" // https://github.com/zacsweers/kotlin-compile-testing
130130
const val ktlint = "0.45.2" // https://github.com/pinterest/ktlint
131131
const val ktor = "2.3.7" // https://github.com/ktorio/ktor
132132
const val multidex = "2.0.1" // https://developer.android.com/jetpack/androidx/releases/multidex

examples/min-android-sample/app/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ dependencies {
2727
implementation(project(":shared"))
2828
implementation("com.android.support:appcompat-v7:28.0.0")
2929
implementation("com.android.support.constraint:constraint-layout:2.0.4")
30-
}
30+
}

examples/min-android-sample/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ buildscript {
1414
mavenCentral()
1515
}
1616
dependencies {
17-
classpath("com.android.tools.build:gradle:4.2.2")
18-
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.0")
17+
classpath("com.android.tools.build:gradle:7.1.3")
18+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:2.0.0")
1919
classpath("io.realm.kotlin:gradle-plugin:${rootProject.extra["realmVersion"]}")
2020
}
2121
}

examples/min-android-sample/gradle.properties

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,3 @@ kotlin.code.style=official
1616
android.useAndroidX=true
1717

1818
org.gradle.configuration-cache=true
19-
20-
kotlin.mpp.androidSourceSetLayoutVersion=1

0 commit comments

Comments
 (0)