[Gradle][MPP] CompilationDetails.source: Use .forAll over 'whenEvaluated'
KT-52726
This commit is contained in:
committed by
Space
parent
c6e9216663
commit
5f924518af
+3
-5
@@ -266,8 +266,8 @@ open class DefaultCompilationDetails<T : KotlinCommonOptions>(
|
|||||||
|
|
||||||
override fun source(sourceSet: KotlinSourceSet) {
|
override fun source(sourceSet: KotlinSourceSet) {
|
||||||
if (directlyIncludedKotlinSourceSets.add(sourceSet)) {
|
if (directlyIncludedKotlinSourceSets.add(sourceSet)) {
|
||||||
target.project.whenEvaluated {
|
sourceSet.internal.withDependsOnClosure.forAll { inWithDependsOnClosure ->
|
||||||
addExactSourceSetsEagerly(sourceSet.internal.withDependsOnClosure)
|
addExactSourceSetEagerly(inWithDependsOnClosure)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -280,10 +280,9 @@ open class DefaultCompilationDetails<T : KotlinCommonOptions>(
|
|||||||
addAsCommonSources
|
addAsCommonSources
|
||||||
) { sourceSet.kotlin }
|
) { sourceSet.kotlin }
|
||||||
|
|
||||||
internal fun addExactSourceSetsEagerly(sourceSets: Set<KotlinSourceSet>) {
|
internal fun addExactSourceSetEagerly(sourceSet: KotlinSourceSet) {
|
||||||
with(target.project) {
|
with(target.project) {
|
||||||
//TODO possibly issue with forced instantiation
|
//TODO possibly issue with forced instantiation
|
||||||
sourceSets.forEach { sourceSet ->
|
|
||||||
addSourcesToCompileTask(
|
addSourcesToCompileTask(
|
||||||
sourceSet,
|
sourceSet,
|
||||||
addAsCommonSources = lazy {
|
addAsCommonSources = lazy {
|
||||||
@@ -320,7 +319,6 @@ open class DefaultCompilationDetails<T : KotlinCommonOptions>(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
open class DefaultCompilationDetailsWithRuntime<T : KotlinCommonOptions>(
|
open class DefaultCompilationDetailsWithRuntime<T : KotlinCommonOptions>(
|
||||||
|
|||||||
+1
-1
@@ -316,7 +316,7 @@ class KotlinMetadataTargetConfigurator :
|
|||||||
return compilationFactory.create(compilationName).apply {
|
return compilationFactory.create(compilationName).apply {
|
||||||
target.compilations.add(this@apply)
|
target.compilations.add(this@apply)
|
||||||
|
|
||||||
(compilationDetails as DefaultCompilationDetails<*>).addExactSourceSetsEagerly(setOf(sourceSet))
|
(compilationDetails as DefaultCompilationDetails<*>).addExactSourceSetEagerly(sourceSet)
|
||||||
|
|
||||||
configureMetadataDependenciesForCompilation(this@apply)
|
configureMetadataDependenciesForCompilation(this@apply)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user