Dirk Groeneveld
Dirk Groeneveld

Reputation: 2627

How to enable sbt plugins of root project for all subprojects?

I have a project/build.scala file that defines a root project and a bunch of sub projects:

lazy val root = Project(
  id="root",
  base=file(".")).aggregate(subA, subB).enablePlugins(MyPlugin)

lazy val subA = Project(
  id="subA",
  base=file("a"))

lazy val subB = Project(
  id="subB",
  base=file("b"))

How do I make MyPlugin available in subA and subB without specifying it on each of them? I just want them to inherit the plugins from the root project.

Upvotes: 2

Views: 574

Answers (1)

Dirk Groeneveld
Dirk Groeneveld

Reputation: 2627

Someone in IRC suggested overriding projects in my build object in build.scala:

override def projects = super.projects map { _.enablePlugins(...) }

Upvotes: 2

Related Questions