Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Realm Kotlin 2.0.0 #48

Merged
merged 5 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions AppServicesUsageSamples/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,12 @@ plugins {
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.android) apply false
}

// Explicitly adding the plugin to the classpath as it makes it easier to control the version
// centrally (don't need version in the 'plugins' block). Further, snapshots are not published with
// marker interface so would need to be added to the classpath manually anyway.
buildscript {
dependencies {
classpath(libs.realm.plugin)
}
}
9 changes: 5 additions & 4 deletions AppServicesUsageSamples/demo/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.realm.kotlin)
// For some reason libsx.plugins.realm does not resolve directly so go through the provider
// alias(libs.plugins.realm.kotlin)
id(libs.plugins.realm.kotlin.get().pluginId)
alias(libs.plugins.kotlin.serialization)
// alias(libs.plugins.jetbrainsCompose)
alias(libs.plugins.compose.compiler)
}

android {
Expand All @@ -28,9 +32,6 @@ android {
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.4.7"
}
buildTypes {
release {
isMinifyEnabled = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ val ErrorHandlingViewModel.discardUnsyncedData

override fun onBeforeReset(realm: TypedRealm) = Unit

override fun onError(session: SyncSession, exception: ClientResetRequiredException) = Unit

override fun onManualResetFallback(
session: SyncSession,
exception: ClientResetRequiredException,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ val ErrorHandlingViewModel.manualUnsyncedDataRecovery

override fun onBeforeReset(realm: TypedRealm) = Unit

override fun onError(session: SyncSession, exception: ClientResetRequiredException) = Unit

override fun onManualResetFallback(
session: SyncSession,
exception: ClientResetRequiredException,
Expand Down
6 changes: 4 additions & 2 deletions AppServicesUsageSamples/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
kotlin = "1.8.21"
kotlin = "2.0.0"
androidGradlePlugin = "8.0.0"
realm = "1.9.0"
realm = "2.0.0"
kotlinxSerializationJson="1.5.0"
androidxAppCompat="1.6.1"
androidxComposeBom = "2023.01.00"
Expand All @@ -28,6 +28,7 @@ androidx-compose-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-
kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "kotlinxSerializationJson" }
koin-android = { group = "io.insert-koin", name = "koin-android",version.ref = "koin"}
koin-androidx-compose = { group = "io.insert-koin", name = "koin-androidx-compose" ,version.ref = "koinCompose"}
realm-plugin = { group = "io.realm.kotlin", name = "gradle-plugin" ,version.ref = "realm"}
realm-library-sync = { group = "io.realm.kotlin", name = "library-sync" ,version.ref = "realm"}
junit4 = { group = "junit", name = "junit", version.ref = "junit4" }
androidx-test-ext = { group = "androidx.test.ext", name = "junit-ktx", version.ref = "androidxTestExt" }
Expand All @@ -39,3 +40,4 @@ android-library = { id = "com.android.library", version.ref = "androidGradlePlug
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
realm-kotlin = { id = "io.realm.kotlin", version.ref = "realm" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
9 changes: 9 additions & 0 deletions AppServicesUsageSamples/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,22 @@ pluginManagement {
google()
mavenCentral()
gradlePluginPortal()
// Only required for realm-kotlin snapshots
maven("https://oss.sonatype.org/content/repositories/snapshots")
}
}
dependencyResolutionManagement {
versionCatalogs {
create("libsx") {
from(files("../versions/current.toml"))
rorbech marked this conversation as resolved.
Show resolved Hide resolved
}
}
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
// Only required for realm-kotlin snapshots
maven("https://oss.sonatype.org/content/repositories/snapshots")
}
}
rootProject.name = "App Services Usage Samples"
Expand Down
12 changes: 5 additions & 7 deletions Bookshelf/androidApp/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id("com.android.application")
kotlin("android")
alias(libsx.plugins.androidApplication)
alias(libsx.plugins.kotlinAndroid)
alias(libsx.plugins.compose.compiler)
}

// https://maven.google.com/web/index.html?q=compiler#androidx.compose.compiler:compiler
Expand All @@ -18,8 +19,8 @@ repositories {
dependencies {
implementation(project(":shared"))
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
implementation("androidx.compose.compiler:compiler:${compose_compiler_version}")
compileOnly("io.realm.kotlin:library-base:${rootProject.extra["realmVersion"]}")

compileOnly(libsx.realm.base)

implementation("androidx.core:core-ktx:1.9.0")
implementation("androidx.appcompat:appcompat:1.5.1")
Expand Down Expand Up @@ -77,7 +78,4 @@ android {
jvmTarget = "1.8"
}

composeOptions {
kotlinCompilerExtensionVersion = compose_compiler_version
}
}
9 changes: 5 additions & 4 deletions Bookshelf/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
plugins {
kotlin("multiplatform") version "1.9.0" apply false
id("com.android.library") version "7.3.0" apply false
alias(libsx.plugins.kotlinMultiplatform) apply false
alias(libsx.plugins.kotlinAndroid) apply false
alias(libsx.plugins.androidApplication) apply false
alias(libsx.plugins.androidLibrary) apply false
}

// Explicitly adding the plugin to the classpath as it makes it easier to control the version
// centrally (don't need version in the 'plugins' block). Further, snapshots are not published with
// marker interface so would need to be added to the classpath manually anyway.
buildscript {
dependencies {
classpath("io.realm.kotlin:gradle-plugin:1.15.0")
classpath(libsx.realm.plugin)
}
}
rootProject.extra["realmVersion"] = "1.15.0"

allprojects {
group = "io.realm.sample.bookshelf"
Expand Down
2 changes: 1 addition & 1 deletion Bookshelf/iosApp/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ EXTERNAL SOURCES:
:path: "../shared"

SPEC CHECKSUMS:
shared: 5eaba5df1f9d8a7a8a81bd7eefe0517b0b43df1a
shared: 8d306cf673b31688e42c9240be260231b3f39192

PODFILE CHECKSUM: f282da88f39e69507b0a255187c8a6b644477756

Expand Down
3 changes: 3 additions & 0 deletions Bookshelf/iosApp/Pods/Local Podspecs/shared.podspec.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Bookshelf/iosApp/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading