Skip to content

Instantly share code, notes, and snippets.

@alexy
Created May 17, 2012 05:36
Show Gist options
  • Save alexy/2716700 to your computer and use it in GitHub Desktop.
Save alexy/2716700 to your computer and use it in GitHub Desktop.
copy-dependencies
import sbt._
import Keys._
object MyBuild extends Build {
lazy val copyDependencies = TaskKey[Unit]("copy-dependencies")
def copyDepTask = copyDependencies <<= (update, crossTarget, scalaVersion) map {
(updateReport, out, scalaVer) =>
updateReport.allFiles foreach { srcPath =>
val destPath = out / "lib" / srcPath.getName
IO.copyFile(srcPath, destPath, preserveLastModified=true)
}
}
lazy val root = Project(
"scorify",
file("."),
settings = Defaults.defaultSettings ++ Seq(
copyDepTask
)
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment