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

scala.build.options.HasBuildRequirements.scala Maven / Gradle / Ivy

There is a newer version: 0.1.8
Show newest version
package scala.build.options

final case class HasBuildRequirements[+T](
  requirements: BuildRequirements,
  value: T
) {
  def withScalaVersion(sv: String): Either[String, HasBuildRequirements[T]] =
    requirements.withScalaVersion(sv).map { updatedRequirements =>
      copy(requirements = updatedRequirements)
    }
  def withPlatform(pf: Platform): Either[String, HasBuildRequirements[T]] =
    requirements.withPlatform(pf).map { updatedRequirements =>
      copy(requirements = updatedRequirements)
    }
  def scopedValue(defaultScope: Scope): HasScope[T] =
    HasScope(requirements.scope.map(_.scope).getOrElse(defaultScope), value)
  def map[U](f: T => U): HasBuildRequirements[U] =
    copy(value = f(value))
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy