File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 33 */
44
55import org.jetbrains.kotlin.gradle.tasks.*
6+ import kotlin.collections.joinToString
7+
8+ val kotlin_additional_cli_options = providers.gradleProperty(" kotlin_additional_cli_options" )
9+ .map { it.split(" " ) }
10+ .orNull
611
712val globalCompilerArgs
813 get() = listOf (
@@ -18,6 +23,10 @@ tasks.withType(KotlinCompilationTask::class).configureEach {
1823 // Unconditional compiler options
1924 freeCompilerArgs.addAll(globalCompilerArgs)
2025
26+ if (kotlin_additional_cli_options != null ) {
27+ freeCompilerArgs.addAll(kotlin_additional_cli_options)
28+ }
29+
2130 val isMainTaskName = name.startsWith(" compileKotlin" )
2231 if (isMainTaskName) {
2332 val werrorEnabled = when (kotlin_Werror_override?.lowercase()) {
@@ -28,7 +37,6 @@ tasks.withType(KotlinCompilationTask::class).configureEach {
2837 }
2938
3039 allWarningsAsErrors = werrorEnabled
31-
3240 // Add extra compiler options when -Werror is disabled
3341 if (! werrorEnabled) {
3442 freeCompilerArgs.addAll(
@@ -46,3 +54,10 @@ tasks.withType<Kotlin2JsCompile>().configureEach {
4654tasks.withType<KotlinNativeCompile >().configureEach {
4755 compilerOptions { freeCompilerArgs.add(" -Xpartial-linkage-loglevel=ERROR" ) }
4856}
57+
58+ tasks.withType<KotlinCompilationTask <* >>().configureEach {
59+ doFirst {
60+ logger.info(" Added Kotlin compiler flags: ${compilerOptions.freeCompilerArgs.get().joinToString(" , " )} " )
61+ logger.info(" allWarningsAsErrors=${compilerOptions.allWarningsAsErrors.get()} " )
62+ }
63+ }
You can’t perform that action at this time.
0 commit comments