From 5c18cfebd13f754c60840def66940fbf57856dcc Mon Sep 17 00:00:00 2001 From: Michael Bogdanov Date: Sat, 18 Apr 2015 12:10:48 +0300 Subject: [PATCH] Support several java file compiling --- .../kotlin/codegen/CodegenTestUtil.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/CodegenTestUtil.java b/compiler/tests/org/jetbrains/kotlin/codegen/CodegenTestUtil.java index 186319c3eee..6fc24ca8a9b 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/CodegenTestUtil.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/CodegenTestUtil.java @@ -16,6 +16,9 @@ package org.jetbrains.kotlin.codegen; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import com.google.common.collect.Lists; import com.intellij.openapi.util.SystemInfo; import kotlin.KotlinPackage; import org.jetbrains.annotations.NotNull; @@ -118,6 +121,11 @@ public class CodegenTestUtil { @NotNull public static File compileJava(@NotNull String filename, @NotNull String... additionalClasspath) { + return compileJava(Collections.singletonList(filename), additionalClasspath); + } + + @NotNull + public static File compileJava(@NotNull List filenames, @NotNull String... additionalClasspath) { try { File javaClassesTempDirectory = JetTestUtils.tmpDir("java-classes"); List classpath = new ArrayList(); @@ -130,8 +138,14 @@ public class CodegenTestUtil { "-d", javaClassesTempDirectory.getPath() ); - File javaFile = new File(JetTestUtils.getTestDataPathBase() + "/codegen/" + filename); - JetTestUtils.compileJavaFiles(Collections.singleton(javaFile), options); + List fileList = Lists.transform(filenames, new Function() { + @Override + public File apply(@Nullable String input) { + return new File(JetTestUtils.getTestDataPathBase() + "/codegen/" + input); + } + }); + + JetTestUtils.compileJavaFiles(fileList, options); return javaClassesTempDirectory; }