Make BuildDependencies construction a proper function outside of the settings sytem.

This commit is contained in:
Mark Harrah 2014-02-20 13:28:02 -05:00
parent a3d89dc865
commit 2bf127aaf6
2 changed files with 16 additions and 13 deletions

View File

@ -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)

View File

@ -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]] =