[Gradle] CompilationDetails: Use source set hierarchy instead of compilations to determine common sources
^KKT-50161 Verification Pending
This commit is contained in:
committed by
Space
parent
ab73251af0
commit
794c9d16a3
+3
-1
@@ -287,7 +287,9 @@ open class DefaultCompilationDetails<T : KotlinCommonOptions>(
|
||||
addSourcesToCompileTask(
|
||||
sourceSet,
|
||||
addAsCommonSources = lazy {
|
||||
CompilationSourceSetUtil.sourceSetsInMultipleCompilations(project).contains(sourceSet.name)
|
||||
target.project.kotlinExtension.sourceSets.any { otherSourceSet ->
|
||||
sourceSet in otherSourceSet.dependsOn
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
-5
@@ -282,11 +282,6 @@ internal object CompilationSourceSetUtil {
|
||||
|
||||
return compilationNamesBySourceSetName.get()
|
||||
}
|
||||
|
||||
fun sourceSetsInMultipleCompilations(project: Project) =
|
||||
compilationsBySourceSets(project).mapNotNullTo(mutableSetOf()) { (sourceSet, compilations) ->
|
||||
sourceSet.name.takeIf { compilations.size > 1 }
|
||||
}
|
||||
}
|
||||
|
||||
private val invalidModuleNameCharactersRegex = """[\\/\r\n\t]""".toRegex()
|
||||
|
||||
Reference in New Issue
Block a user