Scala convert Seq to k, v of sbt.Project.Setting[_]
-
13-12-2019 - |
Question
Play 2.0's Build.sbt uses a pimped Project definition to do its magic; any additional settings you might need to add must be manually entered in k := v
fashion. Works fine for the general case, but not for the specific; namely, when needing to set an sbt-plugin's settings which invariably are Seq[Settings[_]]
. Here's an example of what predictably works
lazy val main = PlayProject(appName, appVersion, ....).settings(
version := appVersion
)
Now, how to get Seq[Settings[_]] converted to k,v pairs so the Play by-name call:
def apply(...., ...., settings: => Seq[Setting[_]])
actually works?!!
I've asked over on play-user, but good luck, a zoo over there, framework is taking off and core devs are clearly up to their ears...
Solution
Does this work?
….settings(mySeqOfSettings: _*)
OTHER TIPS
I hit the same problem with play framework and sbt-buildinfo plugin. After a lot of trial and error, I ended up preferring applying the settings twice in a row. I felt like it looked more obvious what was happening in Build.scala: http://mfizz.com/blog/2013/04/auto-generate-class-file-build-info-play-framework