Setup PublicApi Roslyn analyzer for Xamarin.Android.Tools.AndroidSdk#294
Merged
jonathanpeppers merged 3 commits intomainfrom Mar 10, 2026
Merged
Conversation
Add Microsoft.CodeAnalysis.PublicApiAnalyzers 3.3.4 package reference. Create per-TFM PublicAPI directories with Shipped.txt (empty) and Unshipped.txt (all current public APIs) for both netstandard2.0 and net10.0 target frameworks. Add AdditionalFiles entries in the .csproj. Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Setup PublicApi Roslyn analyzer for AndroidSdk
Setup PublicApi Roslyn analyzer for Xamarin.Android.Tools.AndroidSdk
Mar 10, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds public API surface tracking to Xamarin.Android.Tools.AndroidSdk using Roslyn PublicApiAnalyzers, establishing per-target-framework PublicAPI baseline files to help prevent accidental public API changes across releases.
Changes:
- Add
Microsoft.CodeAnalysis.PublicApiAnalyzersto the AndroidSdk project. - Wire per-TFM
PublicAPI/{TFM}/PublicAPI.{Shipped,Unshipped}.txtfiles viaAdditionalFiles. - Introduce initial PublicAPI baseline files for
netstandard2.0andnet10.0.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Xamarin.Android.Tools.AndroidSdk/Xamarin.Android.Tools.AndroidSdk.csproj | Adds PublicApiAnalyzers and includes per-TFM PublicAPI tracking files as additional analyzer inputs. |
| src/Xamarin.Android.Tools.AndroidSdk/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt | Introduces the netstandard2.0 public API list (currently all under “Unshipped”). |
| src/Xamarin.Android.Tools.AndroidSdk/PublicAPI/netstandard2.0/PublicAPI.Shipped.txt | Adds the netstandard2.0 shipped baseline file (currently empty aside from #nullable enable). |
| src/Xamarin.Android.Tools.AndroidSdk/PublicAPI/net10.0/PublicAPI.Unshipped.txt | Introduces the net10.0 public API list (currently all under “Unshipped”). |
| src/Xamarin.Android.Tools.AndroidSdk/PublicAPI/net10.0/PublicAPI.Shipped.txt | Adds the net10.0 shipped baseline file (currently empty aside from #nullable enable). |
Member
|
@copilot can you move the "shipped" APIs for what shipped in .NET 10?
Then everything "unshipped" are API changes introduced in main after that point in time (.NET 11). |
Move APIs that were present at the .NET 10 release point (fb95edd) to PublicAPI.Shipped.txt. Only APIs introduced after that commit remain in PublicAPI.Unshipped.txt (.NET 11 changes). The old ProcessUtils.StartProcess signature (without environmentVariables parameter) is marked as *REMOVED* in Unshipped.txt since it was replaced with a new overload. Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Contributor
Author
Done in 86f8bba. Built the project at the .NET 10 release point (
|
jonathanpeppers
approved these changes
Mar 10, 2026
This was referenced Mar 11, 2026
jonathanpeppers
pushed a commit
that referenced
this pull request
Mar 11, 2026
Adds a convention: when adding or removing `public` API, update the `PublicAPI.Unshipped.txt` files for both `net10.0` and `netstandard2.0` TFMs, and verify zero `RS0016`/`RS0017` warnings. Motivated by @jonathanpeppers feedback on #282 — new `AvdManagerRunner` and `AvdInfo` types were missing from the unshipped files after #294 added the analyzer.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
Microsoft.CodeAnalysis.PublicApiAnalyzersto track public API surface changes, with APIs split between shipped (.NET 10) and unshipped (.NET 11).Microsoft.CodeAnalysis.PublicApiAnalyzers3.3.4,PrivateAssets=AllPublicAPI/{netstandard2.0,net10.0}/PublicAPI.{Shipped,Unshipped}.txt— both TFMs currently expose identical API surfacesfb95edd)*REMOVED*entry for the oldProcessUtils.StartProcessoverload which gained anenvironmentVariablesparameterFollows the per-TFM directory convention from dotnet/maui and the analyzer docs for multi-targeting projects.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.