Maven: eliminate warning classpath entry doesn't exist. Fix integration test
This commit is contained in:
@@ -1,8 +1,6 @@
|
|||||||
[INFO] Kotlin Compiler version @snapshot@
|
[INFO] Kotlin Compiler version @snapshot@
|
||||||
[INFO] Compiling Kotlin sources from [/src/main/kotlin]
|
[INFO] Compiling Kotlin sources from [/src/main/kotlin]
|
||||||
[INFO] Classes directory is /target/classes
|
[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] 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: INIT: Compiler initialized in LLL ms
|
||||||
[INFO] PERF: ANALYZE: 1 files (2 lines) in LLL ms
|
[INFO] PERF: ANALYZE: 1 files (2 lines) in LLL ms
|
||||||
|
|||||||
+12
-2
@@ -19,6 +19,8 @@ package org.jetbrains.kotlin.maven;
|
|||||||
import com.intellij.openapi.util.text.StringUtil;
|
import com.intellij.openapi.util.text.StringUtil;
|
||||||
import com.intellij.util.ArrayUtil;
|
import com.intellij.util.ArrayUtil;
|
||||||
import com.sampullara.cli.Args;
|
import com.sampullara.cli.Args;
|
||||||
|
import kotlin.KotlinPackage;
|
||||||
|
import kotlin.jvm.functions.Function1;
|
||||||
import org.apache.maven.artifact.Artifact;
|
import org.apache.maven.artifact.Artifact;
|
||||||
import org.apache.maven.plugin.MojoExecutionException;
|
import org.apache.maven.plugin.MojoExecutionException;
|
||||||
import org.apache.maven.plugin.logging.Log;
|
import org.apache.maven.plugin.logging.Log;
|
||||||
@@ -85,7 +87,6 @@ public class K2JVMCompileMojo extends KotlinCompileMojoBase<K2JVMCompilerArgumen
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void configureSpecificCompilerArguments(@NotNull K2JVMCompilerArguments arguments) throws MojoExecutionException {
|
protected void configureSpecificCompilerArguments(@NotNull K2JVMCompilerArguments arguments) throws MojoExecutionException {
|
||||||
getLog().info("Classes directory is " + output);
|
|
||||||
arguments.destination = output;
|
arguments.destination = output;
|
||||||
|
|
||||||
// don't include runtime, it should be in maven dependencies
|
// don't include runtime, it should be in maven dependencies
|
||||||
@@ -96,7 +97,7 @@ public class K2JVMCompileMojo extends KotlinCompileMojoBase<K2JVMCompilerArgumen
|
|||||||
arguments.module = module;
|
arguments.module = module;
|
||||||
}
|
}
|
||||||
|
|
||||||
ArrayList<String> classpathList = new ArrayList<String>(classpath);
|
List<String> classpathList = filterClassPath(classpath);
|
||||||
|
|
||||||
if (!classpathList.isEmpty()) {
|
if (!classpathList.isEmpty()) {
|
||||||
String classPathString = join(classpathList, File.pathSeparator);
|
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) {
|
protected String getFullAnnotationsPath(Log log, List<String> annotations) {
|
||||||
String jdkAnnotation = getJdkAnnotations().getPath();
|
String jdkAnnotation = getJdkAnnotations().getPath();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user