[stdlib] Enable explicit API mode

This commit is contained in:
Ilya Gorbunov
2023-11-07 22:52:02 +01:00
committed by Space Team
parent 115d685d91
commit 88bbe8d92d
2 changed files with 13 additions and 2 deletions
+1
View File
@@ -553,6 +553,7 @@ konanArtifacts {
extraOpts(project.globalBuildArgs)
extraOpts(
"-Werror",
"-Xexplicit-api=strict",
"-Xexpect-actual-classes",
"-module-name", "stdlib",
"-opt-in=kotlin.RequiresOptIn",
+12 -2
View File
@@ -65,6 +65,8 @@ kotlin {
val renderDiagnosticNames by extra(project.kotlinBuildProperties.renderDiagnosticNames)
val diagnosticNamesArg = if (renderDiagnosticNames) "-Xrender-internal-diagnostic-names" else null
explicitApi()
metadata {
compilations {
all {
@@ -74,6 +76,7 @@ kotlin {
"-Xallow-kotlin-package",
"-module-name", "kotlin-stdlib-common",
"-Xexpect-actual-classes",
"-Xexplicit-api=strict",
diagnosticNamesArg,
)
}
@@ -132,6 +135,7 @@ kotlin {
"-Xallow-kotlin-package",
"-Xmultifile-parts-inherit",
"-Xno-new-java-annotation-targets",
"-Xexplicit-api=strict",
diagnosticNamesArg,
)
}
@@ -147,6 +151,7 @@ kotlin {
"-Xallow-kotlin-package",
"-Xmultifile-parts-inherit",
"-Xno-new-java-annotation-targets",
"-Xexplicit-api=strict",
diagnosticNamesArg,
)
}
@@ -204,9 +209,10 @@ kotlin {
val main by getting
main.apply {
kotlinOptions {
freeCompilerArgs += listOf(
freeCompilerArgs += listOfNotNull(
"-Xir-module-name=kotlin",
"-Xexpect-actual-classes",
diagnosticNamesArg,
)
if (!kotlinBuildProperties.disableWerror) {
@@ -223,7 +229,11 @@ kotlin {
(this as KotlinTargetWithNodeJsDsl).nodejs()
compilations {
all {
kotlinOptions.freeCompilerArgs += listOf("-Xallow-kotlin-package", "-Xexpect-actual-classes")
kotlinOptions.freeCompilerArgs += listOfNotNull(
"-Xallow-kotlin-package",
"-Xexpect-actual-classes",
diagnosticNamesArg
)
}
val main by getting
main.apply {