Created
November 28, 2009 20:09
-
-
Save al3x/244631 to your computer and use it in GitHub Desktop.
This file contains 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
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