All Downloads are FREE. Search and download functionalities are using the official Maven repository.

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