Add extended annotation to test environment

This commit is contained in:
Alexey Sedunov
2013-03-29 16:10:35 +04:00
parent 393ebf44aa
commit fc7bb67aca
2 changed files with 8 additions and 2 deletions
@@ -226,7 +226,7 @@ public class JetTestUtils {
@NotNull TestJdkKind jdkKind @NotNull TestJdkKind jdkKind
) { ) {
return new JetCoreEnvironment(disposable, compilerConfigurationForTests( return new JetCoreEnvironment(disposable, compilerConfigurationForTests(
configurationKind, jdkKind, getAnnotationsJar())); configurationKind, jdkKind, getAnnotationsJar(), getAnnotationsExtJar()));
} }
public static File findMockJdkRtJar() { public static File findMockJdkRtJar() {
@@ -237,6 +237,10 @@ public class JetTestUtils {
return new File(JetTestCaseBuilder.getHomeDirectory(), "compiler/testData/mockJDK/jre/lib/annotations.jar"); return new File(JetTestCaseBuilder.getHomeDirectory(), "compiler/testData/mockJDK/jre/lib/annotations.jar");
} }
public static File getAnnotationsExtJar() {
return new File(JetTestCaseBuilder.getHomeDirectory(), "dist/kotlinc/lib/kotlin-annotations-ext.jar");
}
public static void mkdirs(File file) throws IOException { public static void mkdirs(File file) throws IOException {
if (file.isDirectory()) { if (file.isDirectory()) {
return; return;
@@ -121,7 +121,9 @@ public final class LoadDescriptorUtil {
} }
private static void compileJavaWithAnnotationsJar(@NotNull Collection<File> javaFiles, @NotNull File outDir) throws IOException { private static void compileJavaWithAnnotationsJar(@NotNull Collection<File> javaFiles, @NotNull File outDir) throws IOException {
String classPath = "out/production/runtime" + File.pathSeparator + JetTestUtils.getAnnotationsJar().getPath(); String classPath = "out/production/runtime" +
File.pathSeparator + JetTestUtils.getAnnotationsJar().getPath() +
File.pathSeparator + JetTestUtils.getAnnotationsExtJar().getPath();
JetTestUtils.compileJavaFiles(javaFiles, Arrays.asList( JetTestUtils.compileJavaFiles(javaFiles, Arrays.asList(
"-classpath", classPath, "-classpath", classPath,
"-sourcepath", "compiler/tests", // for @ExpectLoadError annotation "-sourcepath", "compiler/tests", // for @ExpectLoadError annotation