Maven: eliminate warning classpath entry doesn't exist. Fix integration test

This commit is contained in:
Sergey Mashkov
2015-07-28 17:46:04 +03:00
parent a86857fbb5
commit 3c3e1a0a52
2 changed files with 12 additions and 4 deletions
@@ -1,8 +1,6 @@
[INFO] Kotlin Compiler version @snapshot@
[INFO] Compiling Kotlin sources from [/src/main/kotlin]
[INFO] Classes directory is /target/classes
[INFO] Classpath: /target/classes
[INFO] Classes directory is /target/classes
[INFO] Using kotlin annotations from /local-repo/org/jetbrains/kotlin/kotlin-jdk-annotations/0.1-SNAPSHOT/kotlin-jdk-annotations-0.1-SNAPSHOT.jar
[INFO] PERF: INIT: Compiler initialized in LLL ms
[INFO] PERF: ANALYZE: 1 files (2 lines) in LLL ms
@@ -19,6 +19,8 @@ package org.jetbrains.kotlin.maven;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.ArrayUtil;
import com.sampullara.cli.Args;
import kotlin.KotlinPackage;
import kotlin.jvm.functions.Function1;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.logging.Log;
@@ -85,7 +87,6 @@ public class K2JVMCompileMojo extends KotlinCompileMojoBase<K2JVMCompilerArgumen
@Override
protected void configureSpecificCompilerArguments(@NotNull K2JVMCompilerArguments arguments) throws MojoExecutionException {
getLog().info("Classes directory is " + output);
arguments.destination = output;
// don't include runtime, it should be in maven dependencies
@@ -96,7 +97,7 @@ public class K2JVMCompileMojo extends KotlinCompileMojoBase<K2JVMCompilerArgumen
arguments.module = module;
}
ArrayList<String> classpathList = new ArrayList<String>(classpath);
List<String> classpathList = filterClassPath(classpath);
if (!classpathList.isEmpty()) {
String classPathString = join(classpathList, File.pathSeparator);
@@ -123,6 +124,15 @@ public class K2JVMCompileMojo extends KotlinCompileMojoBase<K2JVMCompilerArgumen
}
}
protected List<String> filterClassPath(List<String> classpath) {
return KotlinPackage.filter(classpath, new Function1<String, Boolean>() {
@Override
public Boolean invoke(String s) {
return new File(s).exists() || new File(project.getBasedir(), s).exists();
}
});
}
protected String getFullAnnotationsPath(Log log, List<String> annotations) {
String jdkAnnotation = getJdkAnnotations().getPath();