4

I'm writing a SBT task, which will get all projects of the whole project, then I can run some tasks against them.

The pseudo code is like:

val projects = someTaskToGetProjects.value
val updateReports = projects.map(p => (update in p).value)

But I can't find any task or setting to get the project list, how to do it?

Freewind
  • 193,756
  • 157
  • 432
  • 708
  • I found method `projects.toList` will give me a list of projects in build file, but the `updateReports` line is still reports error `Illegal dynamic reference: p` – Freewind May 13 '15 at 10:22

1 Answers1

1

I think buildDependencies might suit your needs, otherwise loadedBuild has everything.

val projects = buildDependencies.value.classpath.keys
val updateReports = projects.map(p => (update in p).value)
Dale Wijnand
  • 6,054
  • 5
  • 28
  • 55