Skip to content
A Thrift parser/generator
Scala Java HTML Thrift Objective-C Shell Other
Latest commit 8208734 May 2, 2016 @ryangreenberg ryangreenberg committed with jenkins scrooge: Document usage of unions from generated Scala
PROBLEM
Scrooge provides limited information about how to use the Scala
code it generates.

PARTIAL SOLUTION
Provide examples of how to use unions.

RB_ID=827823
Failed to load latest commit information.
.github Add PULL_REQUEST_TEMPLATEs Mar 10, 2016
bin finagle/finatra/scrooge/twitter-server: bin/travisci updates and fixes Apr 21, 2016
demos/scrooge-maven-demo Twitter OSS: Prepare libraries for next release Apr 27, 2016
doc/src/sphinx scrooge: Document usage of unions from generated Scala May 2, 2016
project Twitter OSS: Prepare libraries for next release Apr 27, 2016
scrooge-benchmark source: fix more unused imports for scala 2.11.8 Mar 29, 2016
scrooge-core Problem Apr 11, 2016
scrooge-generator-tests scrooge: Add deserialization context on generated Java Thrift clients Apr 11, 2016
scrooge-generator scrooge-generator: Adds regex parsers to generator Apr 27, 2016
scrooge-linter scrooge: cleanup various build warnings Dec 21, 2015
scrooge-maven-plugin Twitter OSS: Prepare libraries for next release Apr 27, 2016
scrooge-sbt-plugin scrooge-generator: experimental-java RIP Mar 10, 2016
scrooge-serializer scrooge: cleanup various build warnings Dec 21, 2015
.gitignore [split] scrooge: Cache mustache resources to improve generation perfo… Oct 7, 2014
.travis.yml twitter-server,scrooge: Skip flaky tests Mar 21, 2016
CHANGES Twitter OSS: Prepare libraries for next release Apr 27, 2016
CONFIG.ini [split] improve SocialGraphUtil exception logging Sep 11, 2014
CONTRIBUTING.md Add PULL_REQUEST_TEMPLATEs Mar 10, 2016
GROUPS [split] improve SocialGraphUtil exception logging Sep 11, 2014
LICENSE [split] improve SocialGraphUtil exception logging Sep 11, 2014
OWNERS util, finagle, scrooge: Add ryano to More Owners Files Feb 4, 2016
README.md scrooge-docs: Modernize the scrooge README Mar 21, 2016
pushsite.bash [split] improve SocialGraphUtil exception logging Sep 11, 2014
sbt scrooge: Switch to typesafe repo for sbt-launcher download Aug 10, 2015

README.md

Scrooge

Build status Coverage status Project status Gitter Maven Central

Scrooge is a thrift code generator written in Scala, which currently generates code for Scala and Java.

It's meant to be a replacement for the apache thrift code generator, and generates conforming, compatible binary codecs by building on top of libthrift. It integrates with the finagle project, exporting stats and finagle APIs, and makes it easy to build high throughput, low latency, robust thrift servers and clients.

Part of the motivation behind scrooge's scala implementation is that since Scala is API-compatible with Java, you can use the apache thrift code generator to generate Java files and use them from within Scala, but the generated code uses Java collections and mutable "bean" classes, causing some annoying boilerplate conversions to be hand-written. Scrooge bypasses the problem by generating Scala code directly. It also uses Scala syntax so the generated code is much more compact.

There is a comprehensive set of unit tests, which generate code, compile it, and execute it to verify expectations, as well as gold files to make it easy to review the effects of changes to the generator.

Status

This project is used in production at Twitter (and many other organizations), and is actively developed and maintained.

Building the develop branch locally

You will need the develop branch of util.

Finagle depends on scrooge-core, so the order in which you build dependencies should be:

  • in util: ./sbt publishLocal
  • in scrooge: ./sbt publishLocal
  • in finagle: ./sbt publishLocal

You will need the develop branch of finagle to run tests in scrooge-generator-tests, but you do not need it to build scrooge otherwise.

Full Documentation

https://twitter.github.io/scrooge/

Something went wrong with that request. Please try again.