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

Expose more in RichUpdateReport #84

Merged
merged 2 commits into from
Apr 13, 2017
Merged

Expose more in RichUpdateReport #84

merged 2 commits into from
Apr 13, 2017

Conversation

dwijnand
Copy link
Member

Fixes #83

Copy link
Member

@eed3si9n eed3si9n left a comment

Choose a reason for hiding this comment

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

Some minor nitpicks.

@@ -15,10 +18,10 @@ final class RichUpdateReport(report: UpdateReport) {
import DependencyFilter._

/** Obtains all successfully retrieved files in all configurations and modules. */
private[sbt] def allFiles: Seq[File] = matching(DependencyFilter.allPass)
def allFiles: Seq[File] = matching(DependencyFilter.allPass)
Copy link
Member

Choose a reason for hiding this comment

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

Let's use Vectors.


/** Obtains all successfully retrieved files in configurations, modules, and artifacts matching the specified filter. */
private[sbt] def matching(f: DependencyFilter): Seq[File] = select0(f).distinct
def matching(f: DependencyFilter): Seq[File] = select0(f).distinct
Copy link
Member

Choose a reason for hiding this comment

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

Same return Vector.

@@ -50,11 +63,19 @@ final class RichUpdateReport(report: UpdateReport) {
.withMissingArtifacts(modReport.missingArtifacts)
}

private[sbt] def toSeq: Seq[(String, ModuleID, Artifact, File)] =
for (confReport <- report.configurations; modReport <- confReport.modules; (artifact, file) <- modReport.artifacts) yield (confReport.configuration, modReport.module, artifact, file)
def toSeq: Seq[(String, ModuleID, Artifact, File)] =
Copy link
Member

Choose a reason for hiding this comment

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

toVector and then add toSeq that calls toVector.


private[sbt] def allMissing: Seq[(String, ModuleID, Artifact)] =
for (confReport <- report.configurations; modReport <- confReport.modules; artifact <- modReport.missingArtifacts) yield (confReport.configuration, modReport.module, artifact)
def allMissing: Seq[(String, ModuleID, Artifact)] =
Copy link
Member

Choose a reason for hiding this comment

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

Same.

(artifact, file) <- mReport.artifacts
if f(cReport.configuration, mReport.module, artifact)
} yield {
if (file == null)
Copy link
Member

Choose a reason for hiding this comment

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

I think we should either use Option(file).orElse { ... } or put { .. } around sys.error.

@eed3si9n eed3si9n merged commit 4e36931 into sbt:1.0 Apr 13, 2017
@dwijnand dwijnand deleted the expose-more-RichUpdateReport branch April 13, 2017 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants