mirror of https://github.com/sbt/sbt.git
Warn if legacy cache location ~/.coursier/cache is found (#222)
This commit is contained in:
parent
0047a9803b
commit
33af97d81e
|
|
@ -1,6 +1,7 @@
|
|||
package lmcoursier
|
||||
|
||||
import java.io.File
|
||||
import java.util.concurrent.atomic.AtomicBoolean
|
||||
|
||||
import dataclass.data
|
||||
import coursier.cache.CacheDefaults
|
||||
|
|
@ -82,6 +83,12 @@ import scala.concurrent.duration.Duration
|
|||
}
|
||||
|
||||
object CoursierConfiguration {
|
||||
|
||||
private var checkedLegacyCache = new AtomicBoolean
|
||||
def checkLegacyCache(): Unit =
|
||||
if (!checkedLegacyCache.getAndSet(true))
|
||||
coursier.cache.CacheDefaults.warnLegacyCacheLocation()
|
||||
|
||||
def apply(
|
||||
log: Logger,
|
||||
resolvers: Vector[Resolver],
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ import sbt.util.Logger
|
|||
|
||||
class CoursierDependencyResolution(conf: CoursierConfiguration) extends DependencyResolutionInterface {
|
||||
|
||||
lmcoursier.CoursierConfiguration.checkLegacyCache()
|
||||
|
||||
/*
|
||||
* Based on earlier implementations by @leonardehrenfried (https://github.com/sbt/librarymanagement/pull/190)
|
||||
* and @andreaTP (https://github.com/sbt/librarymanagement/pull/270), then adapted to the code from the former
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ import sbt.librarymanagement.{ModuleID, Resolver, URLRepository}
|
|||
|
||||
object SbtCoursierShared extends AutoPlugin {
|
||||
|
||||
lmcoursier.CoursierConfiguration.checkLegacyCache()
|
||||
|
||||
override def trigger = allRequirements
|
||||
|
||||
override def requires = sbt.plugins.JvmPlugin
|
||||
|
|
|
|||
Loading…
Reference in New Issue