According to the source at GitHub for sbt-start-script, line 35, sbt-start-script
is just a regular task.
So, what prevents you from doing :
val recompile = taskKey[Unit]("Recompile")
recompile := {
clean.value
compile.value
startScriptForClasses.value
}
Take care, that all these tasks are run in parallel. (see http://www.scala-sbt.org/0.13/docs/sbt-0.13-Tech-Previews.html#Sequential+tasks for details)
E.g. if you use SBT >= 0.13.8. you can use
recompile := Def.sequential(clean in Compile, compile in Compile, startScriptForClasses).value
Otherwise, if SBT <= 0.13.7, use the sbt-sequential plugin ( https://github.com/sbt/sbt-sequential )
Alternative
Also see Run custom task automatically before/after standard task