Reorganize dependencies around kotlin-compiler.jar

#KT-26807 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2018-12-12 11:51:25 +03:00
parent 30c769c19a
commit d5ebe2e66a
18 changed files with 98 additions and 31 deletions
@@ -19,6 +19,7 @@ package org.jetbrains.kotlin.utils;
import org.jetbrains.annotations.NotNull;
import java.io.File;
import java.util.List;
public interface KotlinPaths {
@NotNull
@@ -60,6 +61,12 @@ public interface KotlinPaths {
@NotNull
File getSamWithReceiverJarPath();
@NotNull
File getTrove4jJarPath();
@NotNull
List<File> getCompilerClasspath();
@NotNull
File getCompilerPath();
@@ -16,9 +16,11 @@
package org.jetbrains.kotlin.utils;
import kotlin.collections.CollectionsKt;
import org.jetbrains.annotations.NotNull;
import java.io.File;
import java.util.List;
public class KotlinPathsFromHomeDir implements KotlinPaths {
// kotlinc directory
@@ -106,6 +108,18 @@ public class KotlinPathsFromHomeDir implements KotlinPaths {
return getLibraryFile(PathUtil.SAM_WITH_RECEIVER_PLUGIN_JAR_NAME);
}
@NotNull
@Override
public File getTrove4jJarPath() {
return getLibraryFile(PathUtil.TROVE4J_NAME);
}
@NotNull
@Override
public List<File> getCompilerClasspath() {
return CollectionsKt.listOf(getStdlibPath(), getReflectPath(), getScriptRuntimePath(), getTrove4jJarPath());
}
@NotNull
@Override
public File getCompilerPath() {
@@ -71,6 +71,9 @@ object PathUtil {
const val KOTLIN_JAVA_STDLIB_SRC_JAR_OLD = "kotlin-runtime-sources.jar"
const val TROVE4J_NAME = "trove4j"
const val TROVE4J_JAR = "$TROVE4J_NAME.jar"
const val KOTLIN_COMPILER_NAME = "kotlin-compiler"
const val KOTLIN_COMPILER_JAR = "$KOTLIN_COMPILER_NAME.jar"