mirror of https://github.com/sbt/sbt.git
Merge pull request #85 from alexarchambault/topic/develop
Small changes in cache directory layout
This commit is contained in:
commit
3e3680adb0
|
|
@ -201,7 +201,11 @@ class Helper(
|
|||
else
|
||||
None
|
||||
logger.foreach(_.init())
|
||||
val fetchQuiet = coursier.Fetch(repositories, files.fetch(logger = logger))
|
||||
val fetchQuiet = coursier.Fetch(
|
||||
repositories,
|
||||
files.fetch(logger = logger)(cachePolicy = CachePolicy.LocalOnly), // local files get the priority
|
||||
files.fetch(logger = logger)
|
||||
)
|
||||
val fetch0 =
|
||||
if (verbose0 <= 0) fetchQuiet
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -41,8 +41,7 @@ case class Cache(cache: File) {
|
|||
import Cache._
|
||||
|
||||
lazy val repoDir = new File(cache, "repositories")
|
||||
lazy val metadataBase = new File(cache, "metadata")
|
||||
lazy val fileBase = new File(cache, "files")
|
||||
lazy val fileBase = new File(cache, "cache")
|
||||
|
||||
lazy val defaultFile = new File(repoDir, ".default")
|
||||
|
||||
|
|
@ -64,11 +63,10 @@ case class Cache(cache: File) {
|
|||
ifEmpty: Boolean = true,
|
||||
verbose: Boolean = false
|
||||
): Unit =
|
||||
if (!ifEmpty || !cache.exists()) {
|
||||
if (!ifEmpty || !repoDir.exists() || !fileBase.exists()) {
|
||||
if (verbose)
|
||||
Console.err.println(s"Initializing $cache")
|
||||
repoDir.mkdirs()
|
||||
metadataBase.mkdirs()
|
||||
fileBase.mkdirs()
|
||||
addCentral()
|
||||
addIvy2Local()
|
||||
|
|
|
|||
|
|
@ -11,12 +11,15 @@ object Fetch {
|
|||
|
||||
def apply(
|
||||
repositories: Seq[core.Repository],
|
||||
fetch: Repository.Fetch[Task]
|
||||
fetch: Repository.Fetch[Task],
|
||||
extra: Repository.Fetch[Task]*
|
||||
): ResolutionProcess.Fetch[Task] = {
|
||||
|
||||
modVers => Task.gatherUnordered(
|
||||
modVers.map { case (module, version) =>
|
||||
Repository.find(repositories, module, version, fetch)
|
||||
def get(fetch: Repository.Fetch[Task]) =
|
||||
Repository.find(repositories, module, version, fetch)
|
||||
(get(fetch) /: extra)(_ orElse get(_))
|
||||
.run
|
||||
.map((module, version) -> _)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
#!/bin/bash
|
||||
|
||||
"$(dirname "$0")/../cli/target/pack/bin/coursier" bootstrap \
|
||||
com.github.alexarchambault:coursier-cli_2.11:0.1.0-SNAPSHOT \
|
||||
-D "\$(cd \$(dirname \"\$0\"); pwd)/.coursier/0.1.0-SNAPSHOT-0f15f7f/bootstrap" \
|
||||
-r https://repo1.maven.org/maven2 -r https://oss.sonatype.org/content/repositories/snapshots \
|
||||
-b \
|
||||
-f -o coursier \
|
||||
-M coursier.cli.Coursier \
|
||||
-e COURSIER_CACHE="\$(cd \$(dirname \"\$0\"); pwd)/.coursier/0.1.0-SNAPSHOT-0f15f7f"
|
||||
Loading…
Reference in New Issue