* 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
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.
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.
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.
This paves the way for Java 9 compatibility, and removes some
implementation details from consumers' compile-time classpaths. This
may break said consumers.
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.
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.
* 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