I'm new to the whole SBT and Scala scene and am trying to build a project that uses Java/Scala classes and Hibernate. I'm getting the project to build fine -- I just have to manually copy over my hibernate config files to my target/scala<version>/classes
folder so they can be picked up by hibernate.
Is there a way to create a task in SBT to copy these folders over on each compile? This is my Build.scala
file:
import sbt._
object Sportsbook extends Build {
lazy val project = Project (
"sportsbook",
file("."),
copyConfigTask
)
val copyConfig = TaskKey[Unit]("copy", "Copy hibernate files over to target directory")
/*
// Something like this
lazy val copyConfigTask = copyConfig <<=
val configDir1 = baseDirectory / "config"
val configDir2 = outputPath / "config"
IO.copyDirectory(configDir1, configDir2)
*/
}