mirror of https://github.com/sbt/sbt.git
Merge pull request #4356 from eed3si9n/wip/remove-global-dir-warning
Remove old warning about global dir
This commit is contained in:
commit
d3b79ae2e1
|
|
@ -44,17 +44,7 @@ object BuildPaths {
|
||||||
|
|
||||||
def getGlobalBase(state: State): File = {
|
def getGlobalBase(state: State): File = {
|
||||||
val default = defaultVersionedGlobalBase(binarySbtVersion(state))
|
val default = defaultVersionedGlobalBase(binarySbtVersion(state))
|
||||||
def getDefault = { checkTransition(state, default); default }
|
getFileSetting(globalBaseDirectory, GlobalBaseProperty, default)(state)
|
||||||
getFileSetting(globalBaseDirectory, GlobalBaseProperty, getDefault)(state)
|
|
||||||
}
|
|
||||||
private[this] def checkTransition(state: State, versioned: File): Unit = {
|
|
||||||
val unversioned = defaultGlobalBase
|
|
||||||
def globalDefined(base: File): Boolean =
|
|
||||||
getGlobalPluginsDirectory(state, base).exists ||
|
|
||||||
configurationSources(getGlobalSettingsDirectory(state, base)).exists(_.exists)
|
|
||||||
val warnTransition = !globalDefined(versioned) && globalDefined(unversioned)
|
|
||||||
if (warnTransition)
|
|
||||||
state.log.warn(globalDirTransitionWarning(unversioned, versioned))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def getStagingDirectory(state: State, globalBase: File): File =
|
def getStagingDirectory(state: State, globalBase: File): File =
|
||||||
|
|
@ -122,10 +112,4 @@ object BuildPaths {
|
||||||
|
|
||||||
def crossPath(base: File, instance: xsbti.compile.ScalaInstance): File =
|
def crossPath(base: File, instance: xsbti.compile.ScalaInstance): File =
|
||||||
base / ("scala_" + instance.version)
|
base / ("scala_" + instance.version)
|
||||||
|
|
||||||
private[this] def globalDirTransitionWarning(unversioned: File, versioned: File): String =
|
|
||||||
s"""The global sbt directory is now versioned and is located at $versioned.
|
|
||||||
You are seeing this warning because there is global configuration in $unversioned but not in $versioned.
|
|
||||||
The global sbt directory may be changed via the $GlobalBaseProperty system property.
|
|
||||||
"""
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue