Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/gradle/kotlinx-coroutines-1.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lamba92 authored Dec 20, 2024
2 parents 29546b9 + 60f06ee commit cc73e47
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 332 deletions.
2 changes: 0 additions & 2 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ dependencies {
api(libs.kotlin.gradle.plugin)
api(libs.kotlin.serialization.plugin)
api(libs.kotlin.serialization.plugin)
api(libs.kotlin.power.assert.plugin)
api(libs.ktlint.gradle)
api(libs.dokka.gradle.plugin)
api(libs.android.gradle.plugin)
api(libs.nexus.publish.plugin)
implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location))
}
1 change: 0 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ h2 = { module = "com.h2database:h2", version.ref = "h2" }
junit-jupiter-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "junit" }
junit-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junit" }
kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
kotlin-power-assert-plugin = { module = "org.jetbrains.kotlin:kotlin-power-assert", version.ref = "kotlin" }
kotlin-serialization-plugin = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlin" }
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx-coroutines" }
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kotlinx-coroutines" }
Expand Down
10 changes: 5 additions & 5 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")

include(
":core",
":tests",
":stores:mvstore",
":samples:js-http-client",
":samples:kmp-app",
":samples:ktor-server",
":stores:browser",
":stores:leveldb",
":stores:mvstore",
":tests",
":version-catalog",
":samples:js-http-client",
":samples:ktor-server",
":samples:kmp-app",
)

val levelDbPath: Path = file("../kotlin-leveldb").toPath()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
package com.github.lamba92.kotlin.document.store.tests.stores.leveldb

import kotlinx.io.files.Path

actual val DB_PATH: String
get() = error()

actual fun Path.createDirectories(): Path {
error()
}

private fun error(): Nothing = error("Kotlin/Native has no tests suite for Android Native")

actual fun Path.resolve(path: String): Path {
error()
}

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.IO
import kotlinx.coroutines.withContext
import kotlinx.io.files.Path
import kotlinx.io.files.SystemFileSystem

class LevelDBDeleteTests : AbstractDeleteTests(LevelDBStoreProvider)

Expand All @@ -37,7 +38,7 @@ object LevelDBStoreProvider : DataStoreProvider {

override suspend fun deleteDatabase(testName: String) =
withContext(Dispatchers.IO) {
deleteFolderRecursively(getDbPath(testName).toString())
getDbPath(testName).deleteRecursively()
}

override fun provide(testName: String): DataStore =
Expand All @@ -50,10 +51,32 @@ object LevelDBStoreProvider : DataStoreProvider {
)
}

expect fun Path.resolve(path: String): Path
fun Path.resolve(vararg other: String): Path = Path(this, *other)

expect fun Path.createDirectories(): Path

expect fun deleteFolderRecursively(path: String)
fun Path.createDirectories(): Path {
SystemFileSystem.createDirectories(this, false)
return this
}

expect val DB_PATH: String

val Path.isFile: Boolean
get() = SystemFileSystem.metadataOrNull(this)?.isRegularFile == true

val Path.isDirectory
get() = SystemFileSystem.metadataOrNull(this)?.isDirectory == true

fun Path.delete() = SystemFileSystem.delete(this, false)

fun Path.deleteRecursively() {
if (isDirectory) {
SystemFileSystem.list(this@deleteRecursively)
.forEach {
when {
it.isFile -> it.delete()
it.isDirectory -> it.deleteRecursively()
}
}
}
delete()
}

This file was deleted.

Loading

0 comments on commit cc73e47

Please sign in to comment.