mirror of https://github.com/sbt/sbt.git
Better error message from project macro
This commit is contained in:
parent
798683b552
commit
caba7e145c
|
|
@ -617,7 +617,7 @@ object Project extends ProjectExtra {
|
||||||
def projectMacroImpl(c: Context): c.Expr[Project] =
|
def projectMacroImpl(c: Context): c.Expr[Project] =
|
||||||
{
|
{
|
||||||
import c.universe._
|
import c.universe._
|
||||||
val enclosingValName = std.KeyMacro.definingValName(c, methodName => s"""$methodName must be directly assigned to a val, such as `val x = $methodName`.""")
|
val enclosingValName = std.KeyMacro.definingValName(c, methodName => s"""$methodName must be directly assigned to a val, such as `val x = $methodName`. Alternatively, you can use `sbt.Project.apply`""")
|
||||||
val name = c.Expr[String](Literal(Constant(enclosingValName)))
|
val name = c.Expr[String](Literal(Constant(enclosingValName)))
|
||||||
reify { Project(name.splice, new File(name.splice)) }
|
reify { Project(name.splice, new File(name.splice)) }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue