Moved CompilerDependencies.findRtJar() method to PathUtil.
This commit is contained in:
@@ -24,6 +24,7 @@ import org.jetbrains.jet.codegen.forTestCompile.ForTestCompileRuntime;
|
||||
import org.jetbrains.jet.config.CompilerConfiguration;
|
||||
import org.jetbrains.jet.lang.resolve.java.CompilerDependencies;
|
||||
import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode;
|
||||
import org.jetbrains.jet.utils.PathUtil;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.File;
|
||||
@@ -57,7 +58,7 @@ public class CompileCompilerDependenciesTest {
|
||||
public static CompilerDependencies compilerDependenciesForTests(@NotNull CompilerSpecialMode compilerSpecialMode, boolean mockJdk) {
|
||||
return new CompilerDependencies(
|
||||
compilerSpecialMode,
|
||||
compilerSpecialMode.includeJdk() ? (mockJdk ? JetTestUtils.findMockJdkRtJar() : CompilerDependencies.findRtJar()) : null,
|
||||
compilerSpecialMode.includeJdk() ? (mockJdk ? JetTestUtils.findMockJdkRtJar() : PathUtil.findRtJar()) : null,
|
||||
compilerSpecialMode.includeJdkAnnotations() ? ForTestPackJdkAnnotations.jdkAnnotationsForTests() : null,
|
||||
compilerSpecialMode.includeKotlinRuntime() ? ForTestCompileRuntime.runtimeJarForTests() : null);
|
||||
}
|
||||
@@ -65,7 +66,7 @@ public class CompileCompilerDependenciesTest {
|
||||
public static CompilerConfiguration compilerConfigurationForTests(@NotNull CompilerSpecialMode compilerSpecialMode, boolean mockJdk) {
|
||||
List<File> classpath = new ArrayList<File>();
|
||||
if (compilerSpecialMode.includeJdk()) {
|
||||
classpath.add(mockJdk ? JetTestUtils.findMockJdkRtJar() : CompilerDependencies.findRtJar());
|
||||
classpath.add(mockJdk ? JetTestUtils.findMockJdkRtJar() : PathUtil.findRtJar());
|
||||
}
|
||||
if (compilerSpecialMode.includeKotlinRuntime()) {
|
||||
classpath.add(ForTestCompileRuntime.runtimeJarForTests());
|
||||
|
||||
+4
-3
@@ -36,6 +36,7 @@ import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||
import org.jetbrains.jet.lang.resolve.java.CompilerDependencies;
|
||||
import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode;
|
||||
import org.jetbrains.jet.lang.resolve.java.DescriptorSearchRule;
|
||||
import org.jetbrains.jet.utils.PathUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
@@ -115,7 +116,7 @@ public class ResolveDescriptorsFromExternalLibraries {
|
||||
System.out.println("Using file " + jar);
|
||||
}
|
||||
else {
|
||||
jar = CompilerDependencies.findRtJar();
|
||||
jar = PathUtil.findRtJar();
|
||||
System.out.println("Using rt.jar: " + jar);
|
||||
}
|
||||
|
||||
@@ -154,8 +155,8 @@ public class ResolveDescriptorsFromExternalLibraries {
|
||||
else {
|
||||
CompilerDependencies compilerDependencies = CompileCompilerDependenciesTest.compilerDependenciesForTests(CompilerSpecialMode.STDLIB, false);
|
||||
jetCoreEnvironment = JetCoreEnvironment.createCoreEnvironmentForJVM(junk, compilerDependencies);
|
||||
if (!CompilerDependencies.findRtJar().equals(jar)) {
|
||||
throw new RuntimeException("rt.jar mismatch: " + jar + ", " + CompilerDependencies.findRtJar());
|
||||
if (!PathUtil.findRtJar().equals(jar)) {
|
||||
throw new RuntimeException("rt.jar mismatch: " + jar + ", " + PathUtil.findRtJar());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user