mirror of https://github.com/sbt/sbt.git
Fix += interference with sbt-buildinfo
The macro pattern match was too general. This makes it tighter. Fixes #3132
This commit is contained in:
parent
76fe21eb0c
commit
90bda04695
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
// https://github.com/sbt/sbt/issues/3132
|
||||
lazy val root = (project in file(".")).
|
||||
enablePlugins(BuildInfoPlugin).
|
||||
settings(
|
||||
buildInfoKeys += name,
|
||||
buildInfoPackage := "hello"
|
||||
)
|
||||
|
|
@ -0,0 +1 @@
|
|||
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.7.0")
|
||||
|
|
@ -0,0 +1 @@
|
|||
> compile
|
||||
Loading…
Reference in New Issue