5

I upgraded the sbt from sbt-0.13.16 to sbt-1.2.8 my following code is breaking

lazy val gruntDirectory = baseDirectory {
    _ / "public"
}

unmanagedResourceDirectories in Assets += gruntDirectory { _ / "node_modules"}

here is the error i am getting

/build.sbt:131: error: No implicit for Append.Value[Seq[java.io.File], sbt.Def.Initialize[java.io.File]] found,
  so sbt.Def.Initialize[java.io.File] cannot be appended to Seq[java.io.File]
unmanagedResourceDirectories in Assets += gruntDirectory { _ / "node_modules"}
                                       ^
[error] Type error in expression
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? 

how can i resolve this issue

swaheed
  • 3,671
  • 10
  • 42
  • 103

1 Answers1

2

You need to use .value to extract the value of a setting:

unmanagedResourceDirectories in Assets += baseDirectory.value / "public" / "node_modules"

If you want to define gruntDirectory for something else, you can do it like this:

lazy val gruntDirectory = Def.setting { baseDirectory.value / "public" }

unmanagedResourceDirectories in Assets += gruntDirectory.value / "node_modules"

Notice that you can use .value only on the right side of :=/+=/++=/~= assignments or inside Def.{setting, task, taskDyn, inputTask, inputTaskDyn}.

laughedelic
  • 6,230
  • 1
  • 32
  • 41