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

er.lm-coursier-shaded_2.12.2.1.5.source-code.InterProjectRepository.scala Maven / Gradle / Ivy

The newest version!
package lmcoursier.internal

import coursier.core._
import coursier.util.{EitherT, Monad}

// private[coursier]
final case class InterProjectRepository(projects: Seq[Project]) extends Repository {

  private val map = projects
    .map(proj => proj.moduleVersion -> proj)
    .toMap

  def find[F[_]](
    module: Module,
    version: String,
    fetch: Repository.Fetch[F]
  )(implicit
    F: Monad[F]
  ): EitherT[F, String, (ArtifactSource, Project)] = {

    val res = map
      .get((module, version))
      .map((this, _))
      .toRight("Not found")

    EitherT(F.point(res))
  }

  override def artifacts(
    dependency: Dependency,
    project: Project,
    overrideClassifiers: Option[Seq[Classifier]]
  ) =
    Nil
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy