(minor) Move source set configuration creation
It was placed in the new MPP plugin and was therefore not used for the 'KotlinSourceSet's with the old plugin. Move this logic to the KotlinSourceSetFactory so that it is applied to all source sets
This commit is contained in:
-7
@@ -103,7 +103,6 @@ internal class KotlinMultiplatformPlugin(
|
||||
}
|
||||
|
||||
private fun configureSourceSets(project: Project) = with (project.kotlinExtension as KotlinMultiplatformExtension) {
|
||||
sourceSets.all { defineSourceSetConfigurations(project, it) }
|
||||
val production = sourceSets.create(KotlinSourceSet.COMMON_MAIN_SOURCE_SET_NAME)
|
||||
val test = sourceSets.create(KotlinSourceSet.COMMON_TEST_SOURCE_SET_NAME)
|
||||
|
||||
@@ -156,10 +155,4 @@ internal class KotlinMultiplatformPlugin(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun defineSourceSetConfigurations(project: Project, sourceSet: KotlinSourceSet) = with (project.configurations) {
|
||||
sourceSet.relatedConfigurationNames.forEach { configurationName ->
|
||||
maybeCreate(configurationName)
|
||||
}
|
||||
}
|
||||
}
|
||||
+7
-2
@@ -28,8 +28,13 @@ internal abstract class KotlinSourceSetFactory<T : KotlinSourceSet> internal con
|
||||
project.file("src/$sourceSetName")
|
||||
|
||||
protected open fun setUpSourceSetDefaults(sourceSet: T) {
|
||||
with(sourceSet) {
|
||||
sourceSet.kotlin.srcDir(File(defaultSourceLocation(sourceSet.name), "kotlin"))
|
||||
sourceSet.kotlin.srcDir(File(defaultSourceLocation(sourceSet.name), "kotlin"))
|
||||
defineSourceSetConfigurations(project, sourceSet)
|
||||
}
|
||||
|
||||
private fun defineSourceSetConfigurations(project: Project, sourceSet: KotlinSourceSet) = with (project.configurations) {
|
||||
sourceSet.relatedConfigurationNames.forEach { configurationName ->
|
||||
maybeCreate(configurationName)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user