Skip to content

Commit 45955be

Browse files
authored
chore(AIP-191): add Rationale for Java options (#1365)
* chore(AIP-191): add Rationale for Java options * address feedback * remove rationale example
1 parent a227f74 commit 45955be

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

aip/general/0191.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,20 @@ which don't include compound names, be aware that _adding_ this annotation
127127
(with a value not equivalent to the default) constitutes a breaking change in
128128
that language. When releasing protos, be sure that omissions are intentional.
129129
130+
## Rationale
131+
132+
### Java packaging options
133+
134+
Set the option, `java_multiple_files`, to true to get a cleaner file structure.
135+
Doing so instructs `protoc` to create one output file per Protobuf type, which
136+
allows for more fine-grained imports. The option, `java_outer_classname`, is
137+
required in combination with `java_multiple_files`. It instructs `protoc` to
138+
wrap each compiled Protobuf type in a Java class whose name is the value of the
139+
option. This prevents potential naming collisions between generated types.
140+
130141
## Changelog
131142
143+
- **2024-06-05**: Added rationale for Java packaging options.
132144
- **2023-02-24**: Added guidance on protobuf syntax.
133145
- **2022-10-18**: Added guidance on Ruby/PHP/C# options.
134146
- **2019-11-18**: Added guidance on the packaging annotations.

0 commit comments

Comments
 (0)