Skip to content

Commit

Permalink
Merge pull request #836 from igorescodro/remove/atomicfu
Browse files Browse the repository at this point in the history
☢️ Remove AtomicFU
  • Loading branch information
igorescodro authored Jan 18, 2025
2 parents 04145ca + 3c7b24d commit 05bc28c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 12 deletions.
2 changes: 0 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@ buildscript {
classpath(libs.android.gradle.plugin)
classpath(libs.kotlin.gradle.plugin)
classpath(libs.aboutlibraries.plugin)
classpath(libs.kotlin.atomicfu)
}
}

allprojects {
apply(plugin = "kotlinx-atomicfu")
repositories {
google()
mavenCentral()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ package com.escodro.datastore
import androidx.datastore.core.DataStore
import androidx.datastore.preferences.core.PreferenceDataStoreFactory
import androidx.datastore.preferences.core.Preferences
import kotlinx.atomicfu.locks.SynchronizedObject
import kotlinx.atomicfu.locks.synchronized
import kotlinx.coroutines.InternalCoroutinesApi
import kotlinx.coroutines.internal.SynchronizedObject
import kotlinx.coroutines.internal.synchronized
import okio.Path.Companion.toPath

private lateinit var dataStore: DataStore<Preferences>

@OptIn(InternalCoroutinesApi::class)
private val lock = SynchronizedObject()

/**
Expand All @@ -18,6 +20,7 @@ private val lock = SynchronizedObject()
*
* @return the [DataStore] instance
*/
@OptIn(InternalCoroutinesApi::class)
fun getDataStore(producePath: () -> String): DataStore<Preferences> =
synchronized(lock) {
if (::dataStore.isInitialized) {
Expand Down
4 changes: 0 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,3 @@ org.jetbrains.compose.experimental.uikit.enabled=true
kotlin.mpp.stability.nowarn=true
kotlin.mpp.androidSourceSetLayoutVersion=2
kotlin.mpp.androidGradlePluginCompatibility.nowarn=true

# Ignore AtomicFU warnings - will be fixed in Kotlin 2.0
# (https://github.com/Kotlin/kotlinx-atomicfu/issues/376
kotlin.native.ignoreIncorrectDependencies=true
4 changes: 0 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ sqldelight = "2.0.2"
moko = "0.16.1"
moko_permissions = "0.18.1"

# AtomicFU
atomicfu = "0.24.0"

# Voyager
voyager = "1.1.0-beta02"

Expand All @@ -78,7 +75,6 @@ aboutlibraries = "11.2.3"
# Project
android_gradle_plugin = { module = "com.android.tools.build:gradle", version.ref = "android_gradle_plugin" }
kotlin_gradle_plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
kotlin_atomicfu = { module = "org.jetbrains.kotlinx:atomicfu-gradle-plugin", version.ref = "atomicfu" }

# General dependencies
logging = { module = "io.github.microutils:kotlin-logging", version.ref = "logging" }
Expand Down

0 comments on commit 05bc28c

Please sign in to comment.