Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

file 297 lines (261 sloc) 13.582 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297
3.1.1 - 04/16/2013
===============================================================================
* BREAKING CHANGE:
    We finally made scrooge-runtime to be backward with Scrooge 2. This requires
    a name change for the ThriftStructCodec. From now on, all objects generated
    by Scrooge 3 will use ThriftStructCodec3.
    This will affect you only if your code is using ThriftStructCodec directly,
    which is not common.
* add language option tag to scrooge-maven-plugin, thanks to @eirslett
* some directory reorganization of the demos

3.1.0 - 04/11/2013
===============================================================================
* Dependency changes: now on util/finagle 6.3.0
* demo project now shows how to construct finagle server and client using
generated code
* --ostrich flag implies --finagle flag

3.0.9 - 03/27/2013
===============================================================================
* Remove "provided" scope of finagle in scrooge-runtime. So it brings Finagle
  6.1.0 as transit dependency to your project
* Make the generated Scala code backward compatible with Finagle 5. The impact
  to users on Finagle 6 is that you will see a lot of warnings saying that
  tracerFactory is deprecated.

3.0.8 - 03/18/2013
===============================================================================
* When scrooge-maven-plugin extracts Thrift files from a dependency artifact, it
  now puts them in a sub folder named after the artifact id. This way, the user
  project can use same-named Thrift files from different artifacts.
* Title case and camel case more consistent with previous version before 3.0.7
  We still preserve consecutive upper cases but not in an all-up-case string, eg:
     TBird (original) -> tBird (camel case) -> TBird (title case)
     HTML (original) -> html (camel case) -> Html (title case)
  Thanks to @erikvanoosten
* Finagle client can throw exception on void function. Thanks to @brancek
* Support documentation on enum values. Thanks to @erikvanoosten
* Reorganizing test folder, and add Apache standard test

3.0.7 - 03/07/2013
===============================================================================
* All on-wire names in the Thrift messages are now consistent with
Apache generated code. This allows Scrooge generated services to exchange
Thrift messages with Apache generated services.
* Title case ids now preserve consecutive upper case letters. Eg:
     TBird (original) -> Tbird (old) -> TBird (now)
  See test case in scrooge-generator/src/test/scala/com/twitter/scrooge/ASTSpec.scala
* scrooge-maven-plugin now enforces an explicit white list in <dependencyConfig>.
The old behavior is that if a dependency artifact has a "idl" classifier, we
will extract thrift files from it to compile. The new behavior is that the
artifact must be explicitly included in <dependencyConfig>. The dependencies
here include both direct dependencies(specified in project pom file) and
indirect dependencies (everything in the dependency tree).
* Now supports "scala" as a namespace scope. It is treated same as "java".
* Now supports "*" as a default namespace scope

3.0.6 - 02/15/2013
===============================================================================
* Released a scrooge-maven-plugin, for maven projects to integrate Scrooge in
  their pom files. Also released a demo of how to use scrooge-maven-plugin
* scrooge-runtime is now backward compatible with scrooge-runtime 2.X.X. The
  following classes and methods are deprecated:
    FinagleThriftClient,
    FinagleThriftService,
    ThriftStructCodec.decoder,
    ThriftStructCodec.encoder
* scrooge-runtime now can introspect generated ThriftStruct. See the new
  ThriftStructMetaData class.
* BREAKING: in scrooge-runtime, com.twitter.ScroogeOption is now renamed to
  just Option. This is mainly for Java code. But if you need to use it in
  Scala code, make sure to address ambiguity with scala.Option.
* Updated APIs of scrooge-generator. See com.twitter.scrooge.Compiler class
* Fix the stats reporting for the java scrooge thrift code generation

3.0.5 - 02/04/2013
===============================================================================
Bug fixes
* Constant definitions now can be of "set" type.
* Fix letter cases of enum fields(Java uses upper case; Scala uses title case)
Dependencies
* Remove dependency on org.scalatest, com.twitter.scalatest (not in Maven
  Central)
* Update dependency of util/finagle/ostrich to 6.1.0
* Project dependencies are all in Maven Central now. You don't need to have
  access to Twitter internal repository anymore.

3.0.4 - 01/27/2013
===============================================================================
Features:
* add --dry-run option to parse and validate source thrift files, reports any
  errors, but does not emit any generated source code. It can be used with
  --gen-file-mapping to get the file mapping
Bug fixes
* union types now can contain primitive types.
* constants defined in the same file now can be referenced.
Dependencies
* Update dependency of util/finagle/ostrich to 6.0.6

3.0.3 - 12/21/2012
===============================================================================
* Scrooge artifacts now deploys to Maven central via Sonatype
* Scrooge project builds in Travis CI
* Features
  - Fully qualifying ids imported by "include" statements. We don't generate
  "import" statements anymore.
  - Remove unnecessary finagle jar dependencies for vanilla generated code.
* Add tests
  - non-finagle usage; see NonFinagleSpec.scala
  - struct immutability and deep copying; see ImmutableStructSpec.scala
* Bug fixes
  - move "validate" method from Scala struct trait to object, so that the thrift
   struct can define a "validate" field without name clashing.

3.0.2 - 11/16/2012
===============================================================================
* Adding a "--gen-file-map <path>" option to Scrooge command line. It tells
  what output files each input Thrift files generates, in the following format:
     inputPath/input.thrift -> outputPath/Constants.scala
     inputPath/input.thrift -> outputPath/FooStruct.scala
* The generated enums now have a common trait ThriftEnum(defined in
  scrooge-runtime), that allows you to query the name as well as the value of
  the enum field.
* The generated Scala enums now are Java-serializable.
* The generated FinagledClient class takes val arguments to make "service",
  "protocol" accessible:
       class FinagledClient(
         val service: ...,
         val protocol: ...,
         val serviceName: ...
         stats: ...
       )

3.0.1 - 10/30/2012
===============================================================================
Features and bug fixes
* Doc comments are included in the generated code.
* Generated exception structs now have getMessage() method
* Generate header that emits Scrooge version
* You can now import a directory or a Jar/Zip file through command line
  argument, which will be stored in a chain of paths maintained by Scrooge.
  Then refer to a file using relative path in the thrift "include" statement.
  Scrooge will locate the file in the path chain.
* Introduce a "strict" mode that defaults to on. Unfavored syntax throws an
  exception when "strict" mode is on and prints a warning when it's off. The
  strict mode can be disabled by specifying the "--disable-strict" argument.
* The "oneway" modifier is treated as an OnewayNotSupportedException in strict
  mode and a warning in non-strict mode.
* Support Union types. Given:
       union Point {
         1: double x
         2: double y
         3: Color color = BLUE
       }
  Scrooge generates:
       sealed trait Point
       object Point {
         case class X(x: Double) extends Point
         case class Y(y: Double) extends Point
         case class Count(color: Color = Color.Blue) extends Point
       }
  The "required" and "optional" modifiers in a union type will throw
  exceptions in strict mode and print warnings in non-strict mode.
* Have a common trait ThriftException for all the thrift exception structs.
* Support cross file service inheritance. Now you can do
       include "foo.thrift"
       service MyService extends foo.FooService { ... }
* Bug fix: It couldn't resolve a symbol imported through a relative path and
  threw an UndefinedSymbolException
* Bug fix: namespace aliasing put the parentheses in the wrong place.
* Bug fix: services using binary fields wouldn't compile
* Bug fix: cross-file const referencing didn't work

Implementation updates
* Project structure:
    - frontend: Importer and ThriftParser
    - mustache: everything related to mustache, including template parser, loader
      and handlebar
    - ast: Thrift AST definition
    - backend: code generation include various generators and dictionaries to
      hydrate Mustache templates.
* Redefine clear and separate responsibilities of each components:
    - Move ID manipulation(concatenation, case conversion, keyword rewriting etc)
      to Generator phase.
    - Utilizing Scala static type checking to enforce scoping correctness by
      introducing SimpleID and QualifiedID to AST.
    - Enforce dictionary key uniqueness for nested Mustache templates.
* Scrooge project is now on Maven
* Delete obsolete code and tests

Dependencies:
* Upgraded to util 5.3.13, finagle 5.3.30
* Removed dependency on sbt
* Add dependency on maven

3.0.0 - 05/24/2012
===============================================================================
* Java code generation is now supported!
* Scala code now generates a set of classes for each struct:
    - a base trait
    - an immutable case class (used as the default implementation)
    - a proxy trait (to make it easy to build proxy classes)
* Moved scrooge-runtime into the same repo with scrooge, which is now called
  scrooge-generator. Both projects will keep version numbers in sync now.
* Changed the way required/optional is treated on fields, and default values,
  to more closely match the way Apache Thrift works. (This is described in
  more detail in a new section of the README.)
* Fixed constant sets.
* Fixed thread safety in finagle ThriftServer.
* Fixed the resolution of #include directives that follow relative paths.
* Removed the finagle dependency from scrooge-runtime so that code generated
  with scrooge can be loosely coupled with finagle, or optionally not depend
  on finagle at all (if you don't build finagle bindings).
* Fixed typedef references that were relative to #included files.
* Made various improvements to the internal template system.
* Fixed test speed by using scrooge to generate code that the tests build
  against, avoiding runtime evaluation.

Dependencies:
* Upgraded to thrift 0.8.0, util 4.0, and finagle 4.0.
* Upgraded to sbt 0.11.2.
* Upgraded to scala 2.9.2.


2.5.4 - 03/19/2012
===============================================================================
* Addressed an issue where structs with the same name but from different
  namespaces/packages would conflict. Now using a package alias to
  disambiguate.


2.5.3 - 03/02/2012
===============================================================================
* Minor bug fix for serviceName name class with.


2.4.0 - 01/03/2012
===============================================================================
* added support for structs with more than 22 fields, which previously was the
  limit as that is the max case-class size in scala. For structs larger than
  this, instead of using case-classes, normal classes are used but with most of
  the case-class boilerplate support code also generated, allowing these structs
  to be used as if they were case-classes. The only exception is that there is
  no unapply method; but do you really want to unapply 23+ fields in a match
  statement?


2.3.1 - 11/28/2011
===============================================================================
* thriftProtocolFactory in generated ThriftServer now has
  type of TProtocolFactory, so you can override it with other
  protocol factories.


2.3.0 - 11/24/2011
===============================================================================
* You can now override serverBuilder in ThriftServer to provide
  additional server configuration
* The protocol factory to the FinagledClient now has a default
  value of TBinaryProtocol.Factory, which means you don't have
  to specify it when using the default.


2.2.0 - 11/04/2011
===============================================================================
* tracerFactory support in ThriftServer.


2.1.0 - 10/23/2011
===============================================================================
* Support for tracing in server.


2.0.2
===============================================================================
* fixes a bug in which namespace mapping was not applied
  recursively to included documents.


2.0.1
===============================================================================
* fixes a bug in which qualified service names from imported
  thrift files were not resolved properly.


2.0.0
===============================================================================
* fixes a bug with enum in which the first value was wrong.


1.1.1 - 8/24/2011
===============================================================================
* scrooge-runtime-1.0.1
* Each thrift struct companion object now extends ThriftStructCodec
* Correctly resolving enum constants and Const values.
* Title-casing enum value names.
* Added support for namespace renaming from the command line.
Something went wrong with that request. Please try again.