IDEADEV-40483 Maven: runtime dependencies should be on the test classpath

This commit is contained in:
Dmitry Avdeev
2009-09-23 11:52:49 +04:00
parent 16134fdf3f
commit 7d0767b77e
3 changed files with 4 additions and 12 deletions
@@ -88,10 +88,8 @@ public class ModuleWithDependenciesScope extends GlobalSearchScope {
}
}
if (orderEntry instanceof ExportableOrderEntry) {
if (((ExportableOrderEntry)orderEntry).getScope() == DependencyScope.RUNTIME) {
continue;
}
if (!myIncludeTests && ((ExportableOrderEntry)orderEntry).getScope() == DependencyScope.TEST) {
DependencyScope scope = ((ExportableOrderEntry)orderEntry).getScope();
if (!myIncludeTests && (scope == DependencyScope.TEST || scope == DependencyScope.RUNTIME)) {
continue;
}
}
@@ -73,9 +73,6 @@ abstract class LibraryOrderEntryBaseImpl extends OrderEntryBaseImpl {
@NotNull
public VirtualFile[] getFiles(OrderRootType type) {
if (type == OrderRootType.COMPILATION_CLASSES) {
if (myScope == DependencyScope.RUNTIME) {
return VirtualFile.EMPTY_ARRAY;
}
return myRootContainers.get(OrderRootType.CLASSES).getDirectories();
}
else if (type == OrderRootType.PRODUCTION_COMPILATION_CLASSES) {
@@ -94,9 +91,6 @@ abstract class LibraryOrderEntryBaseImpl extends OrderEntryBaseImpl {
public String[] getUrls(OrderRootType type) {
LOG.assertTrue(!getRootModel().getModule().isDisposed());
if (type == OrderRootType.COMPILATION_CLASSES) {
if (myScope == DependencyScope.RUNTIME) {
return ArrayUtil.EMPTY_STRING_ARRAY;
}
return myRootContainers.get(OrderRootType.CLASSES).getUrls();
}
else if (type == OrderRootType.PRODUCTION_COMPILATION_CLASSES) {
@@ -110,7 +110,7 @@ public class ModuleOrderEntryImpl extends OrderEntryBaseImpl implements ModuleOr
VirtualFile[] getFiles(OrderRootType type, Set<Module> processed) {
if (myModule != null && !processed.contains(myModule) && !myModule.isDisposed()) {
processed.add(myModule);
if (myScope == DependencyScope.RUNTIME && (type == OrderRootType.COMPILATION_CLASSES || type == OrderRootType.PRODUCTION_COMPILATION_CLASSES)) {
if (myScope == DependencyScope.RUNTIME && type == OrderRootType.PRODUCTION_COMPILATION_CLASSES) {
return VirtualFile.EMPTY_ARRAY;
}
if (myScope == DependencyScope.TEST && type == OrderRootType.PRODUCTION_COMPILATION_CLASSES) {
@@ -134,7 +134,7 @@ public class ModuleOrderEntryImpl extends OrderEntryBaseImpl implements ModuleOr
public String[] getUrls (OrderRootType rootType, Set<Module> processed) {
if (myModule != null && !processed.contains(myModule) && !myModule.isDisposed()) {
processed.add(myModule);
if (myScope == DependencyScope.RUNTIME && (rootType == OrderRootType.COMPILATION_CLASSES || rootType == OrderRootType.PRODUCTION_COMPILATION_CLASSES)) {
if (myScope == DependencyScope.RUNTIME && rootType == OrderRootType.PRODUCTION_COMPILATION_CLASSES) {
return ArrayUtil.EMPTY_STRING_ARRAY;
}
if (myScope == DependencyScope.TEST && rootType == OrderRootType.PRODUCTION_COMPILATION_CLASSES) {