Skip to content

Commit

Permalink
Move explicit API mode enabling to build-logic
Browse files Browse the repository at this point in the history
  • Loading branch information
osipxd committed Dec 27, 2024
1 parent 9927db4 commit 3444354
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 13 deletions.
2 changes: 2 additions & 0 deletions build-logic/src/main/kotlin/ktorbuild.kmp.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ plugins {
}

kotlin {
explicitApi()

compilerOptions {
progressiveMode = true
apiVersion = ktorBuild.kotlinApiVersion
Expand Down
12 changes: 12 additions & 0 deletions build-logic/src/main/kotlin/ktorbuild.project.internal.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/

plugins {
id("ktorbuild.kmp")
}

kotlin {
// Disable explicit API by default for internal projects
explicitApi = null
}
13 changes: 0 additions & 13 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,6 @@ extra["nonDefaultProjectStructure"] = mutableListOf(
"ktor-java-modules-test",
)

val disabledExplicitApiModeProjects = listOf(
"ktor-client-tests",
"ktor-server-test-base",
"ktor-server-test-suites",
"ktor-server-tests",
"ktor-client-content-negotiation-tests",
"ktor-test-base"
)

apply(from = "gradle/compatibility.gradle")

plugins {
Expand All @@ -58,10 +49,6 @@ subprojects {
apply(plugin = "ktorbuild.kmp")
apply(plugin = "atomicfu-conventions")

kotlin {
if (!disabledExplicitApiModeProjects.contains(project.name)) explicitApi()
}

val skipPublish: List<String> by rootProject.extra
if (!skipPublish.contains(project.name)) {
configurePublication()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
description = "Common tests for client content negotiation"

plugins {
id("ktorbuild.project.internal")
id("kotlinx-serialization")
}

Expand Down
1 change: 1 addition & 0 deletions ktor-client/ktor-client-tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
description = "Common tests for client"

plugins {
id("ktorbuild.project.internal")
id("kotlinx-serialization")
id("test-server")
}
Expand Down
4 changes: 4 additions & 0 deletions ktor-server/ktor-server-test-base/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

description = ""

plugins {
id("ktorbuild.project.internal")
}

kotlin.sourceSets {
commonMain {
dependencies {
Expand Down
4 changes: 4 additions & 0 deletions ktor-server/ktor-server-test-suites/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

description = ""

plugins {
id("ktorbuild.project.internal")
}

kotlin.sourceSets {
commonMain {
dependencies {
Expand Down
1 change: 1 addition & 0 deletions ktor-server/ktor-server-tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
description = ""

plugins {
id("ktorbuild.project.internal")
id("kotlinx-serialization")
}

Expand Down
4 changes: 4 additions & 0 deletions ktor-shared/ktor-test-base/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

description = "Common extensions for testing Ktor"

plugins {
id("ktorbuild.project.internal")
}

kotlin.sourceSets {
commonMain {
dependencies {
Expand Down

0 comments on commit 3444354

Please sign in to comment.