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

japi.JSetup.scala Maven / Gradle / Ivy

There is a newer version: 1.1.0-RC3
Show newest version
package info.hupel.isabelle.japi

import scala.concurrent.Await
import scala.concurrent.duration.Duration

import monix.execution.Scheduler.Implicits.global

import info.hupel.isabelle.api._
import info.hupel.isabelle.setup._

object JSetup {

  def defaultSetup(version: Version.Stable, timeout: Duration): Setup =
    Setup.default(version, false) match {
      case Left(reason) => sys.error(reason.explain)
      case Right(setup) => setup
    }

  def defaultSetup(version: Version.Stable): Setup =
    defaultSetup(version, Duration.Inf)

  def makeEnvironment(setup: Setup, resources: JResources, timeout: Duration): Environment =
    Await.result(setup.makeEnvironment(resources.getResources(), Nil), timeout)

  def makeEnvironment(setup: Setup, resources: JResources): Environment =
    makeEnvironment(setup, resources, Duration.Inf)

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy