Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter problems in mimaFindBinaryIssues #793

Closed
wants to merge 1 commit into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ object MimaPlugin extends AutoPlugin {
val excludeAnnots = mimaExcludeAnnotations.value.toList
val failOnNoPrevious = mimaFailOnNoPrevious.value
val projName = name.value
val filters = mimaBinaryIssueFilters.value
val backwardFilters = mimaBackwardIssueFilters.value
val forwardFilters = mimaForwardIssueFilters.value

(prevClassfiles, checkDirection) => {
if (prevClassfiles eq NoPreviousClassfiles) {
Expand All @@ -96,7 +99,12 @@ object MimaPlugin extends AutoPlugin {
}

prevClassfiles.iterator.map { case (moduleId, prevClassfiles) =>
moduleId -> SbtMima.runMima(prevClassfiles, currClassfiles, cp, checkDirection, sv, log, excludeAnnots)
val (backwardProblems, forwardProblems) = SbtMima.runMima(prevClassfiles, currClassfiles, cp, checkDirection, sv, log, excludeAnnots)
def isReported(versionedFilters: Map[String, Seq[ProblemFilter]])(problem: Problem) =
ProblemReporting.isReported(moduleId.revision, filters, versionedFilters)(problem)
val filteredBackwardProblems = backwardProblems.filter(isReported(backwardFilters))
val filteredForwardProblems = forwardProblems.filter(isReported(forwardFilters))
moduleId -> (filteredBackwardProblems, filteredForwardProblems)
}
}
}
Expand Down
Loading