Граф коммитов

366 Коммитов

Автор SHA1 Сообщение Дата
Dino Kovač 4c5e96b38d Json Protocol support (#156)
Add Json Protocol support
2017-11-18 09:45:12 -08:00
Ben Bader 68175513c6 Properly handle escaped quotation marks in literals (#155) 2017-10-15 23:14:18 -07:00
Zac Sweers de1335abc1 Add UUID to parsing for matching elements across instances (#152)
* Add UUID to parsing for matching elements across instances

This is a prototype of trying to tag parsed elements with unique IDs so that one could match them even if you `newBuilder`'d it, you could match back other elements that reference the now-old reference to them. This would allow for one to normalize references in a `Schema` after changing a bunch of elements in it, such as with a preprocessor to edit Schemas before code gen.

If the implementation here looks good, I can proceed with figuring out how to update tests to handle this in a deterministic way

* Create ThriftyParserPlugins for hooks into UUID generation

This makes it more testable as well as flexible if others have their own needs. This could also be used to conceivably turn it off, if they don't care about it and want the slight perf gain

* Defer to ThriftParserPlugins for UUID generation in elements

* Update ThriftParserTest to use plugins
2017-10-11 16:33:20 -07:00
Dino Kovač 39b99da82a Fix reading bool value using compact protocol (#153)
We came across an issue in deserializing a bool value using compact protocol - the value always comes out false.

This PR modifies the test so that it catches this bug and fixes it.
2017-08-09 15:11:41 -07:00
Gabriel Ittner 85ff3c7642 Fix server error handling (#150)
* fix server error handling

* make ThriftException checked

* add ThriftException to Adapter.read methods
2017-07-24 12:51:07 -07:00
Gabriel Ittner 8dea386db7 thrift 0.10.0 (#149) 2017-07-16 13:04:35 -07:00
Gabriel Ittner dac643223c Split ClientBase to enabled synchronous calls (#147) 2017-06-24 12:43:38 -07:00
Ben Bader 553882c16b
Prepare next development version 2017-05-02 11:52:51 -07:00
Ben Bader 2a67612ffa
Release version 0.4.2 2017-05-02 11:39:48 -07:00
Ben Bader 0b7bb17179 Add EnumMember#toBuilder() (#141) 2017-05-02 10:58:12 -07:00
Ben Bader 0eeef3bd4f Use "$L" for JavaPoet's addJavadoc methods (#139)
Evidently it has always been a formatter method, we've just never
noticed.  Javadoc with sigils in them break, because there would never
be arguments.  This change stops JavaPoet from interpreting our Javadoc.
2017-04-18 13:06:30 -07:00
Ben Bader 22abda9a97
Prepare next development version 2017-03-16 14:56:16 -07:00
Ben Bader 10c4e91186
Release version 0.4.1 2017-03-14 15:22:31 -07:00
Ben Bader 34caf19462 Stop printing the working path in ThriftyCompiler (#137) 2017-03-09 17:07:21 -08:00
Ben Bader f641afe2b2 Speed up Travis builds, hopefully (#136) 2017-03-09 14:57:40 -08:00
Ben Bader 5acf19be1d Add a codecov.io badge to README.md (#135) 2017-03-09 14:35:25 -08:00
Ben Bader 03c5e7b098 Apply codecov.io configuration (#134) 2017-03-09 14:21:28 -08:00
Ben Bader 6007d2ec70 Fix IndexOutOfBoundsException on empty comments (#133)
Like "#\n" or "//\n", for example.
2017-03-09 11:07:33 -08:00
Ben Bader e8b10d9ba2
Prepare next development version 2017-03-08 16:38:14 -08:00
Ben Bader 97bee084f8
Prepare release 0.4.0 2017-03-08 16:36:20 -08:00
Ben Bader 2a705f6199 Exclude generated classes from JaCoCo reports (#130) 2017-03-08 16:08:33 -08:00
Ben Bader 000857c1bc Add test coverage of collection-type validation (#129)
The latest installment of JaCoCo-guided testing.  This time, we add
tests for validating collection-typed constants.
2017-03-08 15:34:39 -08:00
Ben Bader ab19685989 Improve reporting of duplicate-symbol errors (#128)
The first installment of JaCoCo-directed testing has borne fruit!  It
turns out that:
a) we were not testing handling of duplicate symbols at all, and
b) our error-reporting was not good.

Now we use an ErrorReporter, and have tests.
2017-03-08 14:21:03 -08:00
Ben Bader e6f1cb7298 Add JaCoCo report generation (#127) 2017-03-08 13:29:16 -08:00
Ben Bader 999cb495b8 Bump Gradle to 3.4.1 to fix incremental compilation (#126) 2017-03-06 11:13:30 -08:00
Ben Bader 9da1602315 Fix remaining warnings reported by ErrorProne (#125) 2017-03-06 10:39:12 -08:00
Ben Bader 6147f4a184 Add ErrorProne checks, fix resulting issues. (#124)
Also, remove long-ignored dead tests.  Dead code is worse than no code.
2017-03-05 00:28:54 -08:00
Ben Bader b8ee4bc477 Adopt more-idiomatic Java 8 (#123)
- Remove now-redundant type arguments
- Use new Map APIs like computeIfAbsent
- Use lambdas instead of anonymous Runnables
2017-03-04 23:05:53 -08:00
Ben Bader b4669d0fc3 Collapse JavadocUtil into UserElement. Yay, JDK8! (#122) 2017-03-04 16:35:52 -08:00
Ben Bader 13c0b8eed8 Use 'java-library' plugin instead of 'java' (#121)
This paves the way for Java 9 compatibility, and removes some
implementation details from consumers' compile-time classpaths.  This
may break said consumers.
2017-03-02 16:43:43 -08:00
Ben Bader 968e2fd315 Use Path instead of Strings and Files (#119)
This change updates the Loader API to take Path for thrift files and
for include directories, instead of String and File.  The prior API is
now deprecated, and will be removed prior to 1.0.0.

The compiler and code-generator are updated to accommodate the new API.
2017-02-24 15:43:24 -08:00
Ben Bader fbfdbd383b Update to Gradle 3.4 (#117) 2017-02-22 22:16:56 -08:00
Ben Bader 388376923b Emit hex literals as hex (#116)
* Add thrift text to ConstValueElement

* Emit ints defined in hex using hex literals
2017-02-22 16:40:29 -08:00
Ben Bader 247b6c4203 Replace trivial list transformations with streams (#115)
We can remove lots of intermediate collection-builders and simple
traversals with stream methods; the easy ones in thrifty-schema are
done here.
2017-02-20 22:38:16 -08:00
Ben Bader 897d054c62 Update Guava to 21.0, remove FluentIterable use (#114) 2017-02-20 22:13:26 -08:00
Ben Bader 028f85f0d5 Target Java 8 for compiler, keep 7 for runtime (#110)
* Target Java 8 for compiler, keep 7 for runtime

* Use Oracle JDK 8 for Travis builds

* Ensure JDK 8 is up-to-date in Travis builds
2017-02-20 18:20:22 -08:00
Ben Bader ae96bde19f Suppress StringEquality warnings on gen'd equals methods (#109) 2017-02-20 18:01:03 -08:00
Ben Bader 980df3a427 Throw a ThriftException on reading unrecognized enum values (#107) 2017-02-20 14:54:23 -08:00
Ben Bader 9068732af0 Improve emitted ThriftField annotations (#108) 2017-02-20 14:53:11 -08:00
Ben Bader 67ba3b4b30 Rewrite parser with ANTLR (#104)
Time for another Very Large Change! Here, finally, is the end of the old hand-rolled parser - and, hopefully, the end of fiddly little bugs around trailing-doc comment parsing.

This change should be nearly transparent to consumers; the only visible difference is in parser error reporting. Previously, we would just throw an exception at the first encountered error. We still throw an exception, but now gather all encountered errors into a message.

This is in anticipation of refactoring error reporting a bit; for now, I'd prefer to keep a stable API.

In the process of implementing this, I upgraded AutoValue and finally got tired of the Gradle plugin we were using - I've replaced it with tbroyer's apt plugin, which is comparatively well-behaved.

Fixes #30.
2017-02-18 14:24:18 -08:00
Ben Bader 32e789148b Fix enum-member parsing with doc comments (#103) 2017-02-14 22:46:46 -08:00
Ben Bader 95cc1a19d3
Prepare next development version 2017-02-10 23:33:45 -08:00
Ben Bader 5f75345fab
Release version 0.3.2 2017-02-10 23:29:15 -08:00
Zac Sweers 15378e3659 Pass type through constant builder (#102) 2017-02-10 16:01:56 -08:00
Zac Sweers 046de51dd2 Replace annotations field in UserElementMixin directly rather than building an additive map (#101)
Matches conventions in the other builders
2017-02-10 14:17:32 -08:00
Zac Sweers a3caa99763 Add builders for servicemethod and constant (#99)
* Add builders for servicemethod and constant

This also adds some convenience toBuilders() on their respective elements

* Remove elements from builders to match other types' conventions

* Extend AbstractUserElementBuilder
2017-02-10 11:30:57 -08:00
Zac Sweers b5ec016d30 More lenient collections in builders (#100)
AutoValue can detect guava's immutables and do the defensive copy under the hood for us
2017-02-10 09:35:43 -08:00
Zac Sweers 2a49595424 Add convenience type() to user element builder (#98)
* Add convenience type() to user element builder

This lets you do the update from an existing type in a batch update

* Match generic
2017-02-10 09:34:48 -08:00
Ben Bader 45e839834e Suppress NumberEquality warnings for gen'd equals (#97) 2017-02-10 08:55:18 -08:00
Ben Bader 97f12967c5 Add builders to collection types (#96) 2017-02-10 08:54:30 -08:00