From 544eb4e82714c7c0896907e827e9cb03f8181305 Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Tue, 19 Jun 2018 18:53:38 +0300 Subject: [PATCH] IDEA plugin: don't load dependencies transitively, since IDEA provides all necessary dependencies --- .../main/java/org/teavm/idea/jps/TeaVMBuild.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tools/idea/jps-plugin/src/main/java/org/teavm/idea/jps/TeaVMBuild.java b/tools/idea/jps-plugin/src/main/java/org/teavm/idea/jps/TeaVMBuild.java index 402a50cc0..a44e5059e 100644 --- a/tools/idea/jps-plugin/src/main/java/org/teavm/idea/jps/TeaVMBuild.java +++ b/tools/idea/jps-plugin/src/main/java/org/teavm/idea/jps/TeaVMBuild.java @@ -99,7 +99,7 @@ class TeaVMBuild { classPathEntries.clear(); buildStrategy.init(); - buildClassPath(module, new HashSet<>()); + buildClassPath(module); directoryClassPathEntries = classPathEntries.stream().filter(name -> new File(name).isDirectory()) .collect(toList()); @@ -471,10 +471,7 @@ class TeaVMBuild { return null; } - private void buildClassPath(JpsModule module, Set visited) { - if (!visited.add(module)) { - return; - } + private void buildClassPath(JpsModule module) { File output = JpsJavaExtensionService.getInstance().getOutputDirectory(module, false); if (output != null) { classPathEntries.add(output.getPath()); @@ -487,7 +484,11 @@ class TeaVMBuild { for (JpsDependencyElement dependency : module.getDependenciesList().getDependencies()) { if (dependency instanceof JpsModuleDependency) { JpsModuleDependency moduleDependency = (JpsModuleDependency) dependency; - buildClassPath(moduleDependency.getModule(), visited); + File dependencyOutput = JpsJavaExtensionService.getInstance().getOutputDirectory( + moduleDependency.getModule(), false); + if (dependencyOutput != null) { + classPathEntries.add(dependencyOutput.getPath()); + } } else if (dependency instanceof JpsLibraryDependency) { JpsLibrary library = ((JpsLibraryDependency) dependency).getLibrary(); if (library == null) {