Do not show warnings when some projects are not generated before import
#KT-35442 Fixed
This commit is contained in:
@@ -75,9 +75,13 @@ class KotlinMPPGradleModelBuilder : ModelBuilderService {
|
|||||||
targets: Collection<KotlinTarget>,
|
targets: Collection<KotlinTarget>,
|
||||||
project: Project
|
project: Project
|
||||||
): Map<String, KotlinSourceSetImpl> {
|
): Map<String, KotlinSourceSetImpl> {
|
||||||
if (project.properties["import_orphan_source_sets"]?.toString()?.toBoolean() ?: DEFAULT_IMPORT_ORPHAN_SOURCE_SETS) return sourceSets
|
if (try {
|
||||||
val compiledSourceSets: Collection<String> = targets.flatMap { it.compilations }
|
project.properties["import_orphan_source_sets"]
|
||||||
.flatMap { it.sourceSets }.flatMap { it.dependsOnSourceSets.union(listOf(it.name)) }.distinct()
|
} catch (e: Exception) {
|
||||||
|
null
|
||||||
|
}?.toString()?.toBoolean() ?: DEFAULT_IMPORT_ORPHAN_SOURCE_SETS
|
||||||
|
) return sourceSets
|
||||||
|
val compiledSourceSets: Collection<String> = targets.flatMap { it.compilations }.flatMap { it.sourceSets }.flatMap { it.dependsOnSourceSets.union(listOf(it.name)) }.distinct()
|
||||||
sourceSets.filter { !compiledSourceSets.contains(it.key) }.forEach {
|
sourceSets.filter { !compiledSourceSets.contains(it.key) }.forEach {
|
||||||
logger.warn("[sync warning] Source set \"${it.key}\" is not compiled with any compilation. This source set is not imported in the IDE.")
|
logger.warn("[sync warning] Source set \"${it.key}\" is not compiled with any compilation. This source set is not imported in the IDE.")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user