Skip to content

Commit

Permalink
improve ImportOption DoNotIncludeTests for IntelliJ
Browse files Browse the repository at this point in the history
Plain IntelliJ projects (i.e. set up without any build tool) now seem to use the pattern `out/test/$MODULE_NAME` to compile class files to. Since we can safely assume that everything built into `out/test` belongs to the test scope, we can adjust the IntelliJ pattern to exclude everything in `.*/out/test/.*` to catch all cases, no matter if set up with a build tool or directly with IntelliJ.

Issue: TNG#696

Signed-off-by: Cook, Jeremy <[email protected]>
  • Loading branch information
JCook21 authored and codecholeric committed Mar 2, 2022
1 parent 40c15c6 commit 3d15622
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public boolean includes(Location location) {

static final PatternPredicate MAVEN_TEST_PATTERN = new PatternPredicate(".*/target/test-classes/.*");
static final PatternPredicate GRADLE_TEST_PATTERN = new PatternPredicate(".*/build/classes/([^/]+/)?test/.*");
static final PatternPredicate INTELLIJ_TEST_PATTERN = new PatternPredicate(".*/out/test/classes/.*");
static final PatternPredicate INTELLIJ_TEST_PATTERN = new PatternPredicate(".*/out/test/.*");
static final Predicate<Location> TEST_LOCATION = or(MAVEN_TEST_PATTERN, GRADLE_TEST_PATTERN, INTELLIJ_TEST_PATTERN);
static final Predicate<Location> NO_TEST_LOCATION = not(TEST_LOCATION);

Expand Down

0 comments on commit 3d15622

Please sign in to comment.