[Gradle] Fix possible CME in sourceSetsMetadataOutputs
Iterating over source sets and waiting for compilation wasn't safe. Because compilation upon configuration were able to add more source sets. Awaiting source sets first should solve the issue. ^KT-61652 Verification Pending
This commit is contained in:
committed by
Space Team
parent
7d047261d9
commit
1a35d01fe1
+1
-3
@@ -64,9 +64,7 @@ internal suspend fun Project.collectSourceSetMetadataOutputs(): Map<SourceSetNam
|
||||
}
|
||||
|
||||
private suspend fun KotlinMultiplatformExtension.sourceSetsMetadataOutputs(): Map<KotlinSourceSet, FileCollection?> {
|
||||
KotlinPluginLifecycle.Stage.AfterFinaliseDsl.await()
|
||||
|
||||
return sourceSets.associateWith { sourceSet ->
|
||||
return awaitSourceSets().associateWith { sourceSet ->
|
||||
when (val compilation = project.findMetadataCompilation(sourceSet)) {
|
||||
null -> null
|
||||
is KotlinCommonCompilation -> compilation.output.classesDirs
|
||||
|
||||
Reference in New Issue
Block a user