-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[generator] Support XML defined enums with no JNI info (#659)
Fixes: #515 Our `.csv` format for specifying enums allows creating enum fields that do not map to a JNI field. This is often used to add a `None` enum field to a Java `[Flags]` enum: 0,,0,Android.AccessibilityServices.AccessibilityServiceCapabilities,None However our XML format does not support this because it considers the (`//mapping/@jni-class` or `//mapping/@jni-interface`) and `//mapping/@jni-name` attributes to be mandatory when translating the XML format to `.csv` format. We can remove this restriction and correctly generate the needed `.csv` format so that users using the XML format can add arbitrary enums that `generator` knows about, permitting: <mapping clr-enum-type='Android.Support.V4.App.FragmentTagType' bitfield='true'> <field clr-name='Name' value='0' /> <field clr-name='Id' value='1' /> <field clr-name='Tag' value='2' /> </mapping> in addition to the previously required: <mapping jni-interface='android/support/v4/app/FragmentActivity$FragmentTag' clr-enum-type='Android.Support.V4.App.FragmentTagType' bitfield='true'> <field jni-name='Fragment_name' clr-name='Name' value='0' /> <field jni-name='Fragment_id' clr-name='Id' value='1' /> <field jni-name='Fragment_tag' clr-name='Tag' value='2' /> </mapping>
- Loading branch information
Showing
2 changed files
with
120 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters