From eed8dfdbab12bac650dbec1912be522b1b977a1c Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Tue, 21 Sep 2010 22:35:33 -0400 Subject: [PATCH] grab base inter-project dependencies from the ProjectInfo --- main/MultiProject.scala | 12 +++++------- main/ProjectInfo.scala | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/main/MultiProject.scala b/main/MultiProject.scala index 7d0e2ae62..b42a20f7f 100644 --- a/main/MultiProject.scala +++ b/main/MultiProject.scala @@ -162,8 +162,8 @@ trait Project extends Tasked with HistoryEnabled with Member[Project] with Named def input = Dummy.In def state = Dummy.State - def aggregate: Iterable[ProjectDependency.Execution] - def dependencies: Iterable[ProjectDependency.Classpath] + def aggregate: Iterable[ProjectDependency.Execution] = info.dependencies collect { case ex: ProjectDependency.Execution => ex } + def dependencies: Iterable[ProjectDependency.Classpath] = info.dependencies collect { case cp: ProjectDependency.Classpath => cp } type Task[T] = sbt.Task[T] def act(input: Input, state: State): Option[(Task[State], Execute.NodeView[Task])] = @@ -191,10 +191,8 @@ trait ProjectExtra trait ReflectiveProject extends Project { private[this] def vals[T: Manifest] = ReflectUtilities.allVals[T](this).map(_._2) - def aggregate: Iterable[ProjectDependency.Execution] = vals[ProjectDependency.Execution] ++ vals[Project].map(p => ProjectDependency.Execution(Right(p))) - /** All projects directly contained in this that are defined in this container's compilation set. - * This is for any contained projects, including execution and classpath dependencies, but not external projects. */ - def dependencies: Iterable[ProjectDependency.Classpath] = vals[ProjectDependency.Classpath] + override def aggregate: Iterable[ProjectDependency.Execution] = vals[ProjectDependency.Execution] ++ vals[Project].map(p => ProjectDependency.Execution(Right(p))) ++ super.aggregate + override def dependencies: Iterable[ProjectDependency.Classpath] = vals[ProjectDependency.Classpath] ++ super.dependencies } trait ConsoleTask { @@ -207,7 +205,7 @@ trait ProjectConstructors extends Project val info: ProjectInfo //def project(base: Path, name: String, deps: ProjectDependency*): Project = project(path, name, info => new DefaultProject(info), deps: _* ) def project[P <: Project](path: Path, name: String, construct: ProjectInfo => P, deps: ProjectDependency*): P = - construct( info.copy(Some(name), projectDirectory = path.asFile, parent = Some(this))() ) + construct( info.copy(Some(name), projectDirectory = path.asFile, parent = Some(this), dependencies = deps)() ) def project(base: Path): ProjectDependency.Execution = new ProjectDependency.Execution(Left(base.asFile)) diff --git a/main/ProjectInfo.scala b/main/ProjectInfo.scala index e467e89b9..cdc3ae1f0 100644 --- a/main/ProjectInfo.scala +++ b/main/ProjectInfo.scala @@ -15,7 +15,7 @@ import inc.Analysis * `parent` is the parent Project, or None if this is the root project. * `buildScalaVersion` contains the explicitly requested Scala version to use for building (as when using `+` or `++`) or None if the normal version should be used. */ -final case class ProjectInfo(name: Option[String], projectDirectory: File, builderDir: File, dependencies: Iterable[Project], parent: Option[Project])( +final case class ProjectInfo(name: Option[String], projectDirectory: File, builderDir: File, dependencies: Iterable[ProjectDependency], parent: Option[Project])( val configuration: AppConfiguration, val analysis: Analysis, val compileInputs: Compile.Inputs, val construct: File => Project, external: ExternalProjects) { def app = configuration.provider