izumi.sbtgen.impl.WithProjectIndex.scala Maven / Gradle / Ivy
The newest version!
package izumi.sbtgen.impl
import izumi.sbtgen.model.{Aggregate, Artifact, ArtifactId}
trait WithProjectIndex {
protected def index: Map[ArtifactId, Artifact]
protected def makeIndex(projects: Seq[Aggregate]): Map[ArtifactId, Artifact] = {
projects
.flatMap(_.artifacts)
.groupBy(_.name)
.mapValues {
a =>
if (a.size > 1) {
throw new RuntimeException(s"Duplicated names: $a")
}
a.head
}
.toMap
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy