Skip to content

Commit

Permalink
Look at the artifacts name, rather than the project name, to detect c…
Browse files Browse the repository at this point in the history
…ollisions

The artifact names are obtained from "moduleName", which may be different
from the project name. Fixes lightbend-labs#188
  • Loading branch information
Antonio Cunei committed Nov 2, 2016
1 parent 67c2a6b commit 424d2b2
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,13 @@ case class RepeatableDBuildConfig(builds: Seq[ProjectConfigAndExtracted]) {
// more appropriate to print the actual subproject name, rather than the Project
case class Origin(fromProject: String, spaces: SeqString)
case class Info(artOrg: String, artName: String, origin: Origin)
val generatedArtifacts = builds flatMap { b => b.extracted.projects.map { a => Info(a.organization, a.name, Origin(b.config.name, b.getSpace.to)) } }

// declare a collision if any artifacts in two distint projects have same organization and name
// (even if they differ in their extension or classifiers)
val generatedArtifacts = builds flatMap { b => b.extracted.projects.flatMap { _.artifacts.groupBy {
case ProjectRef(name, org, ext, classifier) => (org, name)
}.map { case ((org, name), _) => Info(org, name, Origin(b.config.name, b.getSpace.to)) } } }

val byArt = (generatedArtifacts.groupBy { case Info(org, name, origin) => (org, name) }).toSeq
val collisions = byArt flatMap {
case ((org, name), seqInfo) =>
Expand Down

0 comments on commit 424d2b2

Please sign in to comment.