[stdlib] Enable explicit API mode
This commit is contained in:
committed by
Space Team
parent
115d685d91
commit
88bbe8d92d
@@ -553,6 +553,7 @@ konanArtifacts {
|
|||||||
extraOpts(project.globalBuildArgs)
|
extraOpts(project.globalBuildArgs)
|
||||||
extraOpts(
|
extraOpts(
|
||||||
"-Werror",
|
"-Werror",
|
||||||
|
"-Xexplicit-api=strict",
|
||||||
"-Xexpect-actual-classes",
|
"-Xexpect-actual-classes",
|
||||||
"-module-name", "stdlib",
|
"-module-name", "stdlib",
|
||||||
"-opt-in=kotlin.RequiresOptIn",
|
"-opt-in=kotlin.RequiresOptIn",
|
||||||
|
|||||||
@@ -65,6 +65,8 @@ kotlin {
|
|||||||
val renderDiagnosticNames by extra(project.kotlinBuildProperties.renderDiagnosticNames)
|
val renderDiagnosticNames by extra(project.kotlinBuildProperties.renderDiagnosticNames)
|
||||||
val diagnosticNamesArg = if (renderDiagnosticNames) "-Xrender-internal-diagnostic-names" else null
|
val diagnosticNamesArg = if (renderDiagnosticNames) "-Xrender-internal-diagnostic-names" else null
|
||||||
|
|
||||||
|
explicitApi()
|
||||||
|
|
||||||
metadata {
|
metadata {
|
||||||
compilations {
|
compilations {
|
||||||
all {
|
all {
|
||||||
@@ -74,6 +76,7 @@ kotlin {
|
|||||||
"-Xallow-kotlin-package",
|
"-Xallow-kotlin-package",
|
||||||
"-module-name", "kotlin-stdlib-common",
|
"-module-name", "kotlin-stdlib-common",
|
||||||
"-Xexpect-actual-classes",
|
"-Xexpect-actual-classes",
|
||||||
|
"-Xexplicit-api=strict",
|
||||||
diagnosticNamesArg,
|
diagnosticNamesArg,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -132,6 +135,7 @@ kotlin {
|
|||||||
"-Xallow-kotlin-package",
|
"-Xallow-kotlin-package",
|
||||||
"-Xmultifile-parts-inherit",
|
"-Xmultifile-parts-inherit",
|
||||||
"-Xno-new-java-annotation-targets",
|
"-Xno-new-java-annotation-targets",
|
||||||
|
"-Xexplicit-api=strict",
|
||||||
diagnosticNamesArg,
|
diagnosticNamesArg,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -147,6 +151,7 @@ kotlin {
|
|||||||
"-Xallow-kotlin-package",
|
"-Xallow-kotlin-package",
|
||||||
"-Xmultifile-parts-inherit",
|
"-Xmultifile-parts-inherit",
|
||||||
"-Xno-new-java-annotation-targets",
|
"-Xno-new-java-annotation-targets",
|
||||||
|
"-Xexplicit-api=strict",
|
||||||
diagnosticNamesArg,
|
diagnosticNamesArg,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -204,9 +209,10 @@ kotlin {
|
|||||||
val main by getting
|
val main by getting
|
||||||
main.apply {
|
main.apply {
|
||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
freeCompilerArgs += listOf(
|
freeCompilerArgs += listOfNotNull(
|
||||||
"-Xir-module-name=kotlin",
|
"-Xir-module-name=kotlin",
|
||||||
"-Xexpect-actual-classes",
|
"-Xexpect-actual-classes",
|
||||||
|
diagnosticNamesArg,
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!kotlinBuildProperties.disableWerror) {
|
if (!kotlinBuildProperties.disableWerror) {
|
||||||
@@ -223,7 +229,11 @@ kotlin {
|
|||||||
(this as KotlinTargetWithNodeJsDsl).nodejs()
|
(this as KotlinTargetWithNodeJsDsl).nodejs()
|
||||||
compilations {
|
compilations {
|
||||||
all {
|
all {
|
||||||
kotlinOptions.freeCompilerArgs += listOf("-Xallow-kotlin-package", "-Xexpect-actual-classes")
|
kotlinOptions.freeCompilerArgs += listOfNotNull(
|
||||||
|
"-Xallow-kotlin-package",
|
||||||
|
"-Xexpect-actual-classes",
|
||||||
|
diagnosticNamesArg
|
||||||
|
)
|
||||||
}
|
}
|
||||||
val main by getting
|
val main by getting
|
||||||
main.apply {
|
main.apply {
|
||||||
|
|||||||
Reference in New Issue
Block a user