Add source directories to classpath in CLI compiler

Move this logic from Ant and Maven plugins
This commit is contained in:
Alexander Udalov
2015-01-27 17:56:18 +03:00
parent 3ea59117ac
commit 93f02aeead
3 changed files with 26 additions and 37 deletions
@@ -18,7 +18,6 @@ package org.jetbrains.kotlin.ant
import org.apache.tools.ant.types.Path
import org.apache.tools.ant.types.Reference
import java.io.File
import java.io.File.pathSeparator
public class Kotlin2JvmTask : KotlinCompilerBaseTask() {
@@ -60,18 +59,11 @@ public class Kotlin2JvmTask : KotlinCompilerBaseTask() {
args.add("-d")
args.add(output!!.canonicalPath)
val classpath = arrayListOf<String>()
compileClasspath?.let { classpath.addAll(it.list()) }
src!!.list().forEach {
val file = File(it)
if (file.isDirectory() || file.extension != "kt") {
classpath.add(it)
}
compileClasspath?.let {
args.add("-classpath")
args.add(it.list().join(pathSeparator))
}
args.add("-classpath")
args.add(classpath.join(pathSeparator))
externalAnnotations?.let {
args.add("-annotations")
args.add(it.list().join(pathSeparator))