Skip to content

Commit

Permalink
2.7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
owent committed May 26, 2020
1 parent cccf759 commit 7c07309
Show file tree
Hide file tree
Showing 108 changed files with 5,983 additions and 5,417 deletions.
9 changes: 9 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
更新记录
==========

2.7.2
------

1. 修复一处枚举类型验证器复用丢失的问题
2. 增加插件 ```org.xresloader.field_required``` , 用于向proto3提供,proto2的 **required** 约束
3. 升级protobuf到3.12.1
4. 升级log4j到2.13.3
5. 升级org.json到20200518

2.7.1
------

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,8 @@ Protobuf插件
| org.xresloader.field_description | 字段描述信息,会写入输出的header中和代码中 |
| org.xresloader.field_alias | 字段别名,配合 **验证器** 功能,允许在数据源中直接填写别名来配置数据 |
| org.xresloader.field_ratio | 字段放大,用于比如配置百分率为 0.12,当 org.xresloader.field_ratio=100时转出的数据为12 |
| org.xresloader.field_separator | Plain模式分隔符,可指定多个,用于在一个单元格内配置复杂格式时的分隔符列表,默认值: ```,;|``` |
| org.xresloader.field_required | 设置字段为 **required** ,用于向proto3提供,proto2的 **required** 约束 |
| org.xresloader.ue.key_tag | 生成UE代码时,如果需要支持多个Key组合成一个Name,用这个字段指定系数(必须大于0) |
| org.xresloader.ue.ueTypeName | 生成UE代码时,如果指定了这个字段,那么生成的字段类型将是 ```TSoftObjectPtr<ueTypeName>``` , 并且支持蓝图中直接引用 |

Expand Down
10 changes: 10 additions & 0 deletions header/extensions/google/protobuf/compiler/plugin.proto
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,16 @@ message CodeGeneratorResponse {
// exiting with a non-zero status code.
optional string error = 1;

// A bitmask of supported features that the code generator supports.
// This is a bitwise "or" of values from the Feature enum.
optional uint64 supported_features = 2;

// Sync with code_generator.h.
enum Feature {
FEATURE_NONE = 0;
FEATURE_PROTO3_OPTIONAL = 1;
}

// Represents a single generated file.
message File {
// The file name, relative to the output directory. The name must not
Expand Down
26 changes: 25 additions & 1 deletion header/extensions/google/protobuf/descriptor.proto
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ message ExtensionRangeOptions {
// The parser stores options it doesn't recognize here. See above.
repeated UninterpretedOption uninterpreted_option = 999;


// Clients can define custom options in extensions of this message. See above.
extensions 1000 to max;
}
Expand Down Expand Up @@ -212,6 +213,29 @@ message FieldDescriptorProto {
optional string json_name = 10;

optional FieldOptions options = 8;

// If true, this is a proto3 "optional". When a proto3 field is optional, it
// tracks presence regardless of field type.
//
// When proto3_optional is true, this field must be belong to a oneof to
// signal to old proto3 clients that presence is tracked for this field. This
// oneof is known as a "synthetic" oneof, and this field must be its sole
// member (each proto3 optional field gets its own synthetic oneof). Synthetic
// oneofs exist in the descriptor only, and do not generate any API. Synthetic
// oneofs must be ordered after all "real" oneofs.
//
// For message fields, proto3_optional doesn't create any semantic change,
// since non-repeated message fields always track presence. However it still
// indicates the semantic detail of whether the user wrote "optional" or not.
// This can be useful for round-tripping the .proto file. For consistency we
// give message fields a synthetic oneof also, even though it is not required
// to track presence. This is especially important because the parser can't
// tell if a field is a message or an enum, so it must always create a
// synthetic oneof.
//
// Proto2 optional fields do not set this flag, because they already indicate
// optional with `LABEL_OPTIONAL`.
optional bool proto3_optional = 17;
}

// Describes a oneof.
Expand Down Expand Up @@ -393,7 +417,7 @@ message FileOptions {

// Enables the use of arenas for the proto messages in this file. This applies
// only to generated classes for C++.
optional bool cc_enable_arenas = 31 [default = false];
optional bool cc_enable_arenas = 31 [default = true];


// Sets the objective c class prefix which is prepended to all objective c
Expand Down
1 change: 1 addition & 0 deletions header/extensions/v2/xresloader.proto
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ extend google.protobuf.FieldOptions {
optional string field_alias = 1012; // 字段别名,可用于验证器名字
optional int32 field_ratio = 1013; // 字段放大倍数,可用于验证器名字
optional string field_separator = 1014; // Plain模式字段分隔符(默认为: ,;|)
optional bool field_required = 1015; // 字段标记为必须,相当于 pb2 的required

// 用户自定义扩展字段请使用 2000 to max;
// extensions 1000 to max;
Expand Down
1 change: 1 addition & 0 deletions header/extensions/v3/xresloader.proto
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ extend google.protobuf.FieldOptions {
string field_alias = 1012; // 字段别名,可用于验证器名字
int32 field_ratio = 1013; // 字段放大倍数,可用于验证器名字
string field_separator = 1014; // Plain模式字段分隔符(默认为: ,;|)
bool field_required = 1015; // 字段标记为必须,相当于 pb2 的required

// 用户自定义扩展字段请使用 2000 to max;
// extensions 1000 to max;
Expand Down
41 changes: 30 additions & 11 deletions header/org/xresloader/Xresloader.java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 18 additions & 2 deletions header/org/xresloader/pb/PbHeaderV3.java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions header/pb_header.pb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

data_block ( R dataBlock*
data_message_type ( RdataMessageType
�
�
extensions/v2/xresloader.protoorg.xresloader google/protobuf/descriptor.proto:H
file_description.google.protobuf.FileOptions� ( RfileDescription:I
msg_description.google.protobuf.MessageOptions� ( RmsgDescription:W
Expand All @@ -24,7 +24,8 @@ data_block ( R dataBlock*
fieldAlias:?
field_ratio.google.protobuf.FieldOptions� (R
fieldRatio:G
field_separator.google.protobuf.FieldOptions� ( RfieldSeparator:K
field_separator.google.protobuf.FieldOptions� ( RfieldSeparator:E
field_required.google.protobuf.FieldOptions� (RfieldRequired:K
oneof_description.google.protobuf.OneofOptions� ( RoneofDescription:H
enum_description.google.protobuf.EnumOptions� ( RenumDescription:O
enumv_description!.google.protobuf.EnumValueOptions� ( RenumvDescription:A
Expand Down
Loading

0 comments on commit 7c07309

Please sign in to comment.