Skip to content

Commit

Permalink
Specify module name via moduleName option instead of freeCompilerArgs
Browse files Browse the repository at this point in the history
This allows to get rid of warnings about duplicate module name in some
of the modules.
  • Loading branch information
udalov committed Nov 6, 2020
1 parent bdb8a58 commit d326d6a
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 20 deletions.
3 changes: 2 additions & 1 deletion libraries/kotlin.test/junit/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ configureSourcesJar()
configureJavadocJar()

compileKotlin {
kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package", "-module-name", project.name]
kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package"]
kotlinOptions.moduleName = project.name
}

compileTestKotlin {
Expand Down
3 changes: 2 additions & 1 deletion libraries/kotlin.test/junit5/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
}

compileKotlin {
kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package", "-module-name", project.name]
kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package"]
kotlinOptions.moduleName = project.name
}

compileTestKotlin {
Expand Down
4 changes: 2 additions & 2 deletions libraries/kotlin.test/jvm/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ configureJavadocJar()

compileKotlin {
kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package", "-Xnormalize-constructor-calls=enable",
"-Xopt-in=kotlin.contracts.ExperimentalContracts",
"-module-name", project.archivesBaseName, ]
"-Xopt-in=kotlin.contracts.ExperimentalContracts"]
kotlinOptions.moduleName = project.archivesBaseName
}

compileTestKotlin {
Expand Down
3 changes: 2 additions & 1 deletion libraries/kotlin.test/testng/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ configureSourcesJar()
configureJavadocJar()

compileKotlin {
kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package", "-module-name", project.name]
kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package"]
kotlinOptions.moduleName = project.name
}

compileTestKotlin {
Expand Down
4 changes: 2 additions & 2 deletions libraries/reflect/api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ compileKotlin {
"-Xnormalize-constructor-calls=enable",
"-Xno-optimized-callable-references",
"-Xno-kotlin-nothing-value-exception",
"-Xopt-in=kotlin.RequiresOptIn",
"-module-name", "kotlin-reflection"]
"-Xopt-in=kotlin.RequiresOptIn"]
moduleName = "kotlin-reflection"
}
}

Expand Down
4 changes: 2 additions & 2 deletions libraries/stdlib/coroutines-experimental/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ tasks {
"-Xopt-in=kotlin.contracts.ExperimentalContracts",
"-Xcoroutines=enable",
"-XXLanguage:-ReleaseCoroutines",
"-Xno-use-ir",
"-module-name", "kotlin-coroutines-experimental-compat"
"-Xno-use-ir"
)
moduleName = "kotlin-coroutines-experimental-compat"
}
}
val compileTestKotlin by existing(KotlinCompile::class) {
Expand Down
2 changes: 1 addition & 1 deletion libraries/stdlib/jdk7/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ compileKotlin {
"-Xallow-kotlin-package",
"-Xmultifile-parts-inherit",
"-Xnormalize-constructor-calls=enable",
"-module-name", project.name,
"-Xopt-in=kotlin.RequiresOptIn",
"-Xopt-in=kotlin.contracts.ExperimentalContracts",
]
kotlinOptions.moduleName = project.name
}

compileTestKotlin {
Expand Down
2 changes: 1 addition & 1 deletion libraries/stdlib/jdk8/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ compileKotlin {
"-Xallow-kotlin-package",
"-Xmultifile-parts-inherit",
"-Xnormalize-constructor-calls=enable",
"-module-name", project.name
]
kotlinOptions.moduleName = project.name
}

compileTestKotlin {
Expand Down
3 changes: 1 addition & 2 deletions libraries/stdlib/jvm-minimal-for-test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,12 @@ tasks.withType<KotlinCompile> {
dependsOn(copySources)
kotlinOptions {
freeCompilerArgs += listOf(
"-module-name",
"kotlin-stdlib",
"-Xallow-kotlin-package",
"-Xmulti-platform",
"-Xopt-in=kotlin.RequiresOptIn",
"-Xopt-in=kotlin.contracts.ExperimentalContracts"
)
moduleName = "kotlin-stdlib"
}
}

Expand Down
2 changes: 1 addition & 1 deletion libraries/stdlib/jvm/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,12 @@ compileKotlin {
"-Xallow-result-return-type",
"-Xmultifile-parts-inherit",
"-Xnormalize-constructor-calls=enable",
"-module-name", "kotlin-stdlib",
"-Xopt-in=kotlin.RequiresOptIn",
"-Xopt-in=kotlin.ExperimentalMultiplatform",
"-Xopt-in=kotlin.contracts.ExperimentalContracts",
"-Xinline-classes"
]
moduleName = "kotlin-stdlib"
}
}

Expand Down
6 changes: 2 additions & 4 deletions libraries/tools/kotlin-annotations-android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ jvmTarget = "1.6"
javaHome = rootProject.extra["JDK_16"] as String

tasks.withType<KotlinCompile> {
kotlinOptions.freeCompilerArgs += listOf(
"-Xallow-kotlin-package",
"-module-name", project.name
)
kotlinOptions.freeCompilerArgs += listOf("-Xallow-kotlin-package")
kotlinOptions.moduleName = project.name
}

sourceSets {
Expand Down
2 changes: 1 addition & 1 deletion libraries/tools/kotlin-annotations-jvm/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ compileKotlin {
kotlinOptions.freeCompilerArgs = [
"-Xallow-kotlin-package",
"-Xnormalize-constructor-calls=enable",
"-module-name", project.name
]
kotlinOptions.moduleName = project.name
}

configureJvmIrBackend(project)
2 changes: 1 addition & 1 deletion libraries/tools/script-runtime/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ compileKotlin {
kotlinOptions.freeCompilerArgs = [
"-Xallow-kotlin-package",
"-Xnormalize-constructor-calls=enable",
"-module-name", project.name
]
kotlinOptions.moduleName = project.name
}

configureJvmIrBackend(project)

0 comments on commit d326d6a

Please sign in to comment.