GithubHelp home page GithubHelp logo

isabella232 / sbt-thrift Goto Github PK

View Code? Open in Web Editor NEW

This project forked from twitter-archive/sbt-thrift

0.0 0.0 0.0 41.53 MB

sbt rules for generating source stubs out of thrift IDLs, for java & scala

Ruby 55.63% Scala 44.37%

sbt-thrift's Introduction

Overview

Sbt-thrift is an sbt plugin that adds a mixin for doing thrift code auto-generation during your compile phase. Choose one of these three:

  • CompileThriftFinagle - create the java bindings with alternative async interfaces for finagle, in target/gen-java/
  • CompileThriftJava - create just the java bindings, in target/gen-java/
  • CompileThriftPhp - create just the PHP bindings, in target/gen-php/
  • CompileThriftPython - create just the python bindings, in target/gen-py/ (or target/gen-py.twisted/)
  • CompileThriftRuby - create just the ruby bindings, in target/gen-ruby/
  • CompileThriftScala - do CompileThriftFinagle and CompileThriftRuby, but also generate scala wrappers and implicit conversions in target/gen-scala/

Scala Thrift Generation

CompileThriftScala implements a way of generating a Scala-wrapper for a Finagle Thrift service by using JRuby to inspect thrift-generated ruby code. It is therefore necessary for input thrift files to specify ruby and java namespace rules. If the java namespace is not specified in a CompileThriftScala object, it is assumed to be _scala-namespace_.thrift. In order to specify these namespaces, project specifications must provide a list of ThriftNamespaces, as follows:

import sbt._
import com.twitter.sbt._

/**
 * Describes a scala project that relies on two Thrift IDLs, to be compiled to two different namespaces.
 */
class TaxesProject(info: ProjectInfo)
  extends StandardServiceProject(info)
  with CompileThriftScala
{
  def finagleVersion = "1.2.5"
  def finagleCore = "com.twitter" % "finagle-core" % finagleVersion
  def finagleThrift = "com.twitter" % "finagle-thrift" % finagleVersion
  def finagleOstrich = "com.twitter" % "finagle-ostrich4" % finagleVersion

  def thriftNamespaces =
    new ThriftNamespace("Calculator", "gov.irs.taxes.calculator") // Java namespace inferred to be gov.irs.taxes.calculator.thrift
:: new ThriftNamespace( "EZFile", "gov.irs.taxes.ezfile.nondefaultthriftnamespace", "gov.irs.taxes.ezfile")
    :: Nil
}

sbt-thrift's People

Contributors

bitbckt avatar bmatheny avatar fizx avatar freels avatar mariusae avatar ryanking avatar twilliam 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.