Or if you are using a build object extending from Build:
import sbt._
import Keys._
import com.github.bigtoast.sbtthrift.ThriftPlugin
class BuildWithThriftShiz extends Build {
lazy val seniorProject = Project("hola", file("."), settings =
Defaults.defaultSettings ++ ThriftPlugin.thriftSettings ++ Seq(/* custom settings go here */))
}
Settings
thrift
Thrift executable. This defaults to just 'thrift'
thrift := "/some/other/path/to/thrift"
</td></tr>
<tr>
<td> <b>thriftSourceDir</b> </td>
<td>Directory containing thrift sources. This defaults to 'src/main/thrift'.</td>
</tr>
<tr><td></td><td>
thriftSourceDir <<= baseDirectory( _ / "other" / "thrift" / "sourceDir" )
</td></tr>
<tr>
<td> <b>thriftOutputDir</b> </td>
<td>The output dir for the generated sources. This directory will be added to sourceManaged so it will be automatically get compiled when you run compile. This defaults to 'target/generated-sources'.</td>
</tr>
<tr>
<td> <b>thriftJavaOptions</b> </td>
<td>Additional options to thrift compiler for java generation.</td>
</tr>
<tr>
<td> <b>thriftJavaEnabled</b> </td>
<td> Are we generating java source (?) Default is true.</td>
</tr>
<tr>
<td> <b>thriftJsEnabled</b> </td>
<td> Are we generating javascript source (?) Default is false.</td>
</tr>
<tr>
<td> <b>thriftJsOutputDir</b> </td>
<td>The output dir for the generated javascript. This directory will be added to resourceManaged so it will be automatically get compiled during generation of resources. This defaults to 'target/gen-js'.</td>
</tr>
<tr>
<td> <b>thriftJsOptions</b> </td>
<td>Additional options to thrift compiler for javascript generation.</td>
</tr>
<tr>
<td> <b>thriftRubyEnabled</b> </td>
<td> Are we generating ruby source (?) Default is false.</td>
</tr>
<tr>
<td> <b>thriftRubyOutputDir</b> </td>
<td>The output dir for the generated Ruby. This directory will be added to sourceManaged so it will be automatically get compiled during generation of resources. This defaults to 'target/gen-rb'.</td>
</tr>
<tr>
<td> <b>thriftRubyOptions</b> </td>
<td>Additional options to thrift compiler for Ruby generation.</td>
</tr>
<tr>
<td> <b>thriftPythonEnabled</b> </td>
<td> Are we generating Python source (?) Default is false.</td>
</tr>
<tr>
<td> <b>thriftPythonOutputDir</b> </td>
<td>The output dir for the generated Python. This directory will be added to sourceManaged so it will be automatically get compiled during generation of resources. This defaults to 'target/gen-py'.</td>
</tr>
<tr>
<td> <b>thriftPythonOptions</b> </td>
<td>Additional options to thrift compiler for Python generation.</td>
</tr>
Tasks
thrift:generate-java
This will run generate java sources from the thrift sources. This task is automatically executed when compile is run.
thrift:generate-js
This will run generate javascript sources from the thrift sources. This task is automatically executed during the compile phase if thriftJsEnabled is set to true /td>
thrift:generate-ruby
This will run generate Ruby sources from the thrift sources. This task is automatically executed during the compile phase if thriftRubyEnabled is set to true /td>
thrift:generate-python
This will run generate Python sources from the thrift sources. This task is automatically executed during the compile phase if thriftPythonEnabled is set to true /td>
Notes
If any bugs are found or features wanted please file an issue in the github project. I will do my best to accommodate.