Skip to content

Instantly share code, notes, and snippets.

@al3x
Created November 28, 2009 20:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save al3x/244631 to your computer and use it in GitHub Desktop.
Save al3x/244631 to your computer and use it in GitHub Desktop.
def javaDirectoryPath = "src_managed" / "main" / "java"
def rubyDirectoryPath = "src_managed" / "main" / "ruby"
def thriftDirectoryPath = "src_managed" / "main" / "thrift"
def thriftFile = thriftDirectoryPath / "YourThriftDealie.thrift"
def thriftTask(tpe: String, directory: Path, thriftFile: Path) = {
val cleanIt = cleanTask(directory) named("clean-thrift-" + tpe)
execTask {
// you can do "thrift ...".format and pass a String here instead of inline xml
<x>thrift --gen {tpe} {directory.absolutePath} {thriftFile.absolutePath}</x>
} dependsOn(cleanIt)
}
lazy val thriftJava = thriftTask("java", javaDirectoryPath, thriftFile) describedAs("Build Thift Java")
lazy val thriftRuby = thriftTask("ruby", rubyDirectoryPath, thriftFile) describedAs("Build Thrift Ruby")
override def compileAction = super.compileAction dependsOn(thriftJava, thriftRuby)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment