From ad1907f48d8c9036cbd5058dfd42f375d634c24e Mon Sep 17 00:00:00 2001 From: Nikolay Krasko Date: Fri, 29 Jul 2016 16:05:07 +0300 Subject: [PATCH] Refresh output dirs to make CompilerPaths.getModuleOutputDirectory() method work --- .../kotlin/idea/debugger/KotlinDebuggerTestCase.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinDebuggerTestCase.java b/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinDebuggerTestCase.java index 85472d9524f..2892d74de7c 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinDebuggerTestCase.java +++ b/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinDebuggerTestCase.java @@ -16,6 +16,8 @@ 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.OutputChecker; import com.intellij.execution.configurations.JavaParameters; @@ -115,18 +117,20 @@ public abstract class KotlinDebuggerTestCase extends DescriptorTestCase { IdeaTestUtil.setModuleLanguageLevel(myModule, LanguageLevel.JDK_1_6); + String outputDirPath = getAppOutputPath(); + File outDir = new File(outputDirPath); + if (!IS_TINY_APP_COMPILED) { String modulePath = getTestAppPath(); CUSTOM_LIBRARY_JAR = MockLibraryUtil.compileLibraryToJar(CUSTOM_LIBRARY_SOURCES.getPath(), "debuggerCustomLibrary", false, false); - String outputDir = getAppOutputPath(); 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 options = Arrays.asList("-d", outputDir, "-classpath", ForTestCompileRuntime.runtimeJarForTests().getPath()); + List options = Arrays.asList("-d", outputDirPath, "-classpath", ForTestCompileRuntime.runtimeJarForTests().getPath()); try { KotlinTestUtils.compileJavaFiles(findJavaFiles(new File(sourcesDir)), options); } @@ -137,6 +141,8 @@ public abstract class KotlinDebuggerTestCase extends DescriptorTestCase { IS_TINY_APP_COMPILED = true; } + CompilerUtil.refreshOutputDirectories(Lists.newArrayList(outDir), false); + ApplicationManager.getApplication().runWriteAction(new Runnable() { @Override public void run() {