Skip to content
This repository has been archived by the owner on Sep 25, 2020. It is now read-only.

Commit

Permalink
allow changing local storage of platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
larsrh committed Aug 2, 2017
1 parent 0b8a8c7 commit 0ced7bb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions modules/libisabelle/src/main/scala/Platform.scala
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ object Platform {
def genericPlatform(localStorage0: Path): Platform =
new Platform {
val localStorage = localStorage0.toAbsolutePath
def withLocalStorage(path: Path) = genericPlatform(path)
}

/**
Expand Down Expand Up @@ -79,6 +80,8 @@ sealed abstract class Platform {
/** Path where `libisabelle` stores files downloaded from the Internet. */
def localStorage: Path

def withLocalStorage(path: Path): Platform

final def withIsabelleVersion(path: Path, version: Version, resolved: Boolean): Path = version match {
case Version.Stable(_) if !resolved => path
case Version.Stable(identifier) => path.resolve(s"Isabelle${identifier}")
Expand Down Expand Up @@ -154,4 +157,9 @@ sealed abstract class OfficialPlatform private[isabelle](val name: String) exten
def url(version: Version.Stable): URL =
new URL(s"${baseURL(version)}_$name.tar.gz")

final def withLocalStorage(path: Path): OfficialPlatform =
new OfficialPlatform(name) {
val localStorage = path
}

}

0 comments on commit 0ced7bb

Please sign in to comment.