Skip to content

Commit ca07a92

Browse files
committed
Kotlin UP: Fulfill the new requirements for Kotlin User Projects (#4392)
1 parent 56894d0 commit ca07a92

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

buildSrc/src/main/kotlin/CommunityProjectsBuild.kt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ private val LOGGER: Logger = Logger.getLogger("Kotlin settings logger")
2525
* (see [configureCommunityBuildTweaks]).
2626
*
2727
* DO NOT change the name of these properties without adapting the kotlinx.train build chain.
28-
*/
28+
*/
2929

3030
/**
3131
* Should be used for running against of non-released Kotlin compiler on a system test level.
@@ -201,11 +201,13 @@ fun KotlinCommonCompilerOptions.configureKotlinUserProject() {
201201
* See <https://github.com/Kotlin/kotlinx.coroutines/pull/4392#issuecomment-2775630200>
202202
*/
203203
fun KotlinCommonCompilerOptions.addExtraCompilerFlags(project: Project) {
204-
val extraOptions = project.providers.gradleProperty("kotlin_additional_cli_options").orNull
205-
if (extraOptions != null) {
206-
LOGGER.info("""Adding extra compiler flags '$extraOptions' for a compilation in the project $${project.name}""")
207-
extraOptions.split(" ").forEach {
208-
if (it.isNotEmpty()) freeCompilerArgs.add(it)
204+
val extraOptions = project.providers.gradleProperty("kotlin_additional_cli_options")
205+
.orNull?.let { options ->
206+
options.removeSurrounding("\"").split(" ").filter { it.isNotBlank() }
209207
}
208+
extraOptions?.forEach { option ->
209+
freeCompilerArgs.add(option)
210+
LOGGER.info("""Adding extra compiler flags '$extraOptions' for a compilation in the project $${project.name}""")
210211
}
211212
}
213+

0 commit comments

Comments
 (0)