GitXplorerGitXplorer
b

sbt-thrift

public
16 stars
8 forks
4 issues

Commits

List of commits on branch master.
Unverified
46ef33108c666952d1303aa8bd23c8267b908f2f

Merge pull request #8 from berngp/patch-1

committed 11 years ago
Unverified
41d1682916f2cb7923d656af8fafece2ba2b6acb

Update ThriftPlugin.scala

bberngp committed 12 years ago
Unverified
26e1b0b8a1f34fbc083869810236154d55f6b5bc

typo in readme

committed 12 years ago
Unverified
69f6f1fe74cd153632276382e37ff57feedf971e

upped to 0.12, added directory watching and cache for compiled code.

committed 12 years ago
Unverified
f7fae00ccd72c894fda0752bf843a4aa4533f539

upped to 0.12, added directory watching and cache for compiled code.

committed 12 years ago
Unverified
5229900063ea0963de948cb58cd3cfd560b8129b

updated pub to

committed 13 years ago

README

The README file for this repository.

Thrift plugin for sbt 0.12+

Instructions for use:

Step 1: Include the plugin in your build

Add the following to your project/plugins.sbt:

resolvers += "bigtoast-github" at "http://bigtoast.github.com/repo/"

addSbtPlugin("com.github.bigtoast" % "sbt-thrift" % "0.6")

Step 2: Add sbt-thrift settings to your build

Add the following to your 'build.sbt' ( if you are using build.sbt )

import com.github.bigtoast.sbtthrift.ThriftPlugin

seq(ThriftPlugin.thriftSettings: _*)

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 &lt;&lt;= 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.

Acknoledgements

I used the following plugins as reference

  • my sbt-liquibase plugin
  • sbt-protobuf plugin for sbt 0.10

Contributors

Andrew Headrick bigtoast Ruslan Shevchenko rssh