IDEA plugin: don't load dependencies transitively, since IDEA provides all necessary dependencies

This commit is contained in:
Alexey Andreev 2018-06-19 18:53:38 +03:00
parent dc99ead514
commit 544eb4e827

View File

@ -99,7 +99,7 @@ class TeaVMBuild {
classPathEntries.clear(); classPathEntries.clear();
buildStrategy.init(); buildStrategy.init();
buildClassPath(module, new HashSet<>()); buildClassPath(module);
directoryClassPathEntries = classPathEntries.stream().filter(name -> new File(name).isDirectory()) directoryClassPathEntries = classPathEntries.stream().filter(name -> new File(name).isDirectory())
.collect(toList()); .collect(toList());
@ -471,10 +471,7 @@ class TeaVMBuild {
return null; return null;
} }
private void buildClassPath(JpsModule module, Set<JpsModule> visited) { private void buildClassPath(JpsModule module) {
if (!visited.add(module)) {
return;
}
File output = JpsJavaExtensionService.getInstance().getOutputDirectory(module, false); File output = JpsJavaExtensionService.getInstance().getOutputDirectory(module, false);
if (output != null) { if (output != null) {
classPathEntries.add(output.getPath()); classPathEntries.add(output.getPath());
@ -487,7 +484,11 @@ class TeaVMBuild {
for (JpsDependencyElement dependency : module.getDependenciesList().getDependencies()) { for (JpsDependencyElement dependency : module.getDependenciesList().getDependencies()) {
if (dependency instanceof JpsModuleDependency) { if (dependency instanceof JpsModuleDependency) {
JpsModuleDependency moduleDependency = (JpsModuleDependency) dependency; 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) { } else if (dependency instanceof JpsLibraryDependency) {
JpsLibrary library = ((JpsLibraryDependency) dependency).getLibrary(); JpsLibrary library = ((JpsLibraryDependency) dependency).getLibrary();
if (library == null) { if (library == null) {