简体   繁体   中英

How to get all projects in a SBT task?

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?

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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM