0
votes

I'm using SBT 1.2.8 after migrating from 0.13.7; the old variants used e.g. <+= instead of +=, in e.g. unmanagedClasspath in Compile += baseDirectory map { bd => Attributed.blank(bd / ".." / "config") }, but such operators have been removed.

I've seen a few other related questions, but the types involved seem significantly different enough to be unhelpful to me:

  1. No implicit for Append.Value[...] found with Def.task to generate files in SBT 0.13?
  2. sbt: No implicit for Append.Value[Seq[java.io.File], sbt.Def.Initialize[java.io.File]] found,)

The three relevant consecutive lines in my file are:

  unmanagedClasspath in Compile += baseDirectory map { bd => Attributed.blank(bd / ".." / "config") },
  unmanagedClasspath in Runtime ++= (unmanagedClasspath in Compile),
  unmanagedClasspath in Test ++= (unmanagedClasspath in Compile),

This generates the following errors:

build.sbt:70: error: No implicit for Append.Value[sbt.Keys.Classpath, sbt.Def.Initialize[sbt.Task[sbt.internal.util.Attributed[java.io.File]]]] found,
  so sbt.Def.Initialize[sbt.Task[sbt.internal.util.Attributed[java.io.File]]] cannot be appended to sbt.Keys.Classpath
  unmanagedClasspath in Compile += baseDirectory map { bd => Attributed.blank(bd / ".." / "config") },
                                ^
build.sbt:71: error: No implicit for Append.Values[sbt.Keys.Classpath, sbt.TaskKey[sbt.Keys.Classpath]] found,
  so sbt.TaskKey[sbt.Keys.Classpath] cannot be appended to sbt.Keys.Classpath
  unmanagedClasspath in Runtime ++= (unmanagedClasspath in Compile),
                                ^
build.sbt:72: error: No implicit for Append.Values[sbt.Keys.Classpath, sbt.TaskKey[sbt.Keys.Classpath]] found,
  so sbt.TaskKey[sbt.Keys.Classpath] cannot be appended to sbt.Keys.Classpath
  unmanagedClasspath in Test ++= (unmanagedClasspath in Compile),

If that isn't enough information, here's the full build.sbt, and will be happy to inline relevant bits later.

1
OK, I lied; one of the references above did help me simplify the first line and appears to compile now as: unmanagedClasspath in Compile += baseDirectory.value / ".." / "config"bbarker
And turns out after squinting a bit, the other two lines were fixed like this: unmanagedClasspath in Runtime ++= (unmanagedClasspath in Compile).valuebbarker

1 Answers

0
votes

After squinting a bit, I was able to resolve the issue after all, with the following changes. The key in each case was to recognize where to access the .value in question.

  unmanagedClasspath in Compile += baseDirectory.value / ".." / "config",
  unmanagedClasspath in Runtime ++= (unmanagedClasspath in Compile).value,
  unmanagedClasspath in Test ++= (unmanagedClasspath in Compile).value,

In addition to the above links, the following documentation seemed to be helpful: - https://www.scala-sbt.org/1.0/docs/Tasks.html