Minor refacto

This commit is contained in:
Alexandre Archambault 2016-07-25 00:19:06 +02:00
parent f46581288f
commit 4d73166fbc
No known key found for this signature in database
GPG Key ID: 14640A6839C263A9
1 changed files with 6 additions and 13 deletions

View File

@ -948,20 +948,13 @@ final case class Resolution(
private def artifacts0(
overrideClassifiers: Option[Seq[String]],
keepAttributes: Boolean
): Seq[Artifact] = {
val res = for {
dep <- minDependencies.toSeq
(source, proj) <- projectCache
.get(dep.moduleVersion)
.toSeq
artifact <- source
.artifacts(dep, proj, overrideClassifiers)
} yield (if (keepAttributes) artifact else artifact.copy(attributes = Attributes("", "")))
): Seq[Artifact] =
dependencyArtifacts0(overrideClassifiers).map {
case (_, artifact) =>
if (keepAttributes) artifact else artifact.copy(attributes = Attributes("", ""))
}.distinct
res.distinct
}
// temporary hack :-|
// keepAttributes to false is a temporary hack :-|
// if one wants the attributes field of artifacts not to be cleared, call dependencyArtifacts
def classifiersArtifacts(classifiers: Seq[String]): Seq[Artifact] =