3

Currently SBT tells me that <<= I'm using to add a trigger certain events is deprecated.

updateBrowsers <<= updateBrowsers.triggeredBy(fastOptJS in Compile)

It suggests using := or ~= instead.

However after several attempts, fastOptJS no longer triggers the updateBrowsers task.

What I've tried:

updateBrowsers := updateBrowsers.triggeredBy(fastOptJS in Compile)

updateBrowsers ~= (_ => updateBrowsers.triggeredBy(fastOptJS in Compile))

updateBrowsers :=  Def.task {
  updateBrowsers.triggeredBy(fastOptJS in Compile)
}

updateBrowsers := Def.taskDyn {
  updateBrowsers.triggeredBy(fastOptJS in Compile)
}

So, how do we add need task dependencies or task triggers in SBT 0.13+?

Jacob Wang
  • 4,411
  • 5
  • 29
  • 43
  • If a `dependsOn` rephrasing works, you can try the answer [here](http://stackoverflow.com/questions/41183255/sbt-task-dependson/41190904#41190904). I can't get `triggeredBy` to work. – jkinkead Jan 26 '17 at 19:15

1 Answers1

1

I think your answer is in the docs

http://www.scala-sbt.org/0.13/docs/Migrating-from-sbt-012x.html#Migrating+when+using+%2C++or

It states it clearly that if you have:

a <<= a triggeredBy b

You CANNOT replace it with an := in SBT 0.13.13 and earlier due to issue #1444.

marios
  • 8,874
  • 3
  • 38
  • 62
  • Ah thanks - I missed it while reading it originally. Will accept the answer after confirming that the a new version no longer has this issue – Jacob Wang Jan 29 '17 at 11:46