diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/KotlinStandardLibrariesPathProvider.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/KotlinStandardLibrariesPathProvider.kt index 849b46d1532..016c99fb9b1 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/KotlinStandardLibrariesPathProvider.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/KotlinStandardLibrariesPathProvider.kt @@ -9,6 +9,7 @@ import org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments import org.jetbrains.kotlin.cli.jvm.configureStandardLibs import org.jetbrains.kotlin.codegen.forTestCompile.ForTestCompileRuntime import org.jetbrains.kotlin.config.CompilerConfiguration +import org.jetbrains.kotlin.test.util.KtTestUtil import java.io.File import java.lang.ref.SoftReference import java.net.URL @@ -66,6 +67,11 @@ abstract class KotlinStandardLibrariesPathProvider : TestService { */ abstract fun jvmAnnotationsForTests(): File + /** + * compiler/testData/mockJDK/jre/lib/annotations.jar + */ + abstract fun getAnnotationsJar(): File + fun getRuntimeJarClassLoader(): ClassLoader = synchronized(this) { var loader = runtimeJarClassLoader.get() if (loader == null) { @@ -101,6 +107,7 @@ object StandardLibrariesPathProviderForKotlinProject : KotlinStandardLibrariesPa override fun kotlinTestJarForTests(): File = ForTestCompileRuntime.kotlinTestJarForTests() override fun scriptRuntimeJarForTests(): File = ForTestCompileRuntime.scriptRuntimeJarForTests() override fun jvmAnnotationsForTests(): File = ForTestCompileRuntime.jvmAnnotationsForTests() + override fun getAnnotationsJar(): File = KtTestUtil.getAnnotationsJar() } object EnvironmentBasedStandardLibrariesPathProvider : KotlinStandardLibrariesPathProvider() { @@ -125,6 +132,7 @@ object EnvironmentBasedStandardLibrariesPathProvider : KotlinStandardLibrariesPa override fun kotlinTestJarForTests(): File = getFile(KOTLIN_TEST_PROP) override fun scriptRuntimeJarForTests(): File = getFile(KOTLIN_SCRIPT_RUNTIME_PROP) override fun jvmAnnotationsForTests(): File = getFile(KOTLIN_ANNOTATIONS_JVM_PROP) + override fun getAnnotationsJar(): File = getFile(KOTLIN_ANNOTATIONS_JVM_PROP) } val TestServices.standardLibrariesPathProvider: KotlinStandardLibrariesPathProvider by TestServices.testServiceAccessor() diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/configuration/JvmEnvironmentConfigurator.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/configuration/JvmEnvironmentConfigurator.kt index 127169f070e..64796c08abc 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/configuration/JvmEnvironmentConfigurator.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/configuration/JvmEnvironmentConfigurator.kt @@ -122,12 +122,11 @@ class JvmEnvironmentConfigurator(testServices: TestServices) : EnvironmentConfig if (configurationKind.withReflection) { files.add(provider.reflectJarForTests()) } - files.add(KtTestUtil.getAnnotationsJar()) + files.add(provider.getAnnotationsJar()) if (JvmEnvironmentConfigurationDirectives.STDLIB_JDK8 in directives) { files.add(provider.runtimeJarForTestsWithJdk8()) } - files.add(KtTestUtil.getAnnotationsJar()) return files }