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
@@ -98,24 +98,17 @@ public class K2JVMCompileMojo extends KotlinCompileMojoBase<K2JVMCompilerArgumen
// don't include runtime, it should be in maven dependencies
arguments.noStdlib = true;
ArrayList<String> classpathList = new ArrayList<String>();
if (module != null) {
LOG.info("Compiling Kotlin module " + module);
arguments.module = module;
}
else {
// TODO: Move it compiler
classpathList.addAll(getSources());
}
classpathList.addAll(classpath);
ArrayList<String> classpathList = new ArrayList<String>(classpath);
if (classpathList.remove(output)) {
LOG.debug("Removed target directory from compiler classpath (" + output + ")");
}
if (classpathList.size() > 0) {
if (!classpathList.isEmpty()) {
String classPathString = join(classpathList, File.pathSeparator);
LOG.info("Classpath: " + classPathString);
arguments.classpath = classPathString;