mirror of https://github.com/sbt/sbt.git
Make BuildDependencies construction a proper function outside of the settings sytem.
This commit is contained in:
parent
a3d89dc865
commit
2bf127aaf6
|
|
@ -48,6 +48,20 @@ object BuildUtil
|
|||
new BuildUtil(keyIndex, data, root, Load getRootProject units, getp, configs, aggregates)
|
||||
}
|
||||
|
||||
def dependencies(units: Map[URI, LoadedBuildUnit]): BuildDependencies =
|
||||
{
|
||||
import collection.mutable.HashMap
|
||||
val agg = new HashMap[ProjectRef, Seq[ProjectRef]]
|
||||
val cp = new HashMap[ProjectRef, Seq[ClasspathDep[ProjectRef]]]
|
||||
for(lbu <- units.values; rp <- lbu.defined.values)
|
||||
{
|
||||
val ref = ProjectRef(lbu.unit.uri, rp.id)
|
||||
cp(ref) = rp.dependencies
|
||||
agg(ref) = rp.aggregate
|
||||
}
|
||||
BuildDependencies(cp.toMap, agg.toMap)
|
||||
}
|
||||
|
||||
def checkCycles(units: Map[URI, LoadedBuildUnit])
|
||||
{
|
||||
def getRef(pref: ProjectRef) = units(pref.build).defined(pref.project)
|
||||
|
|
|
|||
|
|
@ -1254,19 +1254,8 @@ object Classpaths
|
|||
if(useJars) Seq(pkgTask).join else psTask
|
||||
}
|
||||
|
||||
def constructBuildDependencies: Initialize[BuildDependencies] =
|
||||
loadedBuild { lb =>
|
||||
import collection.mutable.HashMap
|
||||
val agg = new HashMap[ProjectRef, Seq[ProjectRef]]
|
||||
val cp = new HashMap[ProjectRef, Seq[ClasspathDep[ProjectRef]]]
|
||||
for(lbu <- lb.units.values; rp <- lbu.defined.values)
|
||||
{
|
||||
val ref = ProjectRef(lbu.unit.uri, rp.id)
|
||||
cp(ref) = rp.dependencies
|
||||
agg(ref) = rp.aggregate
|
||||
}
|
||||
BuildDependencies(cp.toMap, agg.toMap)
|
||||
}
|
||||
def constructBuildDependencies: Initialize[BuildDependencies] = loadedBuild(lb => BuildUtil.dependencies(lb.units))
|
||||
|
||||
def internalDependencies: Initialize[Task[Classpath]] =
|
||||
(thisProjectRef, classpathConfiguration, configuration, settingsData, buildDependencies) flatMap internalDependencies0
|
||||
def unmanagedDependencies: Initialize[Task[Classpath]] =
|
||||
|
|
|
|||
Loading…
Reference in New Issue