mirror of https://github.com/sbt/sbt.git
move readStrings from Env to MapUtil
This commit is contained in:
parent
4d312a01fa
commit
db82974ea8
|
|
@ -251,13 +251,7 @@ trait BasicEnvironment extends Environment
|
|||
propertyMap(name) = property
|
||||
propertyMap //.readOnly (not currently in 2.8)
|
||||
}
|
||||
private val initialValues: Map[String, String] =
|
||||
{
|
||||
val map = new scala.collection.mutable.HashMap[String, String]
|
||||
for(errorMsg <- impl.MapUtilities.read(map, envBackingPath, log))
|
||||
log.error("Error loading properties from " + environmentLabel + " : " + errorMsg)
|
||||
map //.readOnly (not currently in 2.8)
|
||||
}
|
||||
private val initialValues: Map[String, String] = impl.MapUtilities.readStrings(environmentLabel, envBackingPath, log)
|
||||
|
||||
def propertyNames: Iterable[String] = propertyMap.keys.toList
|
||||
def getPropertyNamed(name: String): Option[UserProperty[_]] = propertyMap.get(name)
|
||||
|
|
|
|||
|
|
@ -44,6 +44,13 @@ private[sbt] object MapUtilities
|
|||
None
|
||||
}
|
||||
}
|
||||
def readStrings(label: String, envBackingPath: Path, log: Logger): scala.collection.Map[String, String] =
|
||||
{
|
||||
val map = new HashMap[String, String]
|
||||
for(errorMsg <- read(map, envBackingPath, log))
|
||||
log.error("Error loading properties from " + label + " : " + errorMsg)
|
||||
map.readOnly
|
||||
}
|
||||
def all[Key, Value](map: Map[Key, Set[Value]]): Iterable[Value] =
|
||||
map.values.toList.flatMap(set => set.toList)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue