Created
April 10, 2013 03:36
-
-
Save xuwei-k/5351589 to your computer and use it in GitHub Desktop.
source generators from github
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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