Coder Social home page Coder Social logo

sbt-thrift's Introduction

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

sbt-thrift's People

Contributors

berngp avatar nelk avatar rssh avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.