use of org.jetbrains.kotlin.load.kotlin.ModuleVisibilityManager in project kotlin by JetBrains.
the class StdlibTest method createEnvironment.
@Override
protected KotlinCoreEnvironment createEnvironment() {
@SuppressWarnings("deprecation") File[] runtimeClasspath = ForTestCompileRuntime.runtimeClassesForTests();
CompilerConfiguration configuration = KotlinTestUtils.newConfiguration(ConfigurationKind.JDK_NO_RUNTIME, TestJdkKind.FULL_JDK, runtimeClasspath);
JvmContentRootsKt.addJvmClasspathRoot(configuration, ForTestCompileRuntime.kotlinTestJarForTests());
File junitJar = new File("libraries/lib/junit-4.11.jar");
assertTrue(junitJar.exists());
JvmContentRootsKt.addJvmClasspathRoot(configuration, junitJar);
ContentRootsKt.addKotlinSourceRoot(configuration, KotlinTestUtils.getHomeDirectory() + "/libraries/stdlib/test");
configuration.put(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY, new PrintingMessageCollector(System.err, MessageRenderer.PLAIN_FULL_PATHS, false));
KotlinCoreEnvironment environment = KotlinCoreEnvironment.createForTests(getTestRootDisposable(), configuration, EnvironmentConfigFiles.JVM_CONFIG_FILES);
ModuleVisibilityManager moduleVisibilityManager = ModuleVisibilityManager.SERVICE.getInstance(environment.getProject());
for (File path : runtimeClasspath) {
moduleVisibilityManager.addFriendPath(path.getPath());
}
return environment;
}
Aggregations