boolean (JpsModule module, JpsDependencyElement dependencyElement, Consumer<? super String> urlConsumer) { boolean includeProduction, includeTests; if (dependencyElement instanceof JpsModuleDependency) { boolean productionOnTests = myDependenciesEnumerator.isProductionOnTests(dependencyElement); includeProduction = !productionOnTests; includeTests = !myDependenciesEnumerator.isProductionOnly() && myDependenciesEnumerator.shouldIncludeTestsFromDependentModulesToTestClasspath() || productionOnTests; } else { includeProduction = true; includeTests = !myDependenciesEnumerator.isProductionOnly(); } if (myRootType == JpsOrderRootType.SOURCES) { for (JpsModuleSourceRoot root : module.getSourceRoots()) { JpsModuleSourceRootType<?> type = root.getRootType(); if (type.equals(JavaSourceRootType.SOURCE) && includeProduction || type.equals(JavaSourceRootType.TEST_SOURCE) && includeTests) { urlConsumer.accept(root.getUrl()); } } } else if (myRootType == JpsOrderRootType.COMPILED) { JpsJavaExtensionService extensionService = JpsJavaExtensionService.getInstance(); if (myWithoutSelfModuleOutput && myDependenciesEnumerator.isEnumerationRootModule(module)) { if (includeProduction && includeTests) { String url = extensionService.getOutputUrl(module, false); if (url != null) { urlConsumer.accept(url); } } } else { String outputUrl = extensionService.getOutputUrl(module, false); if (includeTests) { String testsOutputUrl = extensionService.getOutputUrl(module, true); if (testsOutputUrl != null && !testsOutputUrl.equals(outputUrl)) { urlConsumer.accept(testsOutputUrl); } } if (includeProduction && outputUrl != null) { urlConsumer.accept(outputUrl); } } } else if (myRootType == JpsAnnotationRootType.INSTANCE) { JpsJavaModuleExtension extension = JpsJavaExtensionService.getInstance().getModuleExtension(module); if (extension != null) { for (String url : extension.getAnnotationRoots().getUrls()) { urlConsumer.accept(url); } } } return true; }