Skip to content

Commit 6dddcdf

Browse files
committed
Fix folder creation for native
1 parent 27f7075 commit 6dddcdf

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

build.gradle.kts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import org.gradle.kotlin.dsl.get
44
import org.gradle.kotlin.dsl.withType
55
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
6+
import org.jetbrains.kotlin.gradle.plugin.mpp.TestExecutable
67
import org.jetbrains.kotlin.gradle.targets.jvm.KotlinJvmTarget
78
import java.util.*
89

@@ -219,6 +220,19 @@ tasks.withType<Test> {
219220
}
220221
}
221222

223+
kotlin.targets.withType<KotlinNativeTarget>().configureEach {
224+
binaries.withType<TestExecutable>().all {
225+
println("Configuring test binary for ${this.target.name} "+linkTaskName)
226+
227+
tasks.findByName("${this.target.name}Test")?.apply {
228+
dependsOn(createOrEraseDBFolders)
229+
doLast {
230+
project.layout.buildDirectory.dir("test-database").get().asFile.deleteRecursively()
231+
}
232+
}
233+
}
234+
}
235+
222236
// Placeholder secrets to allow project sync and build without publication setup
223237
ext["signing.keyId"] = System.getenv("SIGNING_KEY_ID")
224238
ext["signing.password"] = System.getenv("SIGNING_PASSWORD")
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
package maryk.rocksdb.util
22

3-
import maryk.createFolder
43
import kotlin.random.Random
54
import kotlin.random.nextUInt
65

76
@Suppress("EXPERIMENTAL_API_USAGE")
87
fun createTestDBFolder(name: String?) =
9-
("build/test-database/${name!!}_" + Random.nextUInt()).also { createFolder(it) }
8+
("build/test-database/${name!!}_" + Random.nextUInt())

0 commit comments

Comments
 (0)