1

In SBT 0.13

docker <<= docker dependsOn assembly

gives a deprecation warning. Instead the := operator is recommended.

docker := {
  assembly.value
  docker.value
}

Does not work, because order of execution is not guaranteed. I need these two tasks to run in serial.

What's the trick?

Synesso
  • 37,610
  • 35
  • 136
  • 207
  • This is a duplicate of this question: https://stackoverflow.com/questions/41183255/sbt-task-dependson/41190904. See the answer there. :) – jkinkead Jul 06 '17 at 16:22
  • Possible duplicate of [SBT task dependsOn](https://stackoverflow.com/questions/41183255/sbt-task-dependson) – Synesso Jul 06 '17 at 23:47
  • Thanks. There are too many questions about sbt task dependencies that predate 0.13 for your previous answer to appear in searches. – Synesso Jul 06 '17 at 23:49

1 Answers1

-1
dockerfile in docker := {

  val artifact: File = assembly.value
  val artifactTargetPath = (assemblyOutputPath in assembly).value

  new Dockerfile {
    from("java:8-jre")
    add(artifact, artifactTargetPath)
alex
  • 1,757
  • 4
  • 21
  • 32