Clear Java srcDirs in JS and multiplatform projects.

Issue #KT-20217 Fixed

(cherry picked from commit a4f8a5e)
This commit is contained in:
Sergey Igushkin
2017-10-10 21:51:18 +03:00
parent dff15a3d59
commit 873994545c
@@ -290,6 +290,8 @@ internal class Kotlin2JsSourceSetProcessor(
kotlinTask.source(kotlinSourceSet.kotlin)
createCleanSourceMapTask()
sourceSet.clearJavaSrcDirs()
// outputFile can be set later during the configuration phase, get it only after the phase:
project.afterEvaluate { project ->
val subpluginEnvironment: SubpluginEnvironment = loadSubplugins(project)
@@ -342,6 +344,8 @@ internal class KotlinCommonSourceSetProcessor(
compileTaskNameSuffix = "kotlinCommon"
) {
override fun doTargetSpecificProcessing() {
sourceSet.clearJavaSrcDirs()
project.afterEvaluate { project ->
kotlinTask.source(kotlinSourceSet.kotlin)
project.tasks.findByName(sourceSet.classesTaskName).dependsOn(kotlinTask)
@@ -709,6 +713,10 @@ internal fun createSyncOutputTask(
return syncTask
}
private fun SourceSet.clearJavaSrcDirs() {
java.setSrcDirs(emptyList<File>())
}
private val KOTLIN_ANNOTATION_PROCESSING_FILE_REGEX = "kotlin-annotation-processing-[\\-0-9A-Za-z.]+\\.jar".toRegex()
private fun removeAnnotationProcessingPluginClasspathEntry(kotlinCompile: KotlinCompile) {