diff --git a/compiler/testData/loadJava/compiledJava/mutability/LoadIterable.java b/compiler/testData/loadJava/compiledJava/mutability/LoadIterable.java index cb095c5d42e..65524bd98c9 100644 --- a/compiler/testData/loadJava/compiledJava/mutability/LoadIterable.java +++ b/compiler/testData/loadJava/compiledJava/mutability/LoadIterable.java @@ -1,6 +1,7 @@ +// JVM_ANNOTATIONS package test; -import org.jetbrains.annotations.*; +import kotlin.annotations.jvm.*; public interface LoadIterable { public @Mutable Iterable getIterable(); diff --git a/compiler/testData/loadJava/compiledJava/mutability/LoadIterable.txt b/compiler/testData/loadJava/compiledJava/mutability/LoadIterable.txt index 0f13953e099..0f81a54f249 100644 --- a/compiler/testData/loadJava/compiledJava/mutability/LoadIterable.txt +++ b/compiler/testData/loadJava/compiledJava/mutability/LoadIterable.txt @@ -1,8 +1,8 @@ package test public interface LoadIterable { - @org.jetbrains.annotations.Mutable public abstract fun getIterable(): kotlin.collections.MutableIterable! - @org.jetbrains.annotations.ReadOnly public abstract fun getReadOnlyIterable(): kotlin.collections.Iterable! - public abstract fun setIterable(/*0*/ @org.jetbrains.annotations.Mutable p0: kotlin.collections.MutableIterable!): kotlin.Unit - public abstract fun setReadOnlyIterable(/*0*/ @org.jetbrains.annotations.ReadOnly p0: kotlin.collections.Iterable!): kotlin.Unit + @kotlin.annotations.jvm.Mutable public abstract fun getIterable(): kotlin.collections.MutableIterable! + @kotlin.annotations.jvm.ReadOnly public abstract fun getReadOnlyIterable(): kotlin.collections.Iterable! + public abstract fun setIterable(/*0*/ @kotlin.annotations.jvm.Mutable p0: kotlin.collections.MutableIterable!): kotlin.Unit + public abstract fun setReadOnlyIterable(/*0*/ @kotlin.annotations.jvm.ReadOnly p0: kotlin.collections.Iterable!): kotlin.Unit } diff --git a/compiler/testData/loadJava/compiledJava/mutability/LoadIterableWithConflict.java b/compiler/testData/loadJava/compiledJava/mutability/LoadIterableWithConflict.java index 91f36b65687..000af3eda99 100644 --- a/compiler/testData/loadJava/compiledJava/mutability/LoadIterableWithConflict.java +++ b/compiler/testData/loadJava/compiledJava/mutability/LoadIterableWithConflict.java @@ -1,6 +1,7 @@ +// JVM_ANNOTATIONS package test; -import org.jetbrains.annotations.*; +import kotlin.annotations.jvm.*; public interface LoadIterableWithConflict { public @ReadOnly @Mutable Iterable getIterable(); diff --git a/compiler/testData/loadJava/compiledJava/mutability/LoadIterableWithConflict.txt b/compiler/testData/loadJava/compiledJava/mutability/LoadIterableWithConflict.txt index 5ed9c123195..6e63c5cee2c 100644 --- a/compiler/testData/loadJava/compiledJava/mutability/LoadIterableWithConflict.txt +++ b/compiler/testData/loadJava/compiledJava/mutability/LoadIterableWithConflict.txt @@ -1,6 +1,6 @@ package test public interface LoadIterableWithConflict { - @org.jetbrains.annotations.ReadOnly @org.jetbrains.annotations.Mutable public abstract fun getIterable(): kotlin.collections.(Mutable)Iterable! - public abstract fun setIterable(/*0*/ @org.jetbrains.annotations.ReadOnly @org.jetbrains.annotations.Mutable p0: kotlin.collections.(Mutable)Iterable!): kotlin.Unit + @kotlin.annotations.jvm.ReadOnly @kotlin.annotations.jvm.Mutable public abstract fun getIterable(): kotlin.collections.(Mutable)Iterable! + public abstract fun setIterable(/*0*/ @kotlin.annotations.jvm.ReadOnly @kotlin.annotations.jvm.Mutable p0: kotlin.collections.(Mutable)Iterable!): kotlin.Unit } diff --git a/compiler/testData/loadJava/compiledJava/mutability/LoadIterableWithNullability.java b/compiler/testData/loadJava/compiledJava/mutability/LoadIterableWithNullability.java index 88b2f547e8d..e081a4ce5f2 100644 --- a/compiler/testData/loadJava/compiledJava/mutability/LoadIterableWithNullability.java +++ b/compiler/testData/loadJava/compiledJava/mutability/LoadIterableWithNullability.java @@ -1,6 +1,8 @@ +// JVM_ANNOTATIONS package test; -import org.jetbrains.annotations.*; +import kotlin.annotations.jvm.*; +import org.jetbrains.annotations.NotNull; public interface LoadIterableWithNullability { public @NotNull @Mutable Iterable getIterable(); diff --git a/compiler/testData/loadJava/compiledJava/mutability/LoadIterableWithNullability.txt b/compiler/testData/loadJava/compiledJava/mutability/LoadIterableWithNullability.txt index 08351a6bc45..e7259b525bd 100644 --- a/compiler/testData/loadJava/compiledJava/mutability/LoadIterableWithNullability.txt +++ b/compiler/testData/loadJava/compiledJava/mutability/LoadIterableWithNullability.txt @@ -1,8 +1,8 @@ package test public interface LoadIterableWithNullability { - @org.jetbrains.annotations.NotNull @org.jetbrains.annotations.Mutable public abstract fun getIterable(): kotlin.collections.MutableIterable - @org.jetbrains.annotations.NotNull @org.jetbrains.annotations.ReadOnly public abstract fun getReadOnlyIterable(): kotlin.collections.Iterable - public abstract fun setIterable(/*0*/ @org.jetbrains.annotations.Mutable @org.jetbrains.annotations.NotNull p0: kotlin.collections.MutableIterable): kotlin.Unit - public abstract fun setReadOnlyIterable(/*0*/ @org.jetbrains.annotations.ReadOnly @org.jetbrains.annotations.NotNull p0: kotlin.collections.Iterable): kotlin.Unit + @org.jetbrains.annotations.NotNull @kotlin.annotations.jvm.Mutable public abstract fun getIterable(): kotlin.collections.MutableIterable + @org.jetbrains.annotations.NotNull @kotlin.annotations.jvm.ReadOnly public abstract fun getReadOnlyIterable(): kotlin.collections.Iterable + public abstract fun setIterable(/*0*/ @kotlin.annotations.jvm.Mutable @org.jetbrains.annotations.NotNull p0: kotlin.collections.MutableIterable): kotlin.Unit + public abstract fun setReadOnlyIterable(/*0*/ @kotlin.annotations.jvm.ReadOnly @org.jetbrains.annotations.NotNull p0: kotlin.collections.Iterable): kotlin.Unit } diff --git a/compiler/testData/loadJava/compiledJava/mutability/LoadIterableWithPropagation.java b/compiler/testData/loadJava/compiledJava/mutability/LoadIterableWithPropagation.java index 3cd88d66247..d5a568857bf 100644 --- a/compiler/testData/loadJava/compiledJava/mutability/LoadIterableWithPropagation.java +++ b/compiler/testData/loadJava/compiledJava/mutability/LoadIterableWithPropagation.java @@ -1,6 +1,7 @@ +// JVM_ANNOTATIONS package test; -import org.jetbrains.annotations.*; +import kotlin.annotations.jvm.*; import java.util.ArrayList; public interface LoadIterableWithPropagation { diff --git a/compiler/testData/loadJava/compiledJava/mutability/LoadIterableWithPropagation.txt b/compiler/testData/loadJava/compiledJava/mutability/LoadIterableWithPropagation.txt index 4e662e75a7c..f8de7e7a0d9 100644 --- a/compiler/testData/loadJava/compiledJava/mutability/LoadIterableWithPropagation.txt +++ b/compiler/testData/loadJava/compiledJava/mutability/LoadIterableWithPropagation.txt @@ -3,10 +3,10 @@ package test public interface LoadIterableWithPropagation { public interface LoadIterable { - @org.jetbrains.annotations.Mutable public abstract fun getIterable(): kotlin.collections.MutableIterable! - @org.jetbrains.annotations.ReadOnly public abstract fun getReadOnlyIterable(): kotlin.collections.Iterable! - public abstract fun setIterable(/*0*/ @org.jetbrains.annotations.Mutable p0: kotlin.collections.MutableIterable!): kotlin.Unit - public abstract fun setReadOnlyIterable(/*0*/ @org.jetbrains.annotations.ReadOnly p0: kotlin.collections.Iterable!): kotlin.Unit + @kotlin.annotations.jvm.Mutable public abstract fun getIterable(): kotlin.collections.MutableIterable! + @kotlin.annotations.jvm.ReadOnly public abstract fun getReadOnlyIterable(): kotlin.collections.Iterable! + public abstract fun setIterable(/*0*/ @kotlin.annotations.jvm.Mutable p0: kotlin.collections.MutableIterable!): kotlin.Unit + public abstract fun setReadOnlyIterable(/*0*/ @kotlin.annotations.jvm.ReadOnly p0: kotlin.collections.Iterable!): kotlin.Unit } public open class LoadIterableImpl : test.LoadIterableWithPropagation.LoadIterable { diff --git a/compiler/testData/loadJava/compiledJava/mutability/ReadOnlyExtendsWildcard.java b/compiler/testData/loadJava/compiledJava/mutability/ReadOnlyExtendsWildcard.java index 5d5824f48de..b9494166285 100644 --- a/compiler/testData/loadJava/compiledJava/mutability/ReadOnlyExtendsWildcard.java +++ b/compiler/testData/loadJava/compiledJava/mutability/ReadOnlyExtendsWildcard.java @@ -1,6 +1,8 @@ +// JVM_ANNOTATIONS package test; -import org.jetbrains.annotations.*; +import kotlin.annotations.jvm.*; +import org.jetbrains.annotations.NotNull; import java.util.*; diff --git a/compiler/testData/loadJava/compiledJava/mutability/ReadOnlyExtendsWildcard.txt b/compiler/testData/loadJava/compiledJava/mutability/ReadOnlyExtendsWildcard.txt index d194b74d5d8..c21de3b56f7 100644 --- a/compiler/testData/loadJava/compiledJava/mutability/ReadOnlyExtendsWildcard.txt +++ b/compiler/testData/loadJava/compiledJava/mutability/ReadOnlyExtendsWildcard.txt @@ -2,5 +2,5 @@ package test public interface ReadOnlyExtendsWildcard { public abstract fun bar(): kotlin.Unit - public abstract fun foo(/*0*/ @org.jetbrains.annotations.ReadOnly p0: kotlin.collections.List!, /*1*/ @org.jetbrains.annotations.NotNull p1: kotlin.Comparable): kotlin.Unit + public abstract fun foo(/*0*/ @kotlin.annotations.jvm.ReadOnly p0: kotlin.collections.List!, /*1*/ @org.jetbrains.annotations.NotNull p1: kotlin.Comparable): kotlin.Unit } diff --git a/compiler/testData/loadJava/compiledKotlinWithStdlib/mutability/LoadIterable.kt b/compiler/testData/loadJava/compiledKotlinWithStdlib/mutability/LoadIterable.kt index 0fedb930de7..f035973481c 100644 --- a/compiler/testData/loadJava/compiledKotlinWithStdlib/mutability/LoadIterable.kt +++ b/compiler/testData/loadJava/compiledKotlinWithStdlib/mutability/LoadIterable.kt @@ -1,6 +1,7 @@ +// JVM_ANNOTATIONS package test -import org.jetbrains.annotations.* +import kotlin.annotations.jvm.* public interface LoadIterable { @Mutable diff --git a/compiler/testData/loadJava/compiledKotlinWithStdlib/mutability/LoadIterable.txt b/compiler/testData/loadJava/compiledKotlinWithStdlib/mutability/LoadIterable.txt index befcc37228a..ca9f6c5f6f0 100644 --- a/compiler/testData/loadJava/compiledKotlinWithStdlib/mutability/LoadIterable.txt +++ b/compiler/testData/loadJava/compiledKotlinWithStdlib/mutability/LoadIterable.txt @@ -1,8 +1,8 @@ package test public interface LoadIterable { - @org.jetbrains.annotations.Mutable public abstract fun getIterable(): kotlin.collections.MutableIterable? - @org.jetbrains.annotations.ReadOnly public abstract fun getReadOnlyIterable(): kotlin.collections.Iterable? - public abstract fun setIterable(/*0*/ @org.jetbrains.annotations.Mutable p0: kotlin.collections.MutableIterable?): kotlin.Unit - public abstract fun setReadOnlyIterable(/*0*/ @org.jetbrains.annotations.ReadOnly p0: kotlin.collections.Iterable?): kotlin.Unit + @kotlin.annotations.jvm.Mutable public abstract fun getIterable(): kotlin.collections.MutableIterable? + @kotlin.annotations.jvm.ReadOnly public abstract fun getReadOnlyIterable(): kotlin.collections.Iterable? + public abstract fun setIterable(/*0*/ @kotlin.annotations.jvm.Mutable p0: kotlin.collections.MutableIterable?): kotlin.Unit + public abstract fun setReadOnlyIterable(/*0*/ @kotlin.annotations.jvm.ReadOnly p0: kotlin.collections.Iterable?): kotlin.Unit } diff --git a/compiler/testData/loadJava/compiledKotlinWithStdlib/mutability/LoadIterableWithConflict.kt b/compiler/testData/loadJava/compiledKotlinWithStdlib/mutability/LoadIterableWithConflict.kt index 1253c24bf13..97eb5a61854 100644 --- a/compiler/testData/loadJava/compiledKotlinWithStdlib/mutability/LoadIterableWithConflict.kt +++ b/compiler/testData/loadJava/compiledKotlinWithStdlib/mutability/LoadIterableWithConflict.kt @@ -1,6 +1,7 @@ +// JVM_ANNOTATIONS package test -import org.jetbrains.annotations.* +import kotlin.annotations.jvm.* public interface LoadIterableWithConflict { @ReadOnly @Mutable diff --git a/compiler/testData/loadJava/compiledKotlinWithStdlib/mutability/LoadIterableWithConflict.txt b/compiler/testData/loadJava/compiledKotlinWithStdlib/mutability/LoadIterableWithConflict.txt index b8033ebbaca..726bc9a9ac2 100644 --- a/compiler/testData/loadJava/compiledKotlinWithStdlib/mutability/LoadIterableWithConflict.txt +++ b/compiler/testData/loadJava/compiledKotlinWithStdlib/mutability/LoadIterableWithConflict.txt @@ -1,6 +1,6 @@ package test public interface LoadIterableWithConflict { - @org.jetbrains.annotations.ReadOnly @org.jetbrains.annotations.Mutable public abstract fun getIterable(): kotlin.collections.MutableIterable? - public abstract fun setIterable(/*0*/ @org.jetbrains.annotations.ReadOnly @org.jetbrains.annotations.Mutable p0: kotlin.collections.MutableIterable?): kotlin.Unit + @kotlin.annotations.jvm.ReadOnly @kotlin.annotations.jvm.Mutable public abstract fun getIterable(): kotlin.collections.MutableIterable? + public abstract fun setIterable(/*0*/ @kotlin.annotations.jvm.ReadOnly @kotlin.annotations.jvm.Mutable p0: kotlin.collections.MutableIterable?): kotlin.Unit } diff --git a/compiler/testData/loadJava/compiledKotlinWithStdlib/mutability/LoadIterableWithNullability.kt b/compiler/testData/loadJava/compiledKotlinWithStdlib/mutability/LoadIterableWithNullability.kt index 2f71563b18c..a464006eaea 100644 --- a/compiler/testData/loadJava/compiledKotlinWithStdlib/mutability/LoadIterableWithNullability.kt +++ b/compiler/testData/loadJava/compiledKotlinWithStdlib/mutability/LoadIterableWithNullability.kt @@ -1,6 +1,7 @@ +// JVM_ANNOTATIONS package test -import org.jetbrains.annotations.* +import kotlin.annotations.jvm.* public interface LoadIterableWithNullability { @Mutable diff --git a/compiler/testData/loadJava/compiledKotlinWithStdlib/mutability/LoadIterableWithNullability.txt b/compiler/testData/loadJava/compiledKotlinWithStdlib/mutability/LoadIterableWithNullability.txt index 4bdffe33d39..46a7ebe28e7 100644 --- a/compiler/testData/loadJava/compiledKotlinWithStdlib/mutability/LoadIterableWithNullability.txt +++ b/compiler/testData/loadJava/compiledKotlinWithStdlib/mutability/LoadIterableWithNullability.txt @@ -1,8 +1,8 @@ package test public interface LoadIterableWithNullability { - @org.jetbrains.annotations.Mutable public abstract fun getIterable(): kotlin.collections.MutableIterable - @org.jetbrains.annotations.ReadOnly public abstract fun getReadOnlyIterable(): kotlin.collections.Iterable - public abstract fun setIterable(/*0*/ @org.jetbrains.annotations.Mutable p0: kotlin.collections.MutableIterable): kotlin.Unit - public abstract fun setReadOnlyIterable(/*0*/ @org.jetbrains.annotations.ReadOnly p0: kotlin.collections.Iterable): kotlin.Unit + @kotlin.annotations.jvm.Mutable public abstract fun getIterable(): kotlin.collections.MutableIterable + @kotlin.annotations.jvm.ReadOnly public abstract fun getReadOnlyIterable(): kotlin.collections.Iterable + public abstract fun setIterable(/*0*/ @kotlin.annotations.jvm.Mutable p0: kotlin.collections.MutableIterable): kotlin.Unit + public abstract fun setReadOnlyIterable(/*0*/ @kotlin.annotations.jvm.ReadOnly p0: kotlin.collections.Iterable): kotlin.Unit } diff --git a/compiler/testData/loadJava/compiledKotlinWithStdlib/mutability/LoadIterableWithPropagation.kt b/compiler/testData/loadJava/compiledKotlinWithStdlib/mutability/LoadIterableWithPropagation.kt index 45df66a5873..5feda3c39a2 100644 --- a/compiler/testData/loadJava/compiledKotlinWithStdlib/mutability/LoadIterableWithPropagation.kt +++ b/compiler/testData/loadJava/compiledKotlinWithStdlib/mutability/LoadIterableWithPropagation.kt @@ -1,7 +1,8 @@ +// JVM_ANNOTATIONS package test import java.util.ArrayList -import org.jetbrains.annotations.* +import kotlin.annotations.jvm.* public interface LoadIterableWithPropagation { public interface LoadIterable { diff --git a/compiler/testData/loadJava/compiledKotlinWithStdlib/mutability/LoadIterableWithPropagation.txt b/compiler/testData/loadJava/compiledKotlinWithStdlib/mutability/LoadIterableWithPropagation.txt index f88919b6e0f..2b4391f7295 100644 --- a/compiler/testData/loadJava/compiledKotlinWithStdlib/mutability/LoadIterableWithPropagation.txt +++ b/compiler/testData/loadJava/compiledKotlinWithStdlib/mutability/LoadIterableWithPropagation.txt @@ -3,10 +3,10 @@ package test public interface LoadIterableWithPropagation { public interface LoadIterable { - @org.jetbrains.annotations.Mutable public abstract fun getIterable(): kotlin.collections.MutableIterable? - @org.jetbrains.annotations.ReadOnly public abstract fun getReadOnlyIterable(): kotlin.collections.Iterable? - public abstract fun setIterable(/*0*/ @org.jetbrains.annotations.Mutable p0: kotlin.collections.MutableIterable?): kotlin.Unit - public abstract fun setReadOnlyIterable(/*0*/ @org.jetbrains.annotations.ReadOnly p0: kotlin.collections.Iterable?): kotlin.Unit + @kotlin.annotations.jvm.Mutable public abstract fun getIterable(): kotlin.collections.MutableIterable? + @kotlin.annotations.jvm.ReadOnly public abstract fun getReadOnlyIterable(): kotlin.collections.Iterable? + public abstract fun setIterable(/*0*/ @kotlin.annotations.jvm.Mutable p0: kotlin.collections.MutableIterable?): kotlin.Unit + public abstract fun setReadOnlyIterable(/*0*/ @kotlin.annotations.jvm.ReadOnly p0: kotlin.collections.Iterable?): kotlin.Unit } public open class LoadIterableImpl : test.LoadIterableWithPropagation.LoadIterable { diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/AbstractLoadJavaTest.java b/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/AbstractLoadJavaTest.java index f5d6fa7cb6d..0838f4db3d1 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/AbstractLoadJavaTest.java +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/AbstractLoadJavaTest.java @@ -26,6 +26,7 @@ import org.jetbrains.kotlin.cli.jvm.compiler.EnvironmentConfigFiles; import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment; import org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM; import org.jetbrains.kotlin.cli.jvm.config.JvmContentRootsKt; +import org.jetbrains.kotlin.codegen.forTestCompile.ForTestCompileRuntime; import org.jetbrains.kotlin.config.*; import org.jetbrains.kotlin.descriptors.ClassDescriptor; import org.jetbrains.kotlin.descriptors.DeclarationDescriptor; @@ -118,7 +119,7 @@ public abstract class AbstractLoadJavaTest extends TestCaseWithTmpdir { if (useTypeTableInSerializer) { configuration.put(JVMConfigurationKeys.USE_TYPE_TABLE, true); } - updateConfigurationWithLanguageVersionDirective(ktFile, configuration); + updateConfigurationWithDirectives(ktFile, configuration); KotlinCoreEnvironment environment = KotlinCoreEnvironment.createForTests(getTestRootDisposable(), configuration, EnvironmentConfigFiles.JVM_CONFIG_FILES); @@ -145,8 +146,9 @@ public abstract class AbstractLoadJavaTest extends TestCaseWithTmpdir { compareDescriptors(packageFromSource, packageFromBinary, comparatorConfiguration, txtFile); } - private static void updateConfigurationWithLanguageVersionDirective(File file, CompilerConfiguration configuration) throws IOException { - String version = InTextDirectivesUtils.findStringWithPrefixes(FileUtil.loadFile(file, true), "// LANGUAGE_VERSION:"); + private static void updateConfigurationWithDirectives(File file, CompilerConfiguration configuration) throws IOException { + String content = FileUtil.loadFile(file, true); + String version = InTextDirectivesUtils.findStringWithPrefixes(content, "// LANGUAGE_VERSION:"); if (version != null) { LanguageVersion explicitVersion = LanguageVersion.fromVersionString(version); CommonConfigurationKeysKt.setLanguageVersionSettings( @@ -154,6 +156,14 @@ public abstract class AbstractLoadJavaTest extends TestCaseWithTmpdir { new LanguageVersionSettingsImpl(explicitVersion, ApiVersion.createByLanguageVersion(explicitVersion)) ); } + + if (InTextDirectivesUtils.isDirectiveDefined(content, "ANDROID_ANNOTATIONS")) { + JvmContentRootsKt.addJvmClasspathRoot(configuration, ForTestCompileRuntime.androidAnnotationsForTests()); + } + + if (InTextDirectivesUtils.isDirectiveDefined(content, "JVM_ANNOTATIONS")) { + JvmContentRootsKt.addJvmClasspathRoot(configuration, ForTestCompileRuntime.jvmAnnotationsForTests()); + } } protected boolean useFastClassFilesReading() { diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/LoadDescriptorUtil.java b/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/LoadDescriptorUtil.java index 7b6d8e3d908..aee4483de65 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/LoadDescriptorUtil.java +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/LoadDescriptorUtil.java @@ -87,7 +87,9 @@ public class LoadDescriptorUtil { @Nullable LanguageVersionSettings explicitLanguageVersionSettings ) { List javaBinaryRoots = new ArrayList<>(); + // TODO: use the same additional binary roots as those were used for compilation javaBinaryRoots.add(KotlinTestUtils.getAnnotationsJar()); + javaBinaryRoots.add(ForTestCompileRuntime.jvmAnnotationsForTests()); List javaSourceRoots = new ArrayList<>(); javaSourceRoots.add(new File("compiler/testData/loadJava/include")); @@ -127,6 +129,10 @@ public class LoadDescriptorUtil { if (InTextDirectivesUtils.isDirectiveDefined(content, "ANDROID_ANNOTATIONS")) { classpath.add(ForTestCompileRuntime.androidAnnotationsForTests()); } + + if (InTextDirectivesUtils.isDirectiveDefined(content, "JVM_ANNOTATIONS")) { + classpath.add(ForTestCompileRuntime.jvmAnnotationsForTests()); + } } KotlinTestUtils.compileJavaFiles(javaFiles, Arrays.asList(