Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions changelog/@unreleased/pr-885.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: fix
fix:
description: checkJunitDependencies only checks Java source
links:
- https://github.com/palantir/gradle-baseline/pull/885
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ private boolean hasDep(String configurationName, Predicate<ModuleVersionIdentifi
}

private boolean sourceSetMentionsJUnit4(SourceSet ss) {
return !ss.getAllSource()
return !ss.getAllJava()
.filter(file -> fileContainsSubstring(file, l ->
l.contains("org.junit.Test")
|| l.contains("org.junit.runner")
Expand All @@ -143,7 +143,7 @@ private boolean sourceSetMentionsJUnit4(SourceSet ss) {
}

private boolean sourceSetMentionsJUnit5Api(SourceSet ss) {
return !ss.getAllSource()
return !ss.getAllJava()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this scan Groovy, Scala, Kotlin, etc. or only **/*.java?

Copy link
Contributor Author

.filter(file -> fileContainsSubstring(file, l -> l.contains("org.junit.jupiter.api.")))
.isEmpty();
}
Expand Down