Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output header file is not used for generated types in multi-file mode #79

Closed
FiniteReality opened this issue Aug 8, 2019 · 0 comments

Comments

@FiniteReality
Copy link
Contributor

commented Aug 8, 2019

When using --config multi-file, ClangSharpPInvokeGenerator does not use the header file (-h) when generating files for subtypes - only the main methods file gets the header file.

From cursory inspection, this is probably because the generated subtypes do not have any usings, and the header text is only added if there are any using directives:

if (outputBuilder.UsingDirectives.Any() && _config.GenerateMultipleFiles)
{
sw.Write(_config.HeaderText);

FiniteReality added a commit to FiniteReality/ClangSharp that referenced this issue Aug 8, 2019

Always write headers and check against empty paths
This fixes microsoft#78 and fixes microsoft#79. Header files are written whenever a valid
header file is passed, and null/empty paths are now ignored.

tannergooding added a commit that referenced this issue Aug 10, 2019

Always write headers and check against empty paths (#80)
* Always write headers and check against empty paths

This fixes #78 and fixes #79. Header files are written whenever a valid
header file is passed, and null/empty paths are now ignored.

* Skip generating the header in the method class

It was already written earlier, so it is unnecessary.

* Make suggested changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.