mirror of https://github.com/sbt/sbt.git
Fix csrCacheDirectory and add test
This commit is contained in:
parent
9517813190
commit
c82f13c2db
|
|
@ -3373,7 +3373,7 @@ object Classpaths {
|
|||
val ac = appConfiguration.value
|
||||
val ip = ivyPaths.value
|
||||
// if ivyPaths is customized, create coursier-cache directory in it
|
||||
val defaultIvyCache = bootIvyHome(ac)
|
||||
val defaultIvyCache = bootIvyHome(ac).map(_.toString)
|
||||
if (old != LMCoursier.defaultCacheLocation) old
|
||||
else if (ip.ivyHome == defaultIvyCache) old
|
||||
else
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
TaskKey[Unit]("checkIsDefaultCache") := {
|
||||
val csrCacheDir = csrCacheDirectory.value
|
||||
assert(csrCacheDir == sbt.coursierint.LMCoursier.defaultCacheLocation, csrCacheDir.toString)
|
||||
val expectedPath = if Util.isWindows then "Coursier\\Cache\\v1" else ".cache/coursier/v1"
|
||||
assert(csrCacheDir.toString.endsWith(expectedPath), csrCacheDir.toString)
|
||||
}
|
||||
|
||||
TaskKey[Unit]("checkIsCustomCache") := {
|
||||
val csrCacheDir = csrCacheDirectory.value
|
||||
val ip = ivyPaths.value
|
||||
assert(csrCacheDir == file(ip.ivyHome.get) / "coursier-cache", csrCacheDir.toString)
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
> checkIsDefaultCache
|
||||
> 'set ivyPaths := ivyPaths.value.withIvyHome("ivy-cache")'
|
||||
> checkIsCustomCache
|
||||
Loading…
Reference in New Issue