This will help keep sizes down on Heroku, etc. Play 2 has a stage task that does the copying so you can grab the code from there...
val playStage = TaskKeyUnit
val playStageTask = (baseDirectory, playPackageEverything, dependencyClasspath in Runtime, target, streams) map { (root, packaged, dependencies, target, s) =>
import sbt.NameFilter._
val staged = target / "staged"
IO.delete(staged)
IO.createDirectory(staged)
val libs = dependencies.filter(_.data.ext == "jar").map(_.data) ++ packaged
libs.foreach { jar =>
IO.copyFile(jar, new File(staged, jar.getName))
}
val start = target / "start"
IO.write(start,
"""|#! /usr/bin/env sh
|
|java "$@" -cp "`dirname $0`/staged/*" play.core.server.NettyServer `dirname $0`/..
|""".stripMargin)
"chmod a+x %s".format(start.getAbsolutePath) !
s.log.info("")
s.log.info("Your application is ready to be run in place: target/start")
s.log.info("")
()
}
This will help keep sizes down on Heroku, etc. Play 2 has a stage task that does the copying so you can grab the code from there...
val playStage = TaskKeyUnit
val playStageTask = (baseDirectory, playPackageEverything, dependencyClasspath in Runtime, target, streams) map { (root, packaged, dependencies, target, s) =>
}