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

coursier.cli.jvm.JavaHomeParams.scala Maven / Gradle / Ivy

There is a newer version: 2.1.13
Show newest version
package coursier.cli.jvm

import java.nio.file.{Path, Paths}

import cats.data.ValidatedNel
import cats.implicits._
import coursier.cli.params.{CacheParams, EnvParams, OutputParams}

final case class JavaHomeParams(
  shared: SharedJavaParams,
  cache: CacheParams,
  output: OutputParams,
  env: EnvParams
)

object JavaHomeParams {
  def apply(options: JavaHomeOptions): ValidatedNel[String, JavaHomeParams] = {
    val sharedV = SharedJavaParams(options.sharedJavaOptions)
    val cacheV = options.cacheOptions.params
    val outputV = OutputParams(options.outputOptions)
    val envV = EnvParams(options.envOptions)
    (sharedV, cacheV, outputV, envV).mapN { (shared, cache, output, env) =>
      JavaHomeParams(
        shared,
        cache,
        output,
        env
      )
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy