title: sbt simplified build for nested projects
body: <p>Below is a sample build file that is working fine :-</p>
  <p><strong>Version 1 (working fine) :-</strong></p>
  <pre><code>val task1 = (project in file(&quot;task1&quot;))
  val task2 = (project in file(&quot;task2&quot;))
  val task3 = (project in file(&quot;task3&quot;))
  val task4 = (project in file(&quot;task4&quot;))
  val task5 = (project in file(&quot;task5&quot;))
  val task6 = (project in file(&quot;task6&quot;))
  val task7 = (project in file(&quot;task7&quot;))
  
  
  lazy val root = (project in file(&quot;.&quot;))
    .aggregate(task1, task2, task3, task4, task5, task6, task7)
  </code></pre>
  <hr />
  <p>Below is the simplified version of above build :-</p>
  <p><strong>Version 2 (error) :-</strong></p>
  <pre><code>val dirs = Seq(&quot;task1&quot;, &quot;task2&quot;, &quot;task3&quot;, &quot;task4&quot;, &quot;task5&quot;, &quot;task6&quot;, &quot;task7&quot;)
  
  
  val nestedProjects = dirs map { dir =&gt;
    val pRef : ProjectReference = (project in file(dir))
    pRef
  }
  
  lazy val root = (project in file(&quot;.&quot;))
    .aggregate(nestedProjects : _*)
  
  
  </code></pre>
  <p>Getting below error :-</p>
  <pre><code>java.lang.RuntimeException: No project 'pRef' in 'file:/Users/loc/groundzero/quickPrototype/nested-projects/'.
  Valid project IDs: root
  [error] No project 'pRef' in 'file:/Users/loc/groundzero/quickPrototype/nested-projects/'.
  [error] Valid project IDs: root
  [error] Use 'last' for the full log.
  </code></pre>
  <hr />
  <p>As per the above error msg, tried using apply :-</p>
  <p><strong>Version 3 (error) :-</strong></p>
  <pre><code>val dirs = Seq(&quot;task1&quot;, &quot;task2&quot;, &quot;task3&quot;, &quot;task4&quot;, &quot;task5&quot;, &quot;task6&quot;, &quot;task7&quot;)
  
  
  val nestedProjects = dirs map { dir =&gt;
    val pRef : ProjectReference = Project.apply(dir, new File(dir))
    pRef
  }
  
  lazy val root = (project in file(&quot;.&quot;))
    .aggregate(nestedProjects : _*)
  
  
  </code></pre>
  <p>Getting below error :-</p>
  <pre><code>java.lang.RuntimeException: No project 'task1' in 'file:/Users/loc/groundzero/quickPrototype/nested-projects/'.
  Valid project IDs: root
  [error] No project 'task1' in 'file:/Users/loc/groundzero/quickPrototype/nested-projects/'.
  [error] Valid project IDs: root
  </code></pre>