[build] Check in Mono.Android.Apis.projitems, remove generator#11608
Open
jonathanpeppers wants to merge 2 commits into
Open
[build] Check in Mono.Android.Apis.projitems, remove generator#11608jonathanpeppers wants to merge 2 commits into
jonathanpeppers wants to merge 2 commits into
Conversation
`Mono.Android.Apis.projitems` was previously generated at prepare time by
`GeneratedMonoAndroidProjitemsFile` (in xaprepare) from the
`BuildAndroidPlatforms.AllPlatforms` list. Both had exactly one consumer
(each other), so check in the projitems as a source file and drop the
generator plumbing.
Changes:
* Add `src/Mono.Android/Mono.Android.Apis.projitems` — content matches
the generator's output byte-for-byte; only the header comment now
points at `Documentation/workflow/HowToAddNewApiLevel.md` instead of
declaring "GENERATED FILE".
* Repoint the 4 importers (`Mono.Android.targets` x2,
`create-installers.targets`, `create-android-api.csproj`,
`Xamarin.Android.Build.Tasks.targets`) at the new path and drop the
`Condition="Exists(...)"` guards — the file is always present now.
* Delete `GeneratedMonoAndroidProjitemsFile.cs` and `AndroidPlatform.cs`
(whole files — `AndroidPlatform` class and `AndroidPlatformExtensions`
both become unused).
* Drop the `new GeneratedMonoAndroidProjitemsFile()` registration in
`Step_GenerateFiles.cs`.
* Remove `BuildAndroidPlatforms.AllPlatforms` and the now-unused
`using System.Collections.Generic;`. Keep the NDK constants
(`AndroidNdkVersion`, `AndroidNdkPkgRevision`, `NdkMinimumAPI`,
`NdkMinimumAPILegacy32`) — they still have consumers.
* Update `Documentation/workflow/HowToAddNewApiLevel.md` with the
XML-based instructions for adding a new API level.
* Narrow the `build-tools/xaprepare/README.md` blurb for
`BuildAndroidPlatforms.cs` to NDK metadata.
* Fix stale doc comment in `GenerateSupportedPlatforms.cs` pointing
at the old generated path.
Continues the xaprepare cleanup started in PRs #11568 and #11580.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR continues the xaprepare cleanup by eliminating the prepare-time generator for Mono.Android.Apis.projitems, checking the file into source control instead, and updating all build/import points to reference the new location.
Changes:
- Check in
src/Mono.Android/Mono.Android.Apis.projitemsand update build/importers to use it directly (removingExists(...)guards). - Remove the generator plumbing and its now-unused data types from
xaprepare. - Update workflow documentation to describe the XML-based process for adding API levels.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.targets | Updates incremental Inputs to point at checked-in Mono.Android.Apis.projitems. |
| src/Mono.Android/Mono.Android.targets | Imports checked-in projitems and updates _GenerateAndroidApiInfo inputs accordingly. |
| src/Mono.Android/Mono.Android.Apis.projitems | New checked-in source of truth for @(AndroidApiInfo) items. |
| Documentation/workflow/HowToAddNewApiLevel.md | Switches “add API level” instructions to editing the projitems XML directly. |
| build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs | Removes registration of the projitems generator step. |
| build-tools/xaprepare/xaprepare/ConfigAndData/BuildAndroidPlatforms.cs | Removes the API-level list, leaving NDK metadata. |
| build-tools/xaprepare/xaprepare/Application/GeneratedMonoAndroidProjitemsFile.cs | Deleted (generator no longer needed). |
| build-tools/xaprepare/xaprepare/Application/AndroidPlatform.cs | Deleted (type became unused after generator removal). |
| build-tools/xaprepare/README.md | Updates docs to reflect that API-level list moved to src/Mono.Android. |
| build-tools/Xamarin.Android.Tools.BootstrapTasks/.../GenerateSupportedPlatforms.cs | Updates doc comment to reference new projitems location. |
| build-tools/installers/create-installers.targets | Imports checked-in projitems file directly. |
| build-tools/create-android-api/create-android-api.csproj | Imports checked-in projitems file directly. |
The added prose said Stable should be False for preview API levels, but the example (CANARY) sets <Stable>True</Stable>, and every entry in Mono.Android.Apis.projitems is True. Rewrite the prose to match the data and briefly explain what setting Stable=False would actually do (excludes entry from default stable framework selection). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
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.
Description
Mono.Android.Apis.projitemswas previously generated at prepare time byGeneratedMonoAndroidProjitemsFile(in
xaprepare) from theBuildAndroidPlatforms.AllPlatformslist. Both had exactly one consumer — each other — so check in the projitems
as a source file and drop the generator plumbing.
Continues the
xapreparecleanup started in #11568 and #11580.Changes
src/Mono.Android/Mono.Android.Apis.projitems— content matches thegenerator's output byte-for-byte (validated by re-running the generator's
exact algorithm and diffing); only the header comment now points at
Documentation/workflow/HowToAddNewApiLevel.mdinstead of declaring it a"GENERATED FILE".
Mono.Android.targets<Import>+Inputs=,create-installers.targets,create-android-api.csproj,Xamarin.Android.Build.Tasks.targetsInputs=) at the new path and drop theCondition="Exists(...)"guards — the file is always present now.GeneratedMonoAndroidProjitemsFile.csandAndroidPlatform.cs(whole files —
AndroidPlatformclass andAndroidPlatformExtensionsbothbecome unused).
new GeneratedMonoAndroidProjitemsFile()registration inStep_GenerateFiles.cs.BuildAndroidPlatforms.AllPlatformsand the now-unusedusing System.Collections.Generic;. Kept the NDK constants(
AndroidNdkVersion,AndroidNdkPkgRevision,NdkMinimumAPI,NdkMinimumAPILegacy32) — they still have consumers.Documentation/workflow/HowToAddNewApiLevel.mdwith the XML-basedinstructions for adding a new API level (replaces the old C#
AndroidPlatformsnippet).
build-tools/xaprepare/README.mdblurb forBuildAndroidPlatforms.csto NDK metadata.GenerateSupportedPlatforms.cspointing at the oldgenerated path.
Verification
dotnet build build-tools/xaprepare/xaprepare/xaprepare.csproj— 0 warnings,0 errors after deletions.
dotnet msbuild src/Mono.Android/Mono.Android.csproj -preprocess:pp.xml—preprocessed XML shows all 34
<AndroidApiInfo>items resolving from the newpath. Same for
build-tools/create-android-api/create-android-api.csproj.against the checked-in file: only the 2-line header comment block differs;
body identical.