Do not blank opt in for allowing kotlin package in all subprojects

-Xallow-kotlin-package must be specified explicitly to prevent
unintended declarations in kotlin package.
This commit is contained in:
Ilya Gorbunov
2019-10-11 06:01:42 +03:00
parent 5c9cbf7e77
commit 59482f6827
11 changed files with 40 additions and 4 deletions
-1
View File
@@ -331,7 +331,6 @@ allprojects {
val commonCompilerArgs = listOfNotNull(
"-Xuse-experimental=kotlin.Experimental",
"-Xallow-kotlin-package",
"-Xread-deserialized-contracts",
"-Xjvm-default=compatibility",
"-Xprogressive".takeIf { hasProperty("test.progressive.mode") } // TODO: change to "-progressive" after bootstrap
@@ -14,6 +14,10 @@ pill {
importAsLibrary = true
}
tasks.withType(org.jetbrains.kotlin.gradle.dsl.KotlinCompile) {
kotlinOptions.freeCompilerArgs += "-Xallow-kotlin-package"
}
jar {
manifestAttributes(manifest, project, 'Test')
}
+7 -3
View File
@@ -31,12 +31,16 @@ artifacts {
javadocJar()
tasks.withType(org.jetbrains.kotlin.gradle.dsl.KotlinCompile) {
kotlinOptions.freeCompilerArgs += "-Xallow-kotlin-package"
}
compileKotlinCommon {
kotlinOptions {
freeCompilerArgs = [
freeCompilerArgs += [
"-module-name", project.name,
"-Xallow-kotlin-package",
"-Xuse-experimental=kotlin.contracts.ExperimentalContracts"
]
}
}
}
@@ -17,6 +17,10 @@ sourceSets {
"test" { projectDefault() }
}
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>> {
kotlinOptions.freeCompilerArgs += "-Xallow-kotlin-package"
}
publish()
runtimeJar()
@@ -18,6 +18,10 @@ sourceSets {
"test" { }
}
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>> {
kotlinOptions.freeCompilerArgs += "-Xallow-kotlin-package"
}
publish()
standardPublicJars()
@@ -27,6 +27,10 @@ sourceSets {
"test" { projectDefault() }
}
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>> {
kotlinOptions.freeCompilerArgs += "-Xallow-kotlin-package"
}
projectTest(parallel = true)
projectTest(taskName = "embeddableTest", parallel = true) {
@@ -26,6 +26,10 @@ sourceSets {
"test" {}
}
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>> {
kotlinOptions.freeCompilerArgs += "-Xallow-kotlin-package"
}
standardPublicJars()
projectTest(parallel = true)
@@ -37,6 +37,10 @@ sourceSets {
"test" { projectDefault() }
}
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>> {
kotlinOptions.freeCompilerArgs += "-Xallow-kotlin-package"
}
projectTest(parallel = true) {
dependsOn(":dist")
workingDir = rootDir
@@ -28,5 +28,9 @@ sourceSets {
"test" {}
}
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>> {
kotlinOptions.freeCompilerArgs += "-Xallow-kotlin-package"
}
standardPublicJars()
+4
View File
@@ -18,6 +18,10 @@ sourceSets {
"test" { projectDefault() }
}
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>> {
kotlinOptions.freeCompilerArgs += "-Xallow-kotlin-package"
}
publish()
runtimeJar()
@@ -58,6 +58,7 @@ tasks.withType<KotlinCompile> {
freeCompilerArgs += listOf(
"-module-name",
"kotlin-stdlib",
"-Xallow-kotlin-package",
"-Xmulti-platform",
"-Xuse-experimental=kotlin.contracts.ExperimentalContracts",
"-Xuse-experimental=kotlin.Experimental"