-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Local and Copilot dev can generate public apis #30500
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
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.
Pull Request Overview
This PR enables automatic generation of public API files locally and via Copilot by integrating the updated Mono.ApiTools.MSBuildTasks package, adding conditional logic in the PublicAPI build targets, and recording new API changes.
- Remove hard-coded version for Mono.ApiTools.MSBuildTasks and centralize versioning
- Introduce
PublicApiTypeconditions and a_GeneratePublicApiFilestarget inPublicAPI.targets - Update
PublicAPI.Unshipped.txtacross TFMs for new API signatures and hide fields
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/SingleProject/Resizetizer/src/Resizetizer.csproj | Drop explicit Version="0.3.0" to use central version management |
| src/PublicAPI.targets | Add PublicApiType conditions, conditional analyzer/tasks package refs, and new generate target |
| src/Controls/src/Core/PublicAPI/*/PublicAPI.Unshipped.txt | Record hiding of Element.transientNamescope and updated FlexLayout.CrossPlatformMeasure |
| src/Controls/src/Core/Layout/FlexLayout.cs | Remove pragma warnings around the public CrossPlatformMeasure override |
| src/Controls/src/Core/Element/Element.cs | Remove pragma warnings around the public transientNamescope field |
| eng/Versions.props | Bump MonoApiToolsMSBuildTasksPackageVersion to 0.4.0 |
| eng/NuGetVersions.targets | Add Mono.ApiTools.MSBuildTasks central package reference |
Comments suppressed due to low confidence (4)
src/PublicAPI.targets:40
- Add automated tests (unit or integration) covering the new
_GeneratePublicApiFilestarget to verify that API files are generated correctly under theGeneratecondition.
<Target Name="_GeneratePublicApiFiles" AfterTargets="Build" Condition="'$(TargetFramework)' != '' and '$(PublicApiType)' == 'Generate'">
src/Controls/src/Core/Layout/FlexLayout.cs:467
- The RS0016 suppression pragmas around this public override were removed. This can lead to public API analyzer warnings. Reintroduce
#pragma warning disable RS0016before and#pragma warning restore RS0016after the method to limit the suppression scope.
new public Graphics.Size CrossPlatformMeasure(double widthConstraint, double heightConstraint)
src/Controls/src/Core/Element/Element.cs:507
- The pragma disable/restore for RS0016 was removed around this field, causing potential analyzer failures. Add back
#pragma warning disable RS0016above and#pragma warning restore RS0016below this declaration.
public INameScope transientNamescope;
src/SingleProject/Resizetizer/src/Resizetizer.csproj:36
- Removing the explicit version relies on central version management. Verify that
eng/Versions.propsdefines the correct version to avoid mismatched package versions in local vs CI builds.
<PackageReference Include="Mono.ApiTools.MSBuildTasks" PrivateAssets="all" />
|
/rebase |
229cf1a to
0d3fe1d
Compare
Currently, the only way is to use the IDE and the lightbulb - or manually. This is often not successful and AI still struggles as well. The new version of the Mono.ApiTools.MSBuildTasks package now has the ability to generate the files and they can be checked in during development to show the actual API changes. Local dev will start generating automatically. The rules would be if this is release of CI, then it is set to Validate only, and then only if it is debug AND not CI (ie: local) will it enable generation.
8655e7b to
d8140c9
Compare
|
/backport to net10.0 |
|
Started backporting to net10.0: https://github.com/dotnet/maui/actions/runs/16323633832 |
|
/backport to inflight/current |
This comment was marked as off-topic.
This comment was marked as off-topic.
|
Started backporting to inflight/current: https://github.com/dotnet/maui/actions/runs/16323643779 |
* Local and Copilot dev can generate public apis Currently, the only way is to use the IDE and the lightbulb - or manually. This is often not successful and AI still struggles as well. The new version of the Mono.ApiTools.MSBuildTasks package now has the ability to generate the files and they can be checked in during development to show the actual API changes. The rules would be if this is release of CI, then it is set to Validate only, and then only if it is debug AND not CI (ie: local) will it enable generation. # Conflicts: # src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt # src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt # src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt # src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt # src/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txt # src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt # src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt
* Local and Copilot dev can generate public apis Currently, the only way is to use the IDE and the lightbulb - or manually. This is often not successful and AI still struggles as well. The new version of the Mono.ApiTools.MSBuildTasks package now has the ability to generate the files and they can be checked in during development to show the actual API changes. The rules would be if this is release of CI, then it is set to Validate only, and then only if it is debug AND not CI (ie: local) will it enable generation. # Conflicts: # src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt # src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt # src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt # src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt # src/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txt # src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt # src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt
* Local and Copilot dev can generate public apis Currently, the only way is to use the IDE and the lightbulb - or manually. This is often not successful and AI still struggles as well. The new version of the Mono.ApiTools.MSBuildTasks package now has the ability to generate the files and they can be checked in during development to show the actual API changes. The rules would be if this is release of CI, then it is set to Validate only, and then only if it is debug AND not CI (ie: local) will it enable generation. # Conflicts: # src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt # src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt # src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt # src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt # src/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txt # src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt # src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt
* Local and Copilot dev can generate public apis (#30500) * Local and Copilot dev can generate public apis Currently, the only way is to use the IDE and the lightbulb - or manually. This is often not successful and AI still struggles as well. The new version of the Mono.ApiTools.MSBuildTasks package now has the ability to generate the files and they can be checked in during development to show the actual API changes. The rules would be if this is release of CI, then it is set to Validate only, and then only if it is debug AND not CI (ie: local) will it enable generation. # Conflicts: # src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt # src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt # src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt # src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt # src/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txt # src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt # src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt * regen
|
/backport to inflight/current |
|
Started backporting to inflight/current: https://github.com/dotnet/maui/actions/runs/16446585665 |
|
@mattleibow backporting to "inflight/current" failed, the patch most likely resulted in conflicts: $ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch
Applying: Local and Copilot dev can generate public apis
.git/rebase-apply/patch:183: trailing whitespace.
<Target Name="_GeneratePublicApiFiles"
warning: 1 line adds whitespace errors.
Using index info to reconstruct a base tree...
M eng/NuGetVersions.targets
M eng/Versions.props
M src/Controls/src/Core/Element/Element.cs
M src/Controls/src/Core/Layout/FlexLayout.cs
M src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt
M src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt
M src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt
M src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt
M src/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txt
M src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt
M src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt
M src/PublicAPI.targets
M src/SingleProject/Resizetizer/src/Resizetizer.csproj
Falling back to patching base and 3-way merge...
Auto-merging src/Controls/src/Core/Element/Element.cs
Auto-merging src/PublicAPI.targets
CONFLICT (content): Merge conflict in src/PublicAPI.targets
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 Local and Copilot dev can generate public apis
Error: The process '/usr/bin/git' failed with exit code 128Please backport manually! |
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Description of Change
Currently, the only way is to use the IDE and the lightbulb - or manually. This is often not successful and AI still struggles as well.
The new version of the Mono.ApiTools.MSBuildTasks package now has the ability to generate the files and they can be checked in during development to show the actual API changes.
The rules would be if this is release of CI, then it is set to Validate only, and then only if it is debug AND not CI (ie: local) will it enable generation.
Issues Fixed
The pain of trying to get IDEs to actually generate files in a multi-targeted world.