Commit b00e644
authored
[Java.Interop.Tools.Generator] Create a v2 version of map.csv (#646)
For ages, `generator --enumfields` has supported a `map.csv` format,
which was used within xamarin-android to "enumify" `Mono.Android.dll`.
This format was entirely undocumented.
Add `Documentation/EnumMappingFile.md` and document the format.
The previous `map.csv` line is 5-6 "columns", comma-delimited:
* API level the field was added in
* C# namespace and type of the C# enum to create.
* C# enum member name to create.
* C# enum member value
* JNI field to convert to the C# enum member, in the format
`{JNI type reference}.{Java field name}`.
* Flags? If (1) present, and (2) has the value `flags`, the
created C# enum has the `[Flags]` attribute.
Add support for a new 7-8 column line format, also documented in
`EnumMappingFile.md`:
* Action: `E`num, `A`dd, `R`emove, `I`gnore, `?` (decide later)
* API level
* JNI field to convert to the C# enum member, in the format
`{JNI type reference}.{Java field name}`.
* C# enum member value (which is the Java field value)
* C# namespace and type of C# enum to create
* C# enum member name to create.
* What to do with the Java field: `remove` it or `keep` it.
Replaces the previous `- ENTER TRANSIENT MODE -` "command".
* Flags? If (1) present, and (2) has the value `flags`, the
created C# enum has the `[Flags]` attribute.
Note that the column ordering for the 7-8 column format differs from
the previous 5-6 column format. This change in ordering is done for
improved "enumification workflow" support: future tooling will
generate the 7-8 column output *without* knowing what the C# enum type
and members will be. Placing the JNI information "leftmost" allows
the output to be "sensibly grouped" by tooling:
?,0,com/example/Class.FIELD,0,,,remove,
Support for parsing `map.csv` has been moved out of `generator.exe`
and into the new `Java.Interop.Tools.Generator.dll` assembly, in
`src/Java.Interop.Tools.Generator`. This new assembly will also be
used by a forthcoming `generator-utilities` app.1 parent 1708d8a commit b00e644
File tree
18 files changed
+1041
-58
lines changed- Documentation
- build-tools/automation
- src/Java.Interop.Tools.Generator
- Enumification
- Extensions
- Utilities
- tests
- Java.Interop.Tools.Generator-Tests
- Enumification
- generator-Tests/Unit-Tests
- tools/generator
- Java.Interop.Tools.Generator.Transformation
- Utilities
18 files changed
+1041
-58
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
90 | 94 | | |
91 | 95 | | |
92 | 96 | | |
| |||
239 | 243 | | |
240 | 244 | | |
241 | 245 | | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
242 | 254 | | |
243 | 255 | | |
244 | 256 | | |
| |||
280 | 292 | | |
281 | 293 | | |
282 | 294 | | |
| 295 | + | |
| 296 | + | |
283 | 297 | | |
284 | 298 | | |
285 | 299 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
98 | 105 | | |
99 | 106 | | |
100 | 107 | | |
| |||
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
0 commit comments