dog
dog

Reputation: 59

sbt: wait for a task to finish before packaging

I have a multiple sub-projects on my sbt build, on one of them I have a task that I would like to block (the rest of that specific subproject) until it is done

basically the task is a copy that copies some files I need into Play's /public folder and therefore I need it to finish before I move on to packaging (these are files I only need in production mode so basically only need it when I stage/package but not compile)

my problem now is that sbt runs the tasks in parallel and then it becomes a race where sometimes not all of the files make it on time and some aren't packaged.

(I also tried making it depend on a new project which only does the copy, figuring this project would wait for the copy project since it depends on it, but then the copy would run everytime, even on compile and I only want it to run for stage/package

Is there a way of properly doing this ? Thanks!

Upvotes: 0

Views: 380

Answers (1)

metasim
metasim

Reputation: 4960

Try having the dependee task return some value when it's done (e.g. File) and then make that task a map parameter to the dependent task.

Upvotes: 2

Related Questions