Refresh output dirs to make CompilerPaths.getModuleOutputDirectory() method work
This commit is contained in:
@@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.idea.debugger;
|
package org.jetbrains.kotlin.idea.debugger;
|
||||||
|
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
|
import com.intellij.compiler.impl.CompilerUtil;
|
||||||
import com.intellij.debugger.impl.DescriptorTestCase;
|
import com.intellij.debugger.impl.DescriptorTestCase;
|
||||||
import com.intellij.debugger.impl.OutputChecker;
|
import com.intellij.debugger.impl.OutputChecker;
|
||||||
import com.intellij.execution.configurations.JavaParameters;
|
import com.intellij.execution.configurations.JavaParameters;
|
||||||
@@ -115,18 +117,20 @@ public abstract class KotlinDebuggerTestCase extends DescriptorTestCase {
|
|||||||
|
|
||||||
IdeaTestUtil.setModuleLanguageLevel(myModule, LanguageLevel.JDK_1_6);
|
IdeaTestUtil.setModuleLanguageLevel(myModule, LanguageLevel.JDK_1_6);
|
||||||
|
|
||||||
|
String outputDirPath = getAppOutputPath();
|
||||||
|
File outDir = new File(outputDirPath);
|
||||||
|
|
||||||
if (!IS_TINY_APP_COMPILED) {
|
if (!IS_TINY_APP_COMPILED) {
|
||||||
String modulePath = getTestAppPath();
|
String modulePath = getTestAppPath();
|
||||||
|
|
||||||
CUSTOM_LIBRARY_JAR = MockLibraryUtil.compileLibraryToJar(CUSTOM_LIBRARY_SOURCES.getPath(), "debuggerCustomLibrary", false,
|
CUSTOM_LIBRARY_JAR = MockLibraryUtil.compileLibraryToJar(CUSTOM_LIBRARY_SOURCES.getPath(), "debuggerCustomLibrary", false,
|
||||||
false);
|
false);
|
||||||
|
|
||||||
String outputDir = getAppOutputPath();
|
|
||||||
String sourcesDir = modulePath + File.separator + "src";
|
String sourcesDir = modulePath + File.separator + "src";
|
||||||
|
|
||||||
MockLibraryUtil.compileKotlin(sourcesDir, new File(outputDir), CUSTOM_LIBRARY_JAR.getPath());
|
MockLibraryUtil.compileKotlin(sourcesDir, outDir, CUSTOM_LIBRARY_JAR.getPath());
|
||||||
|
|
||||||
List<String> options = Arrays.asList("-d", outputDir, "-classpath", ForTestCompileRuntime.runtimeJarForTests().getPath());
|
List<String> options = Arrays.asList("-d", outputDirPath, "-classpath", ForTestCompileRuntime.runtimeJarForTests().getPath());
|
||||||
try {
|
try {
|
||||||
KotlinTestUtils.compileJavaFiles(findJavaFiles(new File(sourcesDir)), options);
|
KotlinTestUtils.compileJavaFiles(findJavaFiles(new File(sourcesDir)), options);
|
||||||
}
|
}
|
||||||
@@ -137,6 +141,8 @@ public abstract class KotlinDebuggerTestCase extends DescriptorTestCase {
|
|||||||
IS_TINY_APP_COMPILED = true;
|
IS_TINY_APP_COMPILED = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CompilerUtil.refreshOutputDirectories(Lists.newArrayList(outDir), false);
|
||||||
|
|
||||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|||||||
Reference in New Issue
Block a user