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 3
3
*/
4
4
5
5
import 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
6
11
7
12
val globalCompilerArgs
8
13
get() = listOf (
@@ -18,6 +23,10 @@ tasks.withType(KotlinCompilationTask::class).configureEach {
18
23
// Unconditional compiler options
19
24
freeCompilerArgs.addAll(globalCompilerArgs)
20
25
26
+ if (kotlin_additional_cli_options != null ) {
27
+ freeCompilerArgs.addAll(kotlin_additional_cli_options)
28
+ }
29
+
21
30
val isMainTaskName = name.startsWith(" compileKotlin" )
22
31
if (isMainTaskName) {
23
32
val werrorEnabled = when (kotlin_Werror_override?.lowercase()) {
@@ -28,7 +37,6 @@ tasks.withType(KotlinCompilationTask::class).configureEach {
28
37
}
29
38
30
39
allWarningsAsErrors = werrorEnabled
31
-
32
40
// Add extra compiler options when -Werror is disabled
33
41
if (! werrorEnabled) {
34
42
freeCompilerArgs.addAll(
@@ -46,3 +54,10 @@ tasks.withType<Kotlin2JsCompile>().configureEach {
46
54
tasks.withType<KotlinNativeCompile >().configureEach {
47
55
compilerOptions { freeCompilerArgs.add(" -Xpartial-linkage-loglevel=ERROR" ) }
48
56
}
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