MPP new model: temporarily solution for commonTest type identification
Now if source set is not included into any compilation target, then it is counted as test source set iff "Test" is in name So #KT-26076 Fixed
This commit is contained in:
@@ -276,10 +276,15 @@ class KotlinMPPGradleModelBuilder : ModelBuilderService {
|
||||
}
|
||||
}
|
||||
for (sourceSet in sourceSets) {
|
||||
val compilations = sourceSetToCompilations[sourceSet] ?: continue
|
||||
sourceSet.platform = compilations.map { it.platform }.distinct().singleOrNull() ?: KotlinPlatform.COMMON
|
||||
sourceSet.isTestModule = compilations.all { it.isTestModule }
|
||||
sourceSet.isAndroid = compilations.all { it.isAndroid }
|
||||
val compilations = sourceSetToCompilations[sourceSet]
|
||||
if (compilations != null) {
|
||||
sourceSet.platform = compilations.map { it.platform }.distinct().singleOrNull() ?: KotlinPlatform.COMMON
|
||||
sourceSet.isTestModule = compilations.all { it.isTestModule }
|
||||
sourceSet.isAndroid = compilations.all { it.isAndroid }
|
||||
} else {
|
||||
// TODO: change me after design about it
|
||||
sourceSet.isTestModule = "Test" in sourceSet.name
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -276,10 +276,15 @@ class KotlinMPPGradleModelBuilder : ModelBuilderService {
|
||||
}
|
||||
}
|
||||
for (sourceSet in sourceSets) {
|
||||
val compilations = sourceSetToCompilations[sourceSet] ?: continue
|
||||
sourceSet.platform = compilations.map { it.platform }.distinct().singleOrNull() ?: KotlinPlatform.COMMON
|
||||
sourceSet.isTestModule = compilations.all { it.isTestModule }
|
||||
sourceSet.isAndroid = compilations.all { it.isAndroid }
|
||||
val compilations = sourceSetToCompilations[sourceSet]
|
||||
if (compilations != null) {
|
||||
sourceSet.platform = compilations.map { it.platform }.distinct().singleOrNull() ?: KotlinPlatform.COMMON
|
||||
sourceSet.isTestModule = compilations.all { it.isTestModule }
|
||||
sourceSet.isAndroid = compilations.all { it.isAndroid }
|
||||
} else {
|
||||
// TODO: change me after design about it
|
||||
sourceSet.isTestModule = "Test" in sourceSet.name
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user