harrah/xsbt — pull request #294 by Atry (2011-12-10 18:04:35+00:00)
Title: Fix stack overflow when use Build.projects in a Project's settings.

Stack overflow without this patch:

```scala
// vim: set softtabstop=2 shiftwidth=2 expandtab:
import sbt._
import Keys._

object MyBuild extends Build {

private def addAllBuildDependency(p: Project) =
buildDependencies <<= (buildDependencies,
thisProjectRef,
thisProjectRef in p) {
(origin, self, matchingProject) =>
if (self == matchingProject)
origin
else
origin.addClasspath(
self,
ResolvedClasspathDependency(matchingProject, None))
}

// Cause stack overflow without patch.
private def newProject(path: String) =
Project(id = path, base = file(path),
settings = Project.defaultSettings ++
(projects map addAllBuildDependency))

lazy val foo = newProject("foo").dependsOn(bar)

lazy val bar= Project(id = "bar", base = file("bar"))

}
```

I change settings parameter as call-by-name parameter in Project.copy to fix it.