Fix: create a compilation's default source set for Android as well
This commit is contained in:
+4
@@ -708,6 +708,8 @@ abstract class AbstractAndroidProjectHandler<V>(private val kotlinConfigurationT
|
|||||||
}
|
}
|
||||||
|
|
||||||
val compilation = target.compilations.getByName(variantDataName)
|
val compilation = target.compilations.getByName(variantDataName)
|
||||||
|
val defaultSourceSet = project.kotlinExtension.sourceSets.maybeCreate(compilation.defaultSourceSetName)
|
||||||
|
|
||||||
val kotlinTaskName = compilation.compileKotlinTaskName
|
val kotlinTaskName = compilation.compileKotlinTaskName
|
||||||
// todo: Investigate possibility of creating and configuring kotlinTask before evaluation
|
// todo: Investigate possibility of creating and configuring kotlinTask before evaluation
|
||||||
val kotlinTask = tasksProvider.createKotlinJVMTask(project, kotlinTaskName, variantDataName)
|
val kotlinTask = tasksProvider.createKotlinJVMTask(project, kotlinTaskName, variantDataName)
|
||||||
@@ -717,6 +719,8 @@ abstract class AbstractAndroidProjectHandler<V>(private val kotlinConfigurationT
|
|||||||
kotlinTask.destinationDir = File(project.buildDir, "tmp/kotlin-classes/$variantDataName")
|
kotlinTask.destinationDir = File(project.buildDir, "tmp/kotlin-classes/$variantDataName")
|
||||||
kotlinTask.description = "Compiles the $variantDataName kotlin."
|
kotlinTask.description = "Compiles the $variantDataName kotlin."
|
||||||
|
|
||||||
|
// Register the source only after the task is created, because tne task is required for that:
|
||||||
|
compilation.source(defaultSourceSet)
|
||||||
configureSources(kotlinTask, variantData, compilation)
|
configureSources(kotlinTask, variantData, compilation)
|
||||||
|
|
||||||
// In MPPs, add the common main Kotlin sources to non-test variants, the common test sources to test variants
|
// In MPPs, add the common main Kotlin sources to non-test variants, the common test sources to test variants
|
||||||
|
|||||||
Reference in New Issue
Block a user