SBT is usage dependent - going from 0.12 to 0.13

I have a command like this in build.sbt

run <<= (run in Compile) dependsOn npmBuildTask

      

As per the documentation, <= - is deprecated, so I want to use: = this one. I tried:

run in Compile := ((run in Compile).dependsOn(npmBuildTask).value)
run in Compile := (run in Compile).dependsOn(npmBuildTask).value
run in Compile := run.dependsOn(npmBuildTask).value

      

But they all don't work for me. Could you help me?

+3


source to share


1 answer


Finally I found a solution.

compile := ((compile in Compile) dependsOn npmBuildTask).value

      

This works for me. The problem was in the following code:

run := ((run in Compile) dependsOn npmBuildTask).value

      



compile and run different. compile has a return type as sbt.TaskKey [sbt.inc.Analysis] and run has a return type as sbt.InputKey [scala.Unit]. Because of this, you must use this command:

run := ((run in Compile) dependsOn npmBuildTask).evaluated

      

Everything is working fine now.

+4


source







All Articles