-
Notifications
You must be signed in to change notification settings - Fork 375
Switch GenAPI to an msbuild task for perf #8507
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
Conversation
Make GenAPI an msbuild task so that it can run as part of msbuild, in-proc. Expose all current command line options as msbuild properties and also apply some additional code clean-up (auto fixes by VS). This improvements makes a dotnet/runtime build 50s faster on my machine when GenAPI is used during the build to produce reference sources.
src/Microsoft.DotNet.GenAPI/build/Microsoft.DotNet.GenAPI.targets
Outdated
Show resolved
Hide resolved
src/Microsoft.DotNet.GenAPI/build/Microsoft.DotNet.GenAPI.targets
Outdated
Show resolved
Hide resolved
Left a few nits, but otherwise looks good. |
This will break both dotnet/wpf and dotnet/runtime which are consumer of this package and set the now removed |
I am not involved with WPF anymore, @dotnet/wpf-developers FYI. |
@joperezr thanks for the review. Would appreciate an approval so that I get this merged :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code changes LGTM. One last thing to consider is that I'm not sure if any other repos are using GenAPI for a different purpose today. I know we used it at some point in dotnet/iot and so of course this would break us as well. I don't think this should block your PR, but keep in mind that we may want to also provide an out-of-proc solution in case we get reports from people that used to depend on this package and can't/won't modify their ingestion to invoke it via a build task.
Here are the PRs changing GenAPI's usage:
Based on https://sourcegraph.com/search?q=context:global+Microsoft.DotNet.GenAPI&patternType=literal there are only few consumers of GenAPI which invoke it outside of msbuild, most prominently mono/mono and xamarin/xamarin-android. |
@ViktorHofer I'd like to keep an additional .exe build of GenAPI since it is much easier to quickly debug and play around with it rather than an msbuild task. |
@akoeplinger I saw your message but I don't yet have a good answer to it. I tried supporting both console and msbuild task frontends in the past with a shared backend but this proved more difficult and I couldn't get the logger working with cci. GenAPI would probably be a great dotnet tool as well so that could also be considered. |
Follow-up to PR dotnet#8507. Task parameters of type Enum cannot be passed in a project file. Change task parameter type to string for WriterType, SyntaxWriterType, and DocIdKinds. Do the necessary conversion inside the property getters/setters with private backing fields.
…9008) * Update GenAPI to make Enum task parameters usable in project files. Follow-up to PR #8507. Task parameters of type Enum cannot be passed in a project file. Change task parameter type to string for WriterType, SyntaxWriterType, and DocIdKinds. Do the necessary conversion inside the property getters/setters with private backing fields. * Add proper default handling for Enum string task parameters. * Fix OutputPath parameter handling when it is an existing directory.
Make GenAPI an msbuild task so that it can run as part of msbuild,
in-proc. Expose all current command line options as msbuild properties
and also apply some additional code clean-up (auto fixes by VS).
This improvements makes a dotnet/runtime build 50s faster on my machine
when GenAPI is used during the build to produce reference sources.
The GenAPI target continues to be invokable with the usual command.