This repository was archived by the owner on May 14, 2026. It is now read-only.
Commit 04c2faa
authored
Merge Pre-DIREGAPIC refactoring (#735)
Prepare `gapic-generator-java` for the DIREGAPIC implementation changes.
1) Splitting Grpc-specific classes into their own package (mainly `composer` classes)
2) Extract the transport-agnostic logic of the composer classes into the set of abstract classes.
3) Convert most of the static methods in the `ClassComposer` classes into instance methods to leverage the class inheritance (transport-agnostic logic in abstract class, transport-specific portions are in transport-specific classes extending the abstract ones)
4) The resultant architecture resembles the [Template Method](https://en.wikipedia.org/wiki/Template_method_pattern) design pattern where `Abstract<Name>ClassComposer.generate()` (and potentially the the other private/protected methods called from `generate()`) call transport-specific logic (implemented in the concrete `<Transport><Name>ClassComposer` classes), when appropriate.
5) Refactor the tests and golden files file structure to match the main classes package structure.
6) The golden files were split to be placed under the same directory as the clases which generate them. This was matching the existing infrastructure the best: (1) as the golden files updater makes this assumption (golden file is under the same package as the `<Name>Test.java` which creates it); (2) the repo currently does not have a dedicated test resources directory (there are multiple resource-like subfolders under test, it is hard to keep thing under control and avoid propagating magical path constants); (3) keeping golden files and tests together seems ok, since if the golden files were smaller they would be simply put as the expected constants in the tests themselves.
7) This PR tries to preserve the original history of the files as accurately as possible (i.e. prioritizes clear move semantics over delete/create semantics in terms of file diff, where possible).
The subsequent PR with rest implementation will looks something like [this](vam-google/gapic-generator-java@master...vam-google:diregapic_main)1 parent 44a42a0 commit 04c2faa
92 files changed
Lines changed: 2940 additions & 2043 deletions
File tree
- .github/workflows
- src
- main/java/com/google/api/generator/gapic
- composer
- comment
- common
- grpc
- store
- utils
- model
- protoparser
- test/java/com/google/api/generator
- gapic/composer
- common
- goldens
- constants
- goldens
- grpc
- goldens
- resourcename
- goldens
- test/framework
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
19 | | - | |
| 18 | + | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| |||
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
20 | 29 | | |
21 | 30 | | |
22 | 31 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| |||
Lines changed: 19 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
35 | 41 | | |
36 | 42 | | |
37 | 43 | | |
38 | 44 | | |
39 | 45 | | |
40 | | - | |
41 | 46 | | |
42 | 47 | | |
43 | 48 | | |
44 | 49 | | |
45 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
46 | 53 | | |
47 | 54 | | |
48 | 55 | | |
49 | 56 | | |
50 | | - | |
| 57 | + | |
51 | 58 | | |
52 | 59 | | |
53 | 60 | | |
54 | 61 | | |
55 | 62 | | |
56 | | - | |
57 | 63 | | |
58 | 64 | | |
59 | 65 | | |
60 | 66 | | |
61 | 67 | | |
62 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
63 | 72 | | |
64 | 73 | | |
65 | 74 | | |
| |||
0 commit comments