mirror of https://github.com/sbt/sbt.git
Check for the case the project doesn't exist after reload.
This commit is contained in:
parent
8daa6d3279
commit
0dafd5ef26
|
|
@ -534,17 +534,23 @@ object Load
|
|||
}
|
||||
|
||||
def initialSession(structure: BuildStructure, rootEval: () => Eval, s: State): SessionSettings = {
|
||||
val current = s get Keys.sessionSettings map (_.currentProject)
|
||||
new SessionSettings(structure.root, projectMap(structure.units, current), structure.settings, Map.empty, Nil, rootEval)
|
||||
val current = s get Keys.sessionSettings map (_.currentProject) getOrElse Map.empty
|
||||
new SessionSettings(structure.root, projectMap(structure, current), structure.settings, Map.empty, Nil, rootEval)
|
||||
}
|
||||
|
||||
def initialSession(structure: BuildStructure, rootEval: () => Eval): SessionSettings =
|
||||
new SessionSettings(structure.root, projectMap(structure.units, None), structure.settings, Map.empty, Nil, rootEval)
|
||||
new SessionSettings(structure.root, projectMap(structure, Map.empty), structure.settings, Map.empty, Nil, rootEval)
|
||||
|
||||
def projectMap(units: Map[URI, LoadedBuildUnit], current: Option[Map[URI, String]]): Map[URI, String] =
|
||||
def projectMap(structure: BuildStructure, current: Map[URI, String]): Map[URI, String] =
|
||||
{
|
||||
val units = structure.units
|
||||
val getRoot = getRootProject(units)
|
||||
units.keys.map(uri => (uri, current.flatMap(_ get uri) getOrElse getRoot(uri))).toMap
|
||||
def project(uri: URI) = {
|
||||
current get uri map {
|
||||
p => if (structure allProjects uri map (_.id) contains p) p else getRoot(uri)
|
||||
} getOrElse getRoot(uri)
|
||||
}
|
||||
units.keys.map(uri => (uri, project(uri))).toMap
|
||||
}
|
||||
|
||||
def defaultEvalOptions: Seq[String] = Nil
|
||||
|
|
|
|||
Loading…
Reference in New Issue