mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
don't set dependency scope to 'test' for newly added groovy library
This commit is contained in:
@@ -17,8 +17,10 @@ package com.intellij.execution.junit;
|
||||
|
||||
import com.intellij.openapi.roots.DependencyScope;
|
||||
import com.intellij.openapi.roots.LibraryDependencyScopeSuggester;
|
||||
import com.intellij.openapi.roots.OrderRootType;
|
||||
import com.intellij.openapi.roots.libraries.Library;
|
||||
import com.intellij.openapi.roots.libraries.LibraryUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -29,8 +31,9 @@ public class JUnitDependencyScopeSuggester extends LibraryDependencyScopeSuggest
|
||||
@Nullable
|
||||
@Override
|
||||
public DependencyScope getDefaultDependencyScope(@NotNull Library library) {
|
||||
if (LibraryUtil.isClassAvailableInLibrary(library, "junit.framework.TestCase")
|
||||
|| LibraryUtil.isClassAvailableInLibrary(library, "org.junit.Test")) {
|
||||
VirtualFile[] files = library.getFiles(OrderRootType.CLASSES);
|
||||
if (files.length == 1 && (LibraryUtil.isClassAvailableInLibrary(files, "junit.framework.TestCase")
|
||||
|| LibraryUtil.isClassAvailableInLibrary(library, "org.junit.Test"))) {
|
||||
return DependencyScope.TEST;
|
||||
}
|
||||
return null;
|
||||
|
||||
+4
-1
@@ -17,8 +17,10 @@ package com.theoryinpractice.testng.configuration;
|
||||
|
||||
import com.intellij.openapi.roots.DependencyScope;
|
||||
import com.intellij.openapi.roots.LibraryDependencyScopeSuggester;
|
||||
import com.intellij.openapi.roots.OrderRootType;
|
||||
import com.intellij.openapi.roots.libraries.Library;
|
||||
import com.intellij.openapi.roots.libraries.LibraryUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -29,7 +31,8 @@ public class TestNGDependencyScopeSuggester extends LibraryDependencyScopeSugges
|
||||
@Nullable
|
||||
@Override
|
||||
public DependencyScope getDefaultDependencyScope(@NotNull Library library) {
|
||||
if (LibraryUtil.isClassAvailableInLibrary(library, "org.testng.annotations.Test")) {
|
||||
VirtualFile[] files = library.getFiles(OrderRootType.CLASSES);
|
||||
if (files.length == 1 && LibraryUtil.isClassAvailableInLibrary(files, "org.testng.annotations.Test")) {
|
||||
return DependencyScope.TEST;
|
||||
}
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user