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

scala.build.options.scalajs.ScalaJsLinkerOptions.scala Maven / Gradle / Ivy

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

import scala.build.internal.{Constants, FetchExternalBinary}
import scala.build.options.ConfigMonoid

final case class ScalaJsLinkerOptions(
  javaArgs: Seq[String] = Nil,
  /** If right, use JVM, if left, use the value as architecture */
  useJvm: Option[Either[String, Unit]] = None,
  scalaJsVersion: Option[String] = None,
  scalaJsCliVersion: Option[String] = None,
  linkerPath: Option[os.Path] = None
) {
  def finalScalaJsCliVersion = scalaJsCliVersion.orElse(scalaJsVersion).getOrElse {
    Constants.scalaJsCliVersion
  }

  /** If right, use JVM, if left, use the value as architecture */
  lazy val finalUseJvm: Either[String, Unit] = useJvm.getOrElse {
    FetchExternalBinary.maybePlatformSuffix() match {
      case Left(_) =>
        // FIXME Log error?
        Right(())
      case Right(osArch) =>
        Left(osArch)
    }
  }
}

object ScalaJsLinkerOptions {
  implicit val monoid: ConfigMonoid[ScalaJsLinkerOptions] = ConfigMonoid.derive
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy