Skip to content

Commit

Permalink
[RKOTLIN-986] K2 Support (#1764)
Browse files Browse the repository at this point in the history
  • Loading branch information
rorbech authored May 23, 2024
1 parent 80bcec4 commit 3255d12
Show file tree
Hide file tree
Showing 77 changed files with 661 additions and 1,580 deletions.
2 changes: 1 addition & 1 deletion .github/actions/run-android-device-farm-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@ runs:
shell: pwsh
if: always()
name: Device Farm Output
name: Device Farm Output
17 changes: 7 additions & 10 deletions .github/workflows/include-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,19 +200,13 @@ jobs:
gradle-plugin-integration:
strategy:
matrix:
type: [current, currentK2, gradle6, gradle71, gradle75]
type: [current, gradle72, gradle75]
include:
- type: current
path: integration-tests/gradle/current
arguments: integrationTest
- type: currentK2
path: integration-tests/gradle/current
arguments: -Pkotlin.experimental.tryK2=true integrationTest
- type: gradle6
path: integration-tests/gradle/gradle6-test
arguments: integrationTest
- type: gradle71
path: integration-tests/gradle/gradle71-test
- type: gradle72
path: integration-tests/gradle/gradle72-test
arguments: integrationTest
- type: gradle75
path: integration-tests/gradle/gradle75-test
Expand Down Expand Up @@ -290,11 +284,14 @@ jobs:
gradle-plugin-integration-java-17:
strategy:
matrix:
type: [gradle8]
type: [gradle8, gradle85]
include:
- type: gradle8
path: integration-tests/gradle/gradle8-test
arguments: integrationTest
- type: gradle85
path: integration-tests/gradle/gradle85-test
arguments: integrationTest
runs-on: macos-12
steps:
- uses: actions/checkout@v3
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1643,7 +1643,7 @@ jobs:
endsWith(needs.check-cache.outputs.version-label, '-SNAPSHOT') &&
!contains(needs.*.result, 'failure') &&
!contains(needs.*.result, 'cancelled') &&
(github.ref == 'refs/heads/main' || github.ref == 'refs/heads/releases')
(github.ref == 'refs/heads/main' || github.ref == 'refs/heads/releases' || github.ref == 'refs/heads/release/k2')
secrets: inherit
with:
Expand Down Expand Up @@ -1706,10 +1706,10 @@ jobs:
!endsWith(needs.check-cache.outputs.version-label, '-SNAPSHOT') &&
!contains(needs.*.result, 'failure') &&
!contains(needs.*.result, 'cancelled') &&
(github.ref == 'refs/heads/main' || github.ref == 'refs/heads/releases') &&
(github.ref == 'refs/heads/main' || github.ref == 'refs/heads/releases' || github.ref == 'refs/heads/release/k2') &&
(needs.check-release-build.outputs.is_publish_build == 'true')
secrets: inherit
with:
version-label: ${{ needs.check-cache.outputs.version-label }}
packages-sha-label: ${{ needs.check-cache.outputs.packages-sha }}
packages-sha-label: ${{ needs.check-cache.outputs.packages-sha }}
12 changes: 8 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,23 @@ This release will bump the Realm file format 24. Opening a file with an older fo
* File format: Generates Realms with file format v24 (reads and upgrades file format v10 or later).
* Realm Studio 15.0.0 or above is required to open Realms created by this version.
* This release is compatible with the following Kotlin releases:
* Kotlin 1.9.0 and above. Support for experimental K2-compilation with `kotlin.experimental.tryK2=true`.
* Kotlin 2.0.0 and above. Support for experimental K2-compilation with `kotlin.experimental.tryK2=true`.
* Ktor 2.1.2 and above.
* Coroutines 1.7.0 and above.
* AtomicFu 0.18.3 and above.
* The new memory model only. See https://github.com/realm/realm-kotlin#kotlin-memory-model-and-coroutine-compatibility
* Minimum Kbson 0.3.0.
* Minimum Gradle version: 6.8.3.
* Minimum Android Gradle Plugin version: 4.1.3.
* Minimum Kbson 0.4.0.
* Minimum Gradle version: 7.2.
* Minimum Android Gradle Plugin version: 7.1.3.
* Minimum Android SDK: 16.
* Minimum R8: 8.0.34.

### Internal
* Updated to Realm Core 14.7.0 commit c280bdb17522323d5c30dc32a2b9efc9dc80ca3b.
* Changed Kotlin compiler testing framework to https://github.com/zacsweers/kotlin-compile-testing


## 1.16.0 (2024-05-01)


## 1.16.0 (2024-05-01)
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,10 @@ SDK supports. In the matrix below, you will find the minimum supported version f

| Realm Version | Requirements |
|---------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 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> |
| 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> |
| 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> |
| 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> |
| 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> |
| 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> |
| 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> |
Expand Down
5 changes: 0 additions & 5 deletions benchmarks/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,3 @@ kotlin.code.style=official

#Android
android.useAndroidX=true

#MPP
kotlin.mpp.enableGranularSourceSetsMetadata=true
kotlin.native.enableDependencyPropagation=false
kotlin.mpp.enableCInteropCommonization=true
6 changes: 3 additions & 3 deletions buildSrc/src/main/kotlin/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ object Versions {
const val junit = "4.13.2" // https://mvnrepository.com/artifact/junit/junit
const val kbson = "0.4.0" // https://github.com/mongodb/kbson
// When updating the Kotlin version, also remember to update /examples/min-android-sample/build.gradle.kts
const val kotlin = "1.9.0" // https://github.com/JetBrains/kotlin and https://kotlinlang.org/docs/releases.html#release-details
const val kotlin = "2.0.0" // https://github.com/JetBrains/kotlin and https://kotlinlang.org/docs/releases.html#release-details
const val kotlinJvmTarget = "1.8" // Which JVM bytecode version is kotlin compiled to.
const val latestKotlin = "1.9.20" // https://kotlinlang.org/docs/eap.html#build-details
const val kotlinCompileTesting = "1.5.0" // https://github.com/tschuchortdev/kotlin-compile-testing
const val latestKotlin = "2.0.0" // https://kotlinlang.org/docs/eap.html#build-details
const val kotlinCompileTesting = "0.5.0-alpha07" // https://github.com/zacsweers/kotlin-compile-testing
const val ktlint = "0.45.2" // https://github.com/pinterest/ktlint
const val ktor = "2.3.7" // https://github.com/ktorio/ktor
const val multidex = "2.0.1" // https://developer.android.com/jetpack/androidx/releases/multidex
Expand Down
2 changes: 1 addition & 1 deletion examples/min-android-sample/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ dependencies {
implementation(project(":shared"))
implementation("com.android.support:appcompat-v7:28.0.0")
implementation("com.android.support.constraint:constraint-layout:2.0.4")
}
}
4 changes: 2 additions & 2 deletions examples/min-android-sample/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ buildscript {
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:4.2.2")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.0")
classpath("com.android.tools.build:gradle:7.1.3")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:2.0.0")
classpath("io.realm.kotlin:gradle-plugin:${rootProject.extra["realmVersion"]}")
}
}
Expand Down
2 changes: 0 additions & 2 deletions examples/min-android-sample/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,3 @@ kotlin.code.style=official
android.useAndroidX=true

org.gradle.configuration-cache=true

kotlin.mpp.androidSourceSetLayoutVersion=1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 2 additions & 2 deletions examples/min-android-sample/shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ kotlin {
implementation("io.realm.kotlin:library-base:${rootProject.ext["realmVersion"]}")
}
}
val androidTest by getting
val androidInstrumentedTest by getting
val jvmMain by getting
}
}
Expand All @@ -30,4 +30,4 @@ android {
minSdkVersion(16)
targetSdkVersion(31)
}
}
}

This file was deleted.

37 changes: 0 additions & 37 deletions integration-tests/gradle/gradle6-test/settings.gradle.kts

This file was deleted.

51 changes: 0 additions & 51 deletions integration-tests/gradle/gradle71-test/build.gradle.kts

This file was deleted.

31 changes: 0 additions & 31 deletions integration-tests/gradle/gradle71-test/gradle.properties

This file was deleted.

Binary file not shown.
Loading

0 comments on commit 3255d12

Please sign in to comment.