Support several java file compiling
This commit is contained in:
@@ -16,6 +16,9 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.codegen;
|
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 com.intellij.openapi.util.SystemInfo;
|
||||||
import kotlin.KotlinPackage;
|
import kotlin.KotlinPackage;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
@@ -118,6 +121,11 @@ public class CodegenTestUtil {
|
|||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static File compileJava(@NotNull String filename, @NotNull String... additionalClasspath) {
|
public static File compileJava(@NotNull String filename, @NotNull String... additionalClasspath) {
|
||||||
|
return compileJava(Collections.singletonList(filename), additionalClasspath);
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
public static File compileJava(@NotNull List<String> filenames, @NotNull String... additionalClasspath) {
|
||||||
try {
|
try {
|
||||||
File javaClassesTempDirectory = JetTestUtils.tmpDir("java-classes");
|
File javaClassesTempDirectory = JetTestUtils.tmpDir("java-classes");
|
||||||
List<String> classpath = new ArrayList<String>();
|
List<String> classpath = new ArrayList<String>();
|
||||||
@@ -130,8 +138,14 @@ public class CodegenTestUtil {
|
|||||||
"-d", javaClassesTempDirectory.getPath()
|
"-d", javaClassesTempDirectory.getPath()
|
||||||
);
|
);
|
||||||
|
|
||||||
File javaFile = new File(JetTestUtils.getTestDataPathBase() + "/codegen/" + filename);
|
List<File> fileList = Lists.transform(filenames, new Function<String, File>() {
|
||||||
JetTestUtils.compileJavaFiles(Collections.singleton(javaFile), options);
|
@Override
|
||||||
|
public File apply(@Nullable String input) {
|
||||||
|
return new File(JetTestUtils.getTestDataPathBase() + "/codegen/" + input);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
JetTestUtils.compileJavaFiles(fileList, options);
|
||||||
|
|
||||||
return javaClassesTempDirectory;
|
return javaClassesTempDirectory;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user