Skip to content

Commit

Permalink
Fix no-empty-file
Browse files Browse the repository at this point in the history
  • Loading branch information
osipxd committed Nov 21, 2024
1 parent b4879c8 commit d455c8f
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 25 deletions.
12 changes: 1 addition & 11 deletions buildSrc/src/main/kotlin/KotlinExtensions.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
* Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
import org.gradle.api.*
import org.gradle.kotlin.dsl.*
Expand Down Expand Up @@ -47,16 +47,6 @@ fun NamedDomainObjectContainer<KotlinSourceSet>.jvmAndPosixTest(block: KotlinSou
block(sourceSet)
}

fun NamedDomainObjectContainer<KotlinSourceSet>.jvmAndNixMain(block: KotlinSourceSet.() -> Unit) {
val sourceSet = findByName("jvmAndNixMain") ?: getByName("jvmMain")
block(sourceSet)
}

fun NamedDomainObjectContainer<KotlinSourceSet>.jvmAndNixTest(block: KotlinSourceSet.() -> Unit) {
val sourceSet = findByName("jvmAndNixTest") ?: getByName("jvmTest")
block(sourceSet)
}

fun NamedDomainObjectContainer<KotlinSourceSet>.nixTest(block: KotlinSourceSet.() -> Unit) {
val sourceSet = findByName("nixTest") ?: return
block(sourceSet)
Expand Down
10 changes: 2 additions & 8 deletions buildSrc/src/main/kotlin/TargetsConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,17 @@ import java.io.*
private val Project.files: Array<File> get() = project.projectDir.listFiles() ?: emptyArray()
val Project.hasCommon: Boolean get() = files.any { it.name == "common" }
val Project.hasJvmAndPosix: Boolean get() = hasCommon || files.any { it.name == "jvmAndPosix" }
val Project.hasJvmAndNix: Boolean get() = hasCommon || files.any { it.name == "jvmAndNix" }
val Project.hasPosix: Boolean get() = hasCommon || hasJvmAndPosix || files.any { it.name == "posix" }
val Project.hasDesktop: Boolean get() = hasPosix || files.any { it.name == "desktop" }
val Project.hasNix: Boolean get() = hasPosix || hasJvmAndNix || files.any { it.name == "nix" }
val Project.hasNix: Boolean get() = hasPosix || files.any { it.name == "nix" }
val Project.hasLinux: Boolean get() = hasNix || files.any { it.name == "linux" }
val Project.hasDarwin: Boolean get() = hasNix || files.any { it.name == "darwin" }
val Project.hasAndroidNative: Boolean get() = hasPosix || files.any { it.name == "androidNative" }
val Project.hasWindows: Boolean get() = hasPosix || files.any { it.name == "windows" }
val Project.hasJsAndWasmShared: Boolean get() = files.any { it.name == "jsAndWasmShared" }
val Project.hasJs: Boolean get() = hasCommon || files.any { it.name == "js" } || hasJsAndWasmShared
val Project.hasWasmJs: Boolean get() = hasCommon || files.any { it.name == "wasmJs" } || hasJsAndWasmShared
val Project.hasJvm: Boolean get() = hasCommon || hasJvmAndNix || hasJvmAndPosix || files.any { it.name == "jvm" }
val Project.hasJvm: Boolean get() = hasCommon || hasJvmAndPosix || files.any { it.name == "jvm" }

val Project.hasExplicitNative: Boolean
get() = hasNix || hasPosix || hasLinux || hasAndroidNative || hasDarwin || hasDesktop || hasWindows
Expand Down Expand Up @@ -110,11 +109,6 @@ private val hierarchyTemplate = KotlinHierarchyTemplate {
group("posix")
}

group("jvmAndNix") {
withJvm()
group("nix")
}

group("desktop") {
group("linux")
group("windows")
Expand Down
File renamed without changes.
3 changes: 0 additions & 3 deletions ktor-client/ktor-client-js/js/src/Js.kt

This file was deleted.

File renamed without changes.
3 changes: 0 additions & 3 deletions ktor-client/ktor-client-js/wasmJs/src/Wasm.kt

This file was deleted.

0 comments on commit d455c8f

Please sign in to comment.