Merge pull request #3135 from eed3si9n/wip/plusequals

[sbt 0.13] Fix += interference with sbt-buildinfo
This commit is contained in:
Dale Wijnand 2017-04-23 12:39:56 +01:00 committed by GitHub
commit f64ce4ede1
4 changed files with 11 additions and 1 deletions

View File

@ -174,7 +174,8 @@ object TaskMacro {
val typeArgs = util.typeArgs(ttpe)
v.tree.tpe match {
// To allow Initialize[Task[A]] in the position of += RHS, we're going to call "taskValue" automatically.
case tpe if typeArgs.nonEmpty && (tpe weak_<:< c.weakTypeOf[Initialize[_]]) =>
case tpe if typeArgs.nonEmpty && (typeArgs.head weak_<:< c.weakTypeOf[Task[_]])
&& (tpe weak_<:< c.weakTypeOf[Initialize[_]]) =>
c.macroApplication match {
case Apply(Apply(TypeApply(Select(preT, nmeT), targs), _), _) =>
val tree = Apply(TypeApply(Select(preT, newTermName("+=").encodedName), TypeTree(typeArgs.head) :: Nil), Select(v.tree, newTermName("taskValue").encodedName) :: Nil)

View File

@ -0,0 +1,7 @@
// https://github.com/sbt/sbt/issues/3132
lazy val root = (project in file(".")).
enablePlugins(BuildInfoPlugin).
settings(
buildInfoKeys += name,
buildInfoPackage := "hello"
)

View File

@ -0,0 +1 @@
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.7.0")

View File

@ -0,0 +1 @@
> compile