Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sbt._
- import Keys._
- import java.net._
- import java.io.File
- import play.PlayRunHook
- /*
- Grunt runner should be in project directory to be picked up by sbt
- */
- object Grunt {
- def apply(base: File): PlayRunHook = {
- object GruntProcess extends PlayRunHook {
- var process: Option[Process] = None
- override def beforeStarted(): Unit = {
- Process("grunt dist", base).run
- }
- override def afterStarted(addr: InetSocketAddress): Unit = {
- process = Some(Process("grunt run", base).run)
- }
- override def afterStopped(): Unit = {
- process.map(p => p.destroy())
- process = None
- }
- }
- GruntProcess
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement