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

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

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

import scala.build.internal.Constants
import scala.build.options.packaging._

final case class PackageOptions(
  standalone: Option[Boolean] = None,
  version: Option[String] = None,
  launcherApp: Option[String] = None,
  maintainer: Option[String] = None,
  description: Option[String] = None,
  packageTypeOpt: Option[PackageType] = None,
  logoPath: Option[os.Path] = None,
  macOSidentifier: Option[String] = None,
  debianOptions: DebianOptions = DebianOptions(),
  windowsOptions: WindowsOptions = WindowsOptions(),
  redHatOptions: RedHatOptions = RedHatOptions(),
  dockerOptions: DockerOptions = DockerOptions(),
  nativeImageOptions: NativeImageOptions = NativeImageOptions(),
  useDefaultScaladocOptions: Option[Boolean] = None
) {

  def packageVersion: String =
    version
      .map(_.trim)
      .filter(_.nonEmpty)
      .getOrElse(Constants.version.stripSuffix("-SNAPSHOT"))

  def isDockerEnabled: Boolean = dockerOptions.isDockerEnabled.getOrElse(false)

  // default behaviour for building docker image is building standalone JARs
  def isStandalone: Boolean = standalone.getOrElse(isDockerEnabled)

}

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy