Skip to content

Instantly share code, notes, and snippets.

@xuwei-k
Created April 10, 2013 03:36
Show Gist options
  • Save xuwei-k/5351589 to your computer and use it in GitHub Desktop.
Save xuwei-k/5351589 to your computer and use it in GitHub Desktop.
source generators from github
import sbt._
import Keys._
object build extends Build{
def github(org: String, name: String, hash: String): Project = Project(
name, file(name)
).settings(
baseSettings ++ seq(
sourceGenerators in Compile <+= (sourceManaged in Compile){ dir => task{
IO.withTemporaryDirectory{ tmp =>
val files = IO.unzipURL(url(<x>https://github.com/{org}/{name}/archive/{hash}.zip</x>.text), tmp)
IO.move(tmp / (name + "-" + hash) / "src" / "main" / "scala", dir)
}
(dir ** "*.scala") +++ (dir ** "*.java") get
}}
) : _*
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment