Skip to content

Commit ae75e01

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

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

buildSrc/src/main/kotlin/CommunityProjectsBuild.kt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,12 @@ 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 flag '$option' for a compilation in the project $${project.name}""")
210211
}
211212
}

0 commit comments

Comments
 (0)