Advertisement
Guest User

Untitled

a guest
Oct 10th, 2015
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. import sbt._
  2. import Keys._
  3. import java.net._
  4. import java.io.File
  5. import play.PlayRunHook
  6.  
  7. /*
  8. Grunt runner should be in project directory to be picked up by sbt
  9. */
  10. object Grunt {
  11. def apply(base: File): PlayRunHook = {
  12.  
  13. object GruntProcess extends PlayRunHook {
  14.  
  15. var process: Option[Process] = None
  16.  
  17. override def beforeStarted(): Unit = {
  18. Process("grunt dist", base).run
  19. }
  20.  
  21. override def afterStarted(addr: InetSocketAddress): Unit = {
  22. process = Some(Process("grunt run", base).run)
  23. }
  24.  
  25. override def afterStopped(): Unit = {
  26. process.map(p => p.destroy())
  27. process = None
  28. }
  29. }
  30.  
  31. GruntProcess
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement