-
Notifications
You must be signed in to change notification settings - Fork 644
Kotlin User Projects: add kotlin_additional_cli_options and logging #2996
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -28,7 +37,7 @@ tasks.withType(KotlinCompilationTask::class).configureEach { | |||
} | |||
|
|||
allWarningsAsErrors = werrorEnabled | |||
|
|||
logger.info("allWarningsAsErrors=$werrorEnabled") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this logging really needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, that will allow us to make sure we use correct settings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aren't they visible in teamcity parameters?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe move it to Added Kotlin compiler flags
section then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tasks.withType<KotlinCompilationTask<*>>().configureEach {
doFirst {
logger.info("Added Kotlin compiler flags: ${compilerOptions.freeCompilerArgs.get().joinToString(", ")}")
logger.info("Werror state: ${compilerOptions.allWarningsAsErrors.get()}")
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fair, fixed
@@ -46,3 +55,9 @@ tasks.withType<Kotlin2JsCompile>().configureEach { | |||
tasks.withType<KotlinNativeCompile>().configureEach { | |||
compilerOptions { freeCompilerArgs.add("-Xpartial-linkage-loglevel=ERROR") } | |||
} | |||
|
|||
tasks.withType<KotlinCompilationTask<*>>().configureEach { | |||
doFirst { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest printing only the additional args if they were provided: if (kotlin_additional_cli_options?.isNotEmpty()) logger.info(...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's useful to have all options in log. now it look like this:
Added Kotlin compiler flags: -Xexplicit-api=strict, -Xsuppress-version-warnings, -Xexpect-actual-classes, -P, plugin:org.jetbrains.kotlinx.serialization:disableIntrinsic=false, -Xreport-all-warnings, -Xrender-internal-diagnostic-names, -nowarn
…f all extra compiler flags
39dbc33
to
bf7299a
Compare
(https://youtrack.jetbrains.com/issue/KT-75078)](https://youtrack.jetbrains.com/issue/KT-75078)