Minor, don't create empty tmpdir in codegen tests w/o Java
This commit is contained in:
@@ -104,6 +104,8 @@ public abstract class AbstractBlackBoxCodegenTest extends CodegenTestCase {
|
|||||||
myEnvironment.getProject(), myFiles.getPsiFiles(), new JvmPackagePartProvider(myEnvironment)
|
myEnvironment.getProject(), myFiles.getPsiFiles(), new JvmPackagePartProvider(myEnvironment)
|
||||||
).getFactory();
|
).getFactory();
|
||||||
|
|
||||||
|
if (javaSourceDir != null) {
|
||||||
|
// If there are Java files, they should be compiled against the class files produced by Kotlin, so we dump them to the disk
|
||||||
File kotlinOut;
|
File kotlinOut;
|
||||||
try {
|
try {
|
||||||
kotlinOut = KotlinTestUtils.tmpDir(toString());
|
kotlinOut = KotlinTestUtils.tmpDir(toString());
|
||||||
@@ -114,13 +116,13 @@ public abstract class AbstractBlackBoxCodegenTest extends CodegenTestCase {
|
|||||||
|
|
||||||
OutputUtilsKt.writeAllTo(classFileFactory, kotlinOut);
|
OutputUtilsKt.writeAllTo(classFileFactory, kotlinOut);
|
||||||
|
|
||||||
if (javaSourceDir != null) {
|
|
||||||
File output = CodegenTestUtil.compileJava(
|
File output = CodegenTestUtil.compileJava(
|
||||||
findJavaSourcesInDirectory(javaSourceDir), Collections.singletonList(kotlinOut.getPath()), javacOptions
|
findJavaSourcesInDirectory(javaSourceDir), Collections.singletonList(kotlinOut.getPath()), javacOptions
|
||||||
);
|
);
|
||||||
// Add javac output to classpath so that the created class loader can find generated Java classes
|
// Add javac output to classpath so that the created class loader can find generated Java classes
|
||||||
JvmContentRootsKt.addJvmClasspathRoot(configuration, output);
|
JvmContentRootsKt.addJvmClasspathRoot(configuration, output);
|
||||||
}
|
}
|
||||||
|
|
||||||
blackBox();
|
blackBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user