I want to automatically build documentation for my Java Play 2.3 application.
At the moment, I use a Makefile to generate images from *.dot
files and combine Markdown sources together into Html/PDF:
dot diagram1.dot -Tpdf -o diagram1.pdf
dot diagram2.dot -Tpdf -o diagram2.pdf
pandoc doc1.markdown -o doc1.pdf
# ...
Now I want to run these simple bash commands directly from SBT.
What's the best way to do this?
I found some SBT Documentation plugins in the SBT reference, but nothing to run a simple shell script.
Best Solution
You can find some answers in External Processes in the official documentation of sbt, e.g.
Don't forget to use
import scala.sys.process._
so!
can be resolved as a method ofString
.Do the following in activator console (aka sbt shell) to execute
yourshell.sh
- mind theeval
command and the quotes around the name of the script:To have it available as a task add the following to
build.sbt
of your project: