Reputation: 3723
I have a build.sbt
:
name := "name"
And a project/Build.scala
:
import sbt._
object MyBuild extends Build {
val root = Project(id = "root", base = file("."))
override def settings = super.settings :+ (
Keys.name in root ~= { oldName => oldName + "-in-scala" }
)
}
I want a transformer in project/Build.scala
, which can changes name
to name-in-scala
. But it does not work.
How can I write a transformer in Build.scala
?
Upvotes: 2
Views: 272
Reputation: 7552
I don't think that's possible. The page http://www.scala-sbt.org/release/docs/Getting-Started/Full-Def.html#relating-build-sbt-to-build-scala states about SBT 0.12.1:
The setting in build.sbt should "win" over the one in Build.scala.
and
The settings in .sbt files are appended to the settings in .scala files.
Upvotes: 1