mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
gradle: remove vfs refresh from gradle order enumerator, custom module output roots will be refreshed by CompileDriver using CompilerPathsEx.getOutputPaths method;
issue: IDEA-151687 IDEA 15 (latest), EAP, and 16 EAP lockup hard on gradle refresh
This commit is contained in:
+12
@@ -17,6 +17,7 @@ package com.intellij.openapi.externalSystem.test;
|
||||
|
||||
import com.intellij.openapi.application.AccessToken;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.compiler.ex.CompilerPathsEx;
|
||||
import com.intellij.openapi.components.ServiceManager;
|
||||
import com.intellij.openapi.externalSystem.importing.ImportSpecBuilder;
|
||||
import com.intellij.openapi.externalSystem.model.DataNode;
|
||||
@@ -194,6 +195,17 @@ public abstract class ExternalSystemImportingTestCase extends ExternalSystemTest
|
||||
assertOrderedElementsAreEqual(actual, Arrays.asList(expected));
|
||||
}
|
||||
|
||||
protected void assertModuleOutputs(String moduleName, String... outputs) {
|
||||
String[] outputPaths = ContainerUtil.map2Array(CompilerPathsEx.getOutputPaths(new Module[]{getModule(moduleName)}), String.class,
|
||||
new Function<String, String>() {
|
||||
@Override
|
||||
public String fun(String s) {
|
||||
return getAbsolutePath(s);
|
||||
}
|
||||
});
|
||||
assertUnorderedElementsAreEqual(outputPaths, outputs);
|
||||
}
|
||||
|
||||
protected void assertModuleOutput(String moduleName, String output, String testOutput) {
|
||||
CompilerModuleExtension e = getCompilerExtension(moduleName);
|
||||
|
||||
|
||||
-10
@@ -123,16 +123,6 @@ public class GradleOrderEnumeratorHandler extends OrderEnumerationHandler {
|
||||
|
||||
if (directorySet.isCompilerOutputPathInherited()) return;
|
||||
final String path = directorySet.getOutputDir().getAbsolutePath();
|
||||
VirtualFile virtualFile = VirtualFileManager.getInstance().findFileByUrl(path);
|
||||
if (virtualFile == null) {
|
||||
if(!directorySet.getOutputDir().exists()){
|
||||
FileUtil.createDirectory(directorySet.getOutputDir());
|
||||
}
|
||||
ApplicationEx app = (ApplicationEx)ApplicationManager.getApplication();
|
||||
if (app.isDispatchThread() || !app.holdsReadLock()) {
|
||||
LocalFileSystem.getInstance().refreshAndFindFileByIoFile(directorySet.getOutputDir());
|
||||
}
|
||||
}
|
||||
result.add(VfsUtilCore.pathToUrl(path));
|
||||
}
|
||||
}
|
||||
|
||||
+7
@@ -38,6 +38,13 @@ public class GradleFoldersImportingTest extends GradleImportingTestCase {
|
||||
|
||||
assertDefaultGradleJavaProjectFolders("project");
|
||||
|
||||
assertModuleOutputs("project_main",
|
||||
getProjectPath() + "/build/classes/main",
|
||||
getProjectPath() + "/build/resources/main");
|
||||
assertModuleOutputs("project_test",
|
||||
getProjectPath() + "/build/classes/test",
|
||||
getProjectPath() + "/build/resources/test");
|
||||
|
||||
assertModuleOutput("project_main", getProjectPath() + "/build/classes/main", "");
|
||||
assertModuleOutput("project_test", "", getProjectPath() + "/build/classes/test");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user