SBT: launch action on all projects

I have an SBT project that contains several subprojects, i.e.:

> projects [info] In file:/home/me/src/foo/ [info] popen [info] foobar-core [info] * foobar-client [info] foobar-db 

Is there a way to trigger an action in each of these subprojects? I am looking for something like publish-all , as I am currently looking through all the subprojects and running publish manually, which becomes quite tedious when there are more than a few subprojects.

I use sbt-0.11.2 out of inertia, but I am ready to upgrade if this helps.

+4
source share
1 answer

You can define a project that integrates all other projects. Each action performed in this project will be performed in all units. Here is an example from the sbt wiki :

 import sbt._ import Keys._ object HelloBuild extends Build { lazy val root = Project(id = "hello", base = file(".")) aggregate(foo, bar) lazy val foo = Project(id = "hello-foo", base = file("foo")) lazy val bar = Project(id = "hello-bar", base = file("bar")) } 
+7
source

Source: https://habr.com/ru/post/1432453/


All Articles