(There are documentation changes and new fields in descriptor.proto that have resulted
in changes to the serialized descriptor, but no breaking changes for C#.)
- Always generated into a temp directory so we can see if things changed.
- Add a flag to control exiting with error when stale vs updating.
This should let the continuous builds error out when ObjC needs to have the
checked in sources updated.
Overview of changes:
- A new C#-specific command-line option, legacy_enum_values to revert to the old behavior
- When legacy_enum_values isn't specified, we strip the enum name as a prefix, and PascalCase the value name
- A new attribute within the C# code so that we can always tell the original in-proto name
Regenerating the C# code with legacy_enum_values leads to code which still compiles and works - but
there's more still to do.
proto3.
Added a couple unit test proto3 files, for arena_lite and lite. Cloned
the proto3_arena_unittest to test some of the basics of generated code
(and to ensure that the generated proto3 test files are used by some
test).
For JSON encoding we provide a new option to decide at
encode time whether to use camelCase or original proto field
names:
json = MapMessage.encode_json(m, :preserve_proto_fieldnames => true)
The flags are:
UPB_JSON_ACCEPT_LEGACY_FIELD_NAMES
UPB_JSON_WRITE_LEGACY_FIELD_NAMES
The first just allows the parser to accept the old field names.
The second makes the printer print the old field names.
These flags are intended to be temporary, as a migration aid
for users.
This also renames generate_directories to base_namespace_specified; generating directories is the
immediate *effect* of specifying a base namespace, but with this change the options reflect what has been
specified rather than the effect. (There may be other effects in the future, of course.)
This should have no behavioral changes at all.
This doesn't strictly enforce an 80-column limit, but removes the most egregious violations.
The indentation in the C# generator code is inconsistent in general, unfortunately - if we have
any good tools that can be trusted to reformat, I'd be happy to apply them.
This seems to be some code evolution side effects. Back when there was a custom
string class, we couldn't really error when we finally saw the string was bad
so we had to return the empty string, but now that full validation is done
up front, it can error out.
* `csharp_options`: Added `Options` to encapsulate generator options.
Supported options for now - file_extension, base_namespace
* `{Blah}Generator`: Now accept `Options*` as parameter to constructor
* `csharp_generator.cc`: Parse and populate options
* `Makefile.am`: Added `csharp_options.h`
* `extract_includes.bat.in`: Added `csharp_options.h`
Refactoring code to two commits. This is the first commit