Skip to content

Tmds.DBus.Tool: Add an option to generate public types - #83

Merged
tmds merged 1 commit into
tmds:masterfrom
matdug:master
Sep 9, 2020
Merged

Tmds.DBus.Tool: Add an option to generate public types#83
tmds merged 1 commit into
tmds:masterfrom
matdug:master

Conversation

@matdug

@matdug matdug commented Aug 2, 2020

Copy link
Copy Markdown
Contributor

Currently the types that are generated by the codegen tool have an implicit "internal" access modifier. This is fine if you intend to use the generated types from within the same assembly where they will be included, but they are not visible to other assemblies.
I would like to add the possibility to generate these types with the "public" access modifier so that they can be referenced from other assemblies. For this I propose the --public-types command line option. The default behaviour when the option is omitted is for the types to remain "internal".

@matdug matdug changed the title TMDS.DBUS.TOOL: Add an option to generate public types Tmds.DBus.Tool: Add an option to generate public types Aug 2, 2020
Comment thread src/Tmds.DBus.Tool/CodeGenCommand.cs Outdated
_catOption = Configuration.Option("--cat", "Write to standard out instead of file", CommandOptionType.NoValue);
_skipOptions = Configuration.Option("--skip", "DBus interfaces to skip", CommandOptionType.MultipleValue);
_interfaceOptions = Configuration.Option("--interface", "DBus interfaces to include, optionally specify a name (e.g. 'org.freedesktop.NetworkManager.Device.Wired:WiredDevice')", CommandOptionType.MultipleValue);
_publicTypesOption = Configuration.Option("--public-types", "The types generated by this tool will have a public access modifier (default: internal)", CommandOptionType.NoValue);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: rename --public-types to --public
and The code generated by this tool will have public access modifier (default: internal).

@tmds

tmds commented Aug 25, 2020

Copy link
Copy Markdown
Owner

@matdug thanks for this contribution! It looks good to me. I have a small suggestion on naming/phrasing.

@matdug

matdug commented Sep 1, 2020

Copy link
Copy Markdown
Contributor Author

Hi @tmds , I made the changes as per your comments.
Thanks,
Mathieu

@tmds
tmds merged commit 2654ae5 into tmds:master Sep 9, 2020
@tmds

tmds commented Sep 9, 2020

Copy link
Copy Markdown
Owner

Thank you @matdug!

@tmds

tmds commented Sep 9, 2020

Copy link
Copy Markdown
Owner

@matdug this is part of v0.9.0 which I just uploaded to nuget.org.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants