[build] Remove Step_PrepareProps; fold values into eng/Versions.props#11613
Merged
Conversation
Continues the slow xaprepare removal (precedent: #11568, #11580, #11529). `Step_PrepareProps` generated `external/Java.Interop/Configuration.Override.props` inside the submodule by substituting two placeholders into `build-tools/scripts/Configuration.Java.Interop.Override.in.props`. The same properties are now supplied directly via `external/Java.Interop.override.props` (a checked-in static file at `external/` that Java.Interop's `Directory.Build.props` auto-imports via the parent-dir convention added in dotnet/java-interop#872). The shared properties (`MonoCecilVersion`, `AndroidPackVersion`, `MicrosoftAndroidSdkPackName`) move into `eng/Versions.props`, which is then imported from `Directory.Build.props`, `Configuration.props`, and the Java.Interop override. A `_XAVersionsPropsImported` sentinel guards each import to avoid an MSB4011 duplicate-import warning. Why not import dotnet/android's full `Directory.Build.props` from the Java.Interop override? Because that flips `DotNetTargetFrameworkVersion` from 10.0 to 11.0 inside Java.Interop, causing `dotnet restore` to fail with `NETSDK1045: The current .NET SDK does not support targeting .NET 11.0`. `eng/Versions.props` is collision-free with Java.Interop and safe to import. Also dropped: * `Configurables.Paths.InstallMSBuildDir` and its backing field (only consumer was `Step_PrepareProps`). * The dead `UtilityOutputFullPath` line in the old template -- Java.Interop's `TargetFrameworkDependentValues.props` unconditionally routes it to `$(UtilityOutputFullPathCoreApps)` anyway. Updated `build-tools/scripts/XAVersionInfo.targets` and `Documentation/guides/HowToBranch.md` to reflect that `AndroidPackVersion` now lives in `eng/Versions.props`. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Removes the xaprepare-driven Step_PrepareProps generation step by moving shared version properties into eng/Versions.props and wiring Java.Interop overrides to consume those values via a checked-in external/Java.Interop.override.props.
Changes:
- Introduced
eng/Versions.propsas the shared location forMonoCecilVersion,AndroidPackVersion, andMicrosoftAndroidSdkPackName, plus an_XAVersionsPropsImportedsentinel to avoid duplicate-import warnings. - Updated
Directory.Build.props,Configuration.props, andexternal/Java.Interop.override.propsto importeng/Versions.props(guarded by the sentinel). - Deleted the obsolete
Step_PreparePropsand its template input file, and updated supporting docs/targets to reference the new source ofAndroidPackVersion.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| external/Java.Interop.override.props | Imports eng/Versions.props and provides static Java.Interop override properties (incl. Cecil version + tools path). |
| eng/Versions.props | Adds sentinel + centralizes shared version properties for dotnet/android and Java.Interop. |
| Documentation/guides/HowToBranch.md | Updates branching guidance to point AndroidPackVersion edits to eng/Versions.props. |
| Directory.Build.props | Imports eng/Versions.props and removes local definitions now centralized there. |
| Configuration.props | Imports eng/Versions.props with sentinel guard; removes duplicated MicrosoftAndroidSdkPackName definitions. |
| build-tools/xaprepare/xaprepare/Steps/Step_PrepareProps.cs | Deletes the xaprepare step that generated Java.Interop override props. |
| build-tools/xaprepare/xaprepare/Scenarios/Scenario_Standard.cs | Removes the deleted step from the standard scenario. |
| build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.cs | Removes InstallMSBuildDir path that was only used by the deleted step. |
| build-tools/scripts/XAVersionInfo.targets | Updates GitBlame to track AndroidPackVersion in eng/Versions.props. |
| build-tools/scripts/Configuration.Java.Interop.Override.in.props | Deletes the unused template file previously consumed by Step_PrepareProps. |
Configuration.props no longer needs to import eng/Versions.props itself. In every MSBuild path that imports Configuration.props, Directory.Build.props has already been loaded (either by MSBuild auto-load, or by the explicit <Import Project="..\Directory.Build.props" /> in external/xamarin-android-tools.override.props). Since Directory.Build.props imports eng/Versions.props, the properties are always available. This means there is no duplicate-import scenario, so the _XAVersionsPropsImported sentinel can be removed too. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
It is OS-conditioned, not version-shaped, so it does not belong in eng/Versions.props. Mirror the same 3-line block inline in external/Java.Interop.override.props (as a private _MicrosoftAndroidSdkPackName so it cannot leak into the Java.Interop build) to keep Versions.props limited to pure version values. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sits next to AndroidPackVersion now, where it logically belongs. Updated Documentation/guides/HowToBranch.md to reflect the new location. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
…e-step-prepareprops # Conflicts: # Directory.Build.props
CodeBehindTests.PrepareProject copies the repo Directory.Build.props into a per-test temp root so the synthesized project under temp/CodeBehind/... sees our shared MSBuild props. After this PR, Directory.Build.props unconditionally imports eng/Versions.props, so the copy must include that file too -- otherwise MSB4019 fires on every CodeBehindTests build: Directory.Build.props(3,3): error MSB4019: The imported project ".../temp/CodeBehind/.../eng/Versions.props" was not found. CopyFile already creates intermediate directories, so a single extra line that places it under tempRoot/eng/Versions.props is sufficient. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Accidentally rolled back in d459a69 by `git add -A` while the submodule worktree still pointed at the pre-merge commit. The merge with main had correctly taken b881d21 from origin/main; this re-applies that pointer. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
simonrozsival
approved these changes
Jun 11, 2026
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.
Continues the slow
xaprepareremoval. Recent precedent: #11568 (CopyExtraResultFilesForCI → YAML), #11580 (configuration.mk removal), #11529 (android-platform-support consolidation, which also droppedStep_PrepareExternalGitDependencies).What
Step_PreparePropsgeneratedexternal/Java.Interop/Configuration.Override.props(inside the submodule) by substituting two placeholders intobuild-tools/scripts/Configuration.Java.Interop.Override.in.props. The substituted properties (_XamarinAndroidCecilVersion,UtilityOutputFullPathCoreApps,XamarinAndroidToolsDirectory) are now supplied directly via the checked-in static fileexternal/Java.Interop.override.props, which Java.Interop's ownDirectory.Build.propsalready auto-imports via the parent-dir convention added in dotnet/java-interop#872.The shared version values (
MonoCecilVersion,AndroidPackVersion,AndroidPackVersionSuffix) move intoeng/Versions.props.Directory.Build.propsandexternal/Java.Interop.override.propsboth<Import>it. No duplicate-import sentinel is needed because every code path that importsConfiguration.propshas already loadedDirectory.Build.props(either via MSBuild auto-load or via the explicit<Import>inexternal/xamarin-android-tools.override.props).MicrosoftAndroidSdkPackNamestays inConfiguration.props(it is OS-conditioned, not version-shaped, so it doesn't belong inVersions.props). The same 3-line OS-conditioned block is mirrored privately inexternal/Java.Interop.override.propsas_MicrosoftAndroidSdkPackName, used only to computeUtilityOutputFullPathCoreAppsfor the Java.Interop build.Also dropped:
Configurables.Paths.InstallMSBuildDirand its backing field — the only consumer wasStep_PrepareProps.UtilityOutputFullPathline in the old template — Java.Interop'sTargetFrameworkDependentValues.propsunconditionally routes it to$(UtilityOutputFullPathCoreApps)anyway, so it was a no-op.Updated
build-tools/scripts/XAVersionInfo.targets(theGitBlamefor<AndroidPackVersion>now points ateng/Versions.props) andDocumentation/guides/HowToBranch.mdto reflect the moves.Why not just
<Import>Directory.Build.propsfrom the Java.Interop override?That was the original idea. I prototyped it: importing dotnet/android's full props chain from
external/Java.Interop.override.propsflipsDotNetTargetFrameworkVersionfrom10.0to11.0inside Java.Interop, anddotnet restore Java.Interop.csprojthen fails with:xamarin-android-tools.override.propsgets away with the same trick only because its sole csproj setsAndroidToolsDisableMultiTargeting=true, which makes the TFM-clobber harmless. Java.Interop has no equivalent escape hatch.eng/Versions.propsis collision-free with Java.Interop (verified against the submodule sources — none of the existing entries collide), has no<Import>of its own, and is the safe minimal shared file.Verification
On Windows:
dotnet build build-tools/xaprepare/xaprepare/xaprepare.csproj— 0 warnings, 0 errors.src/Xamarin.Android.Build.Tasks/:dotnet msbuild --getProperty:MonoCecilVersion,AndroidPackVersion,AndroidPackVersionSuffix,MicrosoftAndroidSdkPackName,MicrosoftAndroidSdkOutDir— values unchanged from baseline.external/Java.Interop/src/Java.Interop/:dotnet msbuild --getProperty:DotNetTargetFramework,_XamarinAndroidCecilVersion,UtilityOutputFullPathCoreAppsreturnsnet10.0,0.11.5, the expected packs/tools path.dotnet restore Java.Interop.csprojsucceeds (noNETSDK1045).Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com