Use common settings in SBT `RootProject`

前端 未结 1 1639
南笙
南笙 2021-02-20 10:55

The answer at https://stackoverflow.com/a/21605652/1737727 shows how to override one setting for a subproject defined with RootProject from the main project. I was

1条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-20 11:46

    Well you could do this:

    commonSettings.map { s => s.mapKey(Def.mapScope(_.in(util))) }
    

    This creates new Seq[Setting[_]] where each of the setting's scopes is changed to be in the util project. This is a valid entry in an sbt file.

    Another option is defining an sbt plugin that you add to both your main projects and in RootProject's own build.sbt

    But you may want to consider if you actually need to import the util project as a RootProject instead of a regular subproject.

    0 讨论(0)
提交回复
热议问题