Skip to content

[build] Move Android tools projects into src and tests#12215

Open
jonathanpeppers wants to merge 9 commits into
dotnet:mainfrom
jonathanpeppers:jonathanpeppers-move-android-tools-projects
Open

[build] Move Android tools projects into src and tests#12215
jonathanpeppers wants to merge 9 commits into
dotnet:mainfrom
jonathanpeppers:jonathanpeppers-move-android-tools-projects

Conversation

@jonathanpeppers

@jonathanpeppers jonathanpeppers commented Jul 23, 2026

Copy link
Copy Markdown
Member

Pull Request
title and
description
should follow the
commit-messages.md workflow documentation, and in particular should include:

  • Useful description of why the change is necessary.
  • Links to issues fixed (N/A)
  • Unit tests

The Android tools projects now live directly in dotnet/android, so retaining a separate external/xamarin-android-tools hierarchy adds path indirection and standalone build infrastructure that no longer represents repository ownership.

Move the shipped libraries into src, their tests and benchmarks into tests, and ls-jdks into tools. The relevant projects retain their signing, packaging, analyzer, and GitInfo versioning behavior, including project-local GitInfo.txt fallback versions. Their common packaging/versioning logic is consolidated in a shared target, while SourceLink and NUnit use the repository-wide versions. A .NET 11 PublicAPI baseline keeps API compatibility checks aligned with each target framework.

All project references, solutions, localization metadata, CI YAML, documentation, and repository guidance use the new paths. The dedicated Android tools solution is removed. CI builds the AndroidSdk library, benchmarks, and ls-jdks explicitly; BaseTasks builds transitively, and each test project builds with its test invocation.

Validation includes Debug and Release builds, both standalone test suites, package creation through the CI versioning path, the .NET 11 multi-target build, and the Java.Interop bootstrap project reference.

Move the shared Android tooling libraries into src, their tests and benchmarks into tests, and ls-jdks into tools. Inline the shipped assembly versioning, signing, packaging, and dependency settings that were previously inherited from the external directory, and update all consumers, CI, localization, and documentation paths.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 9590cf75-594f-4834-9762-189eaf472675
Copilot AI review requested due to automatic review settings July 23, 2026 16:56
Let each test invocation build its own project and dependencies instead of duplicating the test projects in the preceding build step.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 9590cf75-594f-4834-9762-189eaf472675
Build Microsoft.Android.Build.BaseTasks through its existing project references instead of listing it separately in the Android tools CI build step.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 9590cf75-594f-4834-9762-189eaf472675

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 restructures the in-tree “Android tools” code by eliminating the standalone external/xamarin-android-tools/ hierarchy and relocating the shipped libraries into src/, their tests/benchmarks into tests/, and ls-jdks into tools/, while updating all repository references (solutions, project refs, CI, localization).

Changes:

  • Moved Microsoft.Android.Build.BaseTasks and Xamarin.Android.Tools.AndroidSdk into src/, with corresponding tests/benchmarks into tests/ and ls-jdks into tools/.
  • Updated solution files, project references, Java.Interop bootstrap references, pack/build scripts, and CI YAML to use the new paths.
  • Added/updated tooling code (e.g., SdkManager, ADB tracker/client tests, benchmark harness) and localization wiring for the moved projects.

Reviewed changes

Copilot reviewed 57 out of 233 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Xamarin.Android.sln Update project paths for moved Android tools projects.
Xamarin.Android.Build.Tasks.sln Remove external solution folder and update project paths.
tools/ls-jdks/ls-jdks.csproj Use shared build output directory for tool output.
tools/ls-jdks/App.cs New ls-jdks entrypoint under tools/.
tests/Xamarin.Android.Tools.Benchmarks/Xamarin.Android.Tools.Benchmarks.csproj Move benchmarks under tests/, pin BenchmarkDotNet version, update output path.
tests/Xamarin.Android.Tools.Benchmarks/run-benchmarks.ps1 Adjust script paths to new benchmarks location.
tests/Xamarin.Android.Tools.Benchmarks/README.md Checked-in benchmark output under new location.
tests/Xamarin.Android.Tools.Benchmarks/Program.cs New top-level benchmark program entrypoint.
tests/Xamarin.Android.Tools.Benchmarks/FilesHashBenchmarks.cs New benchmark suite for Files hashing helpers.
tests/Xamarin.Android.Tools.AndroidSdk-Tests/Xamarin.Android.Tools.AndroidSdk-Tests.csproj Move tests into tests/, pin test package versions, update output path.
tests/Xamarin.Android.Tools.AndroidSdk-Tests/Resources/manifest-simplewidget.xml Move embedded test resource.
tests/Xamarin.Android.Tools.AndroidSdk-Tests/ProcessUtilsTests.cs Add unit tests for ProcessUtils.
tests/Xamarin.Android.Tools.AndroidSdk-Tests/JdkVersionInfoTests.cs Add unit tests for JdkVersionInfo.
tests/Xamarin.Android.Tools.AndroidSdk-Tests/AndroidSdkWindowsTests.cs New (currently empty) Windows test fixture placeholder.
tests/Xamarin.Android.Tools.AndroidSdk-Tests/AdbDeviceTrackerTests.cs Add unit tests for AdbDeviceTracker.
tests/Xamarin.Android.Tools.AndroidSdk-Tests/AdbClientTests.cs Add unit tests for AdbClient stream parsing.
tests/MSBuildDeviceIntegration/MSBuildDeviceIntegration.csproj Update import path for moved MSBuildReferences.projitems.
tests/Microsoft.Android.Build.BaseTasks-Tests/Utilites/MockBuildEngine.cs Add mock MSBuild engine for BaseTasks tests.
tests/Microsoft.Android.Build.BaseTasks-Tests/Microsoft.Android.Build.BaseTasks-Tests.csproj Move tests into tests/, pin test package versions, update output path.
tests/Microsoft.Android.Build.BaseTasks-Tests/MemoryStreamPoolTests.cs Add/relocate MemoryStreamPool unit tests.
tests/Microsoft.Android.Build.BaseTasks-Tests/LockCheckTests.cs Add/relocate LockCheck tests for Windows behavior.
tests/Microsoft.Android.Build.BaseTasks-Tests/AsyncTaskTests.cs Add/relocate AsyncTask tests.
tests/Microsoft.Android.Build.BaseTasks-Tests/AsyncTaskExtensionsTests.cs Add/relocate AsyncTask extension tests.
src/Xamarin.Installer.Build.Tasks/Xamarin.Installer.Build.Tasks.csproj Update refs/imports for moved BaseTasks.
src/Xamarin.AndroidTools/Xamarin.AndroidTools.csproj Update project reference to moved AndroidSdk project.
src/Xamarin.Android.Tools.AndroidSdk/Xamarin.Android.Tools.AndroidSdk.userprefs New IDE state file (should not be committed).
src/Xamarin.Android.Tools.AndroidSdk/SourceProperties.cs New helper for parsing source.properties.
src/Xamarin.Android.Tools.AndroidSdk/Sdks/AndroidSdkBase.cs Add JDK environment override support via JI_JAVA_HOME.
src/Xamarin.Android.Tools.AndroidSdk/SdkManager.Process.cs Add process execution helpers for sdkmanager operations.
src/Xamarin.Android.Tools.AndroidSdk/SdkManager.cs Add SdkManager core API surface and disposal semantics.
src/Xamarin.Android.Tools.AndroidSdk/SdkManager.Bootstrap.cs Add bootstrap flow for cmdline-tools via manifest feed.
src/Xamarin.Android.Tools.AndroidSdk/Runners/RunnerDefaults.cs Add shared runner defaults (null logger).
src/Xamarin.Android.Tools.AndroidSdk/Runners/AndroidEnvironmentHelper.cs Add environment-variable construction helper for tool runners.
src/Xamarin.Android.Tools.AndroidSdk/Runners/AdbResponseStatus.cs Add ADB status enum.
src/Xamarin.Android.Tools.AndroidSdk/Runners/AdbProtocol.cs Add ADB protocol enum.
src/Xamarin.Android.Tools.AndroidSdk/Runners/AdbPortSpec.cs Add parsing/formatting for ADB socket specs.
src/Xamarin.Android.Tools.AndroidSdk/Runners/AdbPortRule.cs Add record representing ADB port forwarding rules.
src/Xamarin.Android.Tools.AndroidSdk/README.md New README reflecting new in-tree locations and commands.
src/Xamarin.Android.Tools.AndroidSdk/Properties/Resources.Designer.cs Add generated resource designer for AndroidSdk project.
src/Xamarin.Android.Tools.AndroidSdk/Properties/AssemblyInfo.cs Add InternalsVisibleTo for tests (strong-named).
src/Xamarin.Android.Tools.AndroidSdk/Models/Sdk/SdkPackage.cs Add SDK package model type.
src/Xamarin.Android.Tools.AndroidSdk/Models/Sdk/SdkManifestComponent.cs Add manifest component model.
src/Xamarin.Android.Tools.AndroidSdk/Models/Sdk/SdkLicense.cs Add SDK license model.
src/Xamarin.Android.Tools.AndroidSdk/Models/Sdk/SdkBootstrapProgress.cs Add bootstrap progress model.
src/Xamarin.Android.Tools.AndroidSdk/Models/Sdk/SdkBootstrapPhase.cs Add bootstrap phase enum.
src/Xamarin.Android.Tools.AndroidSdk/Models/Sdk/CommandLineTool.cs Add command-line tool model.
src/Xamarin.Android.Tools.AndroidSdk/Models/Sdk/ChecksumType.cs Add checksum type enum.
src/Xamarin.Android.Tools.AndroidSdk/Models/Jdk/JdkVersionInfo.cs Add JDK version info model.
src/Xamarin.Android.Tools.AndroidSdk/Models/Jdk/JdkInstallProgress.cs Add JDK install progress model.
src/Xamarin.Android.Tools.AndroidSdk/Models/Jdk/JdkInstallPhase.cs Add JDK install phases enum.
src/Xamarin.Android.Tools.AndroidSdk/Models/EmulatorBootResult.cs Add structured emulator boot result and error kind.
src/Xamarin.Android.Tools.AndroidSdk/Models/EmulatorBootOptions.cs Add emulator boot options.
src/Xamarin.Android.Tools.AndroidSdk/Models/AvdInfo.cs Add AVD info record.
src/Xamarin.Android.Tools.AndroidSdk/Models/AvdDeviceProfile.cs Add AVD device profile record.
src/Xamarin.Android.Tools.AndroidSdk/Models/AdbDeviceType.cs Add device type enum.
src/Xamarin.Android.Tools.AndroidSdk/Models/AdbDeviceStatus.cs Add device status enum.
src/Xamarin.Android.Tools.AndroidSdk/Models/AdbDeviceInfo.cs Add device metadata model.
src/Xamarin.Android.Tools.AndroidSdk/Jdks/XAPrepareJdkLocations.cs Move/add XA prepare JDK discovery.
src/Xamarin.Android.Tools.AndroidSdk/Jdks/VSAndroidJdkLocations.cs Move/add VS Android JDK discovery.
src/Xamarin.Android.Tools.AndroidSdk/Jdks/OracleJdkLocations.cs Move/add Oracle JDK discovery.
src/Xamarin.Android.Tools.AndroidSdk/Jdks/MicrosoftOpenJdkLocations.cs Move/add Microsoft OpenJDK discovery.
src/Xamarin.Android.Tools.AndroidSdk/Jdks/MicrosoftDistJdkLocations.cs Move/add legacy Microsoft dist JDK discovery.
src/Xamarin.Android.Tools.AndroidSdk/Jdks/JdkLocations.MacOS.cs Move/add macOS JDK discovery helpers.
src/Xamarin.Android.Tools.AndroidSdk/Jdks/JdkLocations.cs Move/add shared JDK location helpers.
src/Xamarin.Android.Tools.AndroidSdk/Jdks/EclipseAdoptiumJdkLocations.cs Move/add Adoptium JDK discovery.
src/Xamarin.Android.Tools.AndroidSdk/Jdks/AzulJdkLocations.cs Move/add Azul JDK discovery.
src/Xamarin.Android.Tools.AndroidSdk/IsExternalInit.cs Add IsExternalInit polyfill for netstandard2.0 records/init.
src/Xamarin.Android.Tools.AndroidSdk/GitInfo.txt Preserve GitInfo fallback version for AndroidSdk project.
src/Xamarin.Android.Tools.AndroidSdk/EnvironmentVariableNames.cs Add constants for Android/JDK env var names and guidance.
src/Xamarin.Android.Tools.AndroidSdk/AndroidTargetArch.cs Move/add target arch enum.
src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.csproj Update imports/references to moved BaseTasks/AndroidSdk projects.
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Xamarin.ProjectTools.csproj Update imports/references to moved tool projects.
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Xamarin.Android.Build.Tests.csproj Update imports/references to moved AndroidSdk project.
src/Xamarin.Android.Build.Debugging.Tasks/Xamarin.Android.Build.Debugging.Tasks.csproj Update imports/references to moved tool projects.
src/Microsoft.Android.Run/Microsoft.Android.Run.csproj Update reference to moved AndroidSdk project.
src/Microsoft.Android.Build.Tasks/Microsoft.Android.Build.Tasks.csproj Update reference to moved BaseTasks project.
src/Microsoft.Android.Build.BaseTasks/XDocumentExtensions.cs Add/relocate MSBuild XML helper extension(s).
src/Microsoft.Android.Build.BaseTasks/Properties/Resources.Designer.cs Add generated resource designer for BaseTasks project.
src/Microsoft.Android.Build.BaseTasks/ObjectPool.cs Add/relocate object pool utility.
src/Microsoft.Android.Build.BaseTasks/MSBuildReferences.projitems New shared MSBuild package reference set.
src/Microsoft.Android.Build.BaseTasks/Microsoft.Android.Build.BaseTasks.csproj New in-tree BaseTasks project definition with versioning/pack setup.
src/Microsoft.Android.Build.BaseTasks/MemoryStreamPool.cs Add/relocate pooled MemoryStream utilities.
src/Microsoft.Android.Build.BaseTasks/GitInfo.txt Preserve GitInfo fallback version for BaseTasks project.
src/Microsoft.Android.Build.BaseTasks/Crc64Helper.cs Add/relocate CRC64 helper implementation.
src/Microsoft.Android.Build.BaseTasks/Crc64.cs Add/relocate CRC64 HashAlgorithm implementation.
src/Microsoft.Android.Build.BaseTasks/AndroidToolTask.cs Add/relocate ToolTask base.
src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs Add/relocate Task base with exception handling.
src/Microsoft.Android.Build.BaseTasks/AndroidRunToolTask.cs Add/relocate tool runner base for stderr parsing.
src/AndroidBuildConfig/AndroidBuildConfig.csproj Update reference to moved AndroidSdk project.
Localize/LocProject.json Add localization entries for moved BaseTasks/AndroidSdk resources.
Localize/loc/zh-Hant/Xamarin.Android.Tools.AndroidSdk/Properties/Resources.resx.lcl Add localization file under new path.
Localize/loc/zh-Hant/Microsoft.Android.Build.BaseTasks/Properties/Resources.resx.lcl Add localization file under new path.
Localize/loc/zh-Hans/Xamarin.Android.Tools.AndroidSdk/Properties/Resources.resx.lcl Add localization file under new path.
Localize/loc/zh-Hans/Microsoft.Android.Build.BaseTasks/Properties/Resources.resx.lcl Add localization file under new path.
Localize/loc/tr/Xamarin.Android.Tools.AndroidSdk/Properties/Resources.resx.lcl Add localization file under new path.
Localize/loc/tr/Microsoft.Android.Build.BaseTasks/Properties/Resources.resx.lcl Add localization file under new path.
Localize/loc/ru/Xamarin.Android.Tools.AndroidSdk/Properties/Resources.resx.lcl Add localization file under new path.
Localize/loc/ru/Microsoft.Android.Build.BaseTasks/Properties/Resources.resx.lcl Add localization file under new path.
Localize/loc/pt-BR/Xamarin.Android.Tools.AndroidSdk/Properties/Resources.resx.lcl Add localization file under new path.
Localize/loc/pt-BR/Microsoft.Android.Build.BaseTasks/Properties/Resources.resx.lcl Add localization file under new path.
Localize/loc/pl/Xamarin.Android.Tools.AndroidSdk/Properties/Resources.resx.lcl Add localization file under new path.
Localize/loc/pl/Microsoft.Android.Build.BaseTasks/Properties/Resources.resx.lcl Add localization file under new path.
Localize/loc/ko/Xamarin.Android.Tools.AndroidSdk/Properties/Resources.resx.lcl Add localization file under new path.
Localize/loc/ko/Microsoft.Android.Build.BaseTasks/Properties/Resources.resx.lcl Add localization file under new path.
Localize/loc/ja/Xamarin.Android.Tools.AndroidSdk/Properties/Resources.resx.lcl Add localization file under new path.
Localize/loc/ja/Microsoft.Android.Build.BaseTasks/Properties/Resources.resx.lcl Add localization file under new path.
Localize/loc/it/Xamarin.Android.Tools.AndroidSdk/Properties/Resources.resx.lcl Add localization file under new path.
Localize/loc/it/Microsoft.Android.Build.BaseTasks/Properties/Resources.resx.lcl Add localization file under new path.
Localize/loc/fr/Xamarin.Android.Tools.AndroidSdk/Properties/Resources.resx.lcl Add localization file under new path.
Localize/loc/fr/Microsoft.Android.Build.BaseTasks/Properties/Resources.resx.lcl Add localization file under new path.
Localize/loc/es/Xamarin.Android.Tools.AndroidSdk/Properties/Resources.resx.lcl Add localization file under new path.
Localize/loc/es/Microsoft.Android.Build.BaseTasks/Properties/Resources.resx.lcl Add localization file under new path.
Localize/loc/de/Xamarin.Android.Tools.AndroidSdk/Properties/Resources.resx.lcl Add localization file under new path.
Localize/loc/de/Microsoft.Android.Build.BaseTasks/Properties/Resources.resx.lcl Add localization file under new path.
Localize/loc/cs/Xamarin.Android.Tools.AndroidSdk/Properties/Resources.resx.lcl Add localization file under new path.
Localize/loc/cs/Microsoft.Android.Build.BaseTasks/Properties/Resources.resx.lcl Add localization file under new path.
external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/Microsoft.Android.Build.BaseTasks.csproj Remove old external project definition (moved).
external/xamarin-android-tools/README.md Remove old external hierarchy README (replaced by new in-tree docs).
external/xamarin-android-tools/nuget.version Remove obsolete external version file.
external/xamarin-android-tools/NuGet.config Remove external-only NuGet config.
external/xamarin-android-tools/Makefile Remove external-only make-based build wrapper.
external/xamarin-android-tools/Localize/LocProject.json Remove external localization project config (moved to root).
external/xamarin-android-tools/LICENSE Remove redundant external license file.
external/xamarin-android-tools/global.json Remove external-only SDK pin config.
external/xamarin-android-tools/GitInfo.txt Remove external GitInfo fallback (moved into projects).
external/xamarin-android-tools/Directory.Build.targets Remove external-only build targets.
external/xamarin-android-tools/Directory.Build.props Remove external-only build props (outputs/paths).
external/xamarin-android-tools/build-tools/scripts/msbuild.mk Remove external-only build helper.
external/xamarin-android-tools/.gitignore Remove external-only ignore list.
external/xamarin-android-tools/.gitattributes Remove external-only attributes.
external/Java.Interop/tools/generator/generator.slnf Update project path to moved AndroidSdk project.
external/Java.Interop/Java.Interop.sln Update project path to moved AndroidSdk project.
external/Java.Interop/build-tools/Java.Interop.BootstrapTasks/Java.Interop.BootstrapTasks.sln Update project path to moved AndroidSdk project.
external/Java.Interop.override.props Update XamarinAndroidToolsDirectory to repo root (no external tools folder).
Directory.Build.targets Parameterize SourceLink package version and refine nullable-attributes injection condition.
build-tools/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks.csproj Update import/reference paths for moved BaseTasks.
build-tools/xa-prep-tasks/xa-prep-tasks.csproj Update import/reference paths for moved BaseTasks.
build-tools/scripts/XAVersionInfo.targets Update comment to reflect in-tree layout.
build-tools/create-packs/Directory.Build.targets Update pack step path for moved AndroidSdk project.
build-tools/automation/yaml-templates/stage-xamarin-android-tools-tests.yaml Update CI stage to build/test explicit moved projects instead of removed solution.
.gitignore Ignore BenchmarkDotNet.Artifacts/ at repo root.
.github/skills/tests/references/test-catalog.md Update test-catalog paths/commands for moved tools tests.
.github/skills/read-assembly-store/src/AssemblyStore/AssemblyStore.csproj Update reference to moved AndroidSdk project.
.github/skills/android-reviewer/SKILL.md Update documentation paths referencing moved tooling.
.github/skills/android-reviewer/references/testing-rules.md Update guidance paths for tools tests.
.github/skills/android-reviewer/references/repo-conventions.md Update conventions text to reference new tooling locations.
.github/skills/android-reviewer/references/csharp-rules.md Update guidance for oldest TFM compilation to new locations.
.github/copilot-instructions.md Update repo architecture and commands to reflect moved tooling projects.

@jonathanpeppers

Copy link
Copy Markdown
Member Author

/review

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Android PR Reviewer completed successfully!

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Review: Move Android tools projects into src and tests

Verdict: ⚠️ Needs Changes (minor) — clean, well-scoped relocation. No bugs or functional regressions found. CI is still ⏳ pending, so this isn't mergeable until it goes green.

What I verified

  • No dangling references to the old paths. git grep for external/xamarin-android-tools across .props/.targets/.csproj/.sln/.slnf/.yaml/.projitems/scripts at HEAD returns nothing. All ProjectReference paths (including .github/skills/read-assembly-store/.../AssemblyStore.csproj) were updated. ✅
  • Shipped project settings preserved. Both new src/ projects keep signing (product.snk), VendorPrefix/Suffix assembly names, GitInfo + SetVersion/GitThisAssembly=false versioning, GitInfo.txt fallbacks, packaging output path, and analyzers. ✅
  • Nullable-attributes wiring is correct. Xamarin.Android.Tools.AndroidSdk ships its own NullableAttributes.cs/IsExternalInit.cs and sets UseProjectNullableAttributes=true, so Directory.Build.targets correctly skips adding the Java.Interop copy (avoiding duplicate-type conflicts). Microsoft.Android.Build.BaseTasks has no local copy and relies on the shared one — also correct. ✅
  • System.IO.Hashing/SourceLink versions resolve to defined properties ($(SystemIOHashingPackageVersion) = 10.0.10; SourceLinkGitHubPackageVersion overridden to 10.0.300). No central-package-management conflict (repo has no Directory.Packages.props). ✅
  • CI stage rewrite builds the individual projects and runs the two test projects via command: testBaseTasks builds transitively through its test project. ✅

Inline comments (both non-blocking 💡)

  1. Xamarin.Android.Tools.AndroidSdk.csproj — PublicAPI baseline path hardcoded to net10.0 instead of $(TargetFramework); works today but is coupled to the CI SDK version pin.
  2. AndroidSdk-Tests.csproj — NUnit hardcoded to 3.13.2 while the repo defines $(NUnitVersion) = 3.13.3.

Note

  • CI status is currently pending — do not merge until the dotnet-android pipeline and the tools-tests stage are green, since the relocation changes how these projects are built.

Nice cleanup overall — removing the standalone solution/build infra and folding these into src/tests/tools is a clear simplification.

Generated by Android PR Reviewer for #12215 · 209.3 AIC · ⌖ 13.5 AIC · ⊞ 6.8K
Comment /review to run again

Comment thread src/Xamarin.Android.Tools.AndroidSdk/Xamarin.Android.Tools.AndroidSdk.csproj Outdated
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 9590cf75-594f-4834-9762-189eaf472675
@jonathanpeppers

Copy link
Copy Markdown
Member Author

/review

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Android PR Reviewer completed successfully!

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Review Summary — Needs minor clarification

This PR moves the in-tree external/xamarin-android-tools hierarchy into src/, tests/, and tools/, removing the standalone build/solution infrastructure and wiring the moved projects into the main build, CI YAML, localization metadata, and docs. The overwhelming majority of the 235 changed files are pure renames with no content changes, and the packaging/signing/versioning/analyzer setup is faithfully reconstructed in the new .csproj files.

Findings (2 inline, both non-blocking):

  • ⚠️ MSBuild targets — Both shipped projects override SourceLinkGitHubPackageVersion to 10.0.300 while the new repo-wide default is 8.0.0; worth confirming/documenting why they differ, given the System.IO.Hashing conflict the default guards against.
  • 💡 Code organization — The SetVersion/_GetXAVersionInfo packing targets are duplicated verbatim across the two shipped .csproj files; consider consolidating into shared .targets.

Verified as correct:

  • The behavioral change in AndroidSdkBase.Initialize (new JI_JAVA_HOME override for JavaSdkPath) is covered by AndroidSdkInfoTests.JdkDirectory_JavaHome.
  • Test projects correctly switch to $(NUnitVersion) for NUnit (matching repo convention) and $(TestOutputDirectory)/$(BuildOutputDirectory); the hardcoded NUnit3TestAdapter/Microsoft.NET.Test.Sdk/BenchmarkDotNet versions are acceptable since no central definition exists for them.
  • Directory.Build.targets UseProjectNullableAttributes gate correctly lets Xamarin.Android.Tools.AndroidSdk supply its own NullableAttributes.
  • LocProject.json and moved .lcl files line up with the new source paths.

CI: No status checks have reported yet (state: pending); mergeable_state is blocked. Re-verify CI is green before merge — I could not confirm a passing build.

Nice, clean mechanical move overall. 👍

Generated by Android PR Reviewer for #12215 · 162 AIC · ⌖ 13.4 AIC · ⊞ 6.8K
Comment /review to run again

Comment thread src/Xamarin.Android.Tools.AndroidSdk/Xamarin.Android.Tools.AndroidSdk.csproj Outdated
Comment thread src/Microsoft.Android.Build.BaseTasks/Microsoft.Android.Build.BaseTasks.csproj Outdated
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 9590cf75-594f-4834-9762-189eaf472675
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 9590cf75-594f-4834-9762-189eaf472675
@jonathanpeppers

Copy link
Copy Markdown
Member Author

/review

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Android PR Reviewer completed successfully!

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Code Review — ✅ LGTM (with minor suggestions)

Thorough mechanical move of the Android tools projects from external/xamarin-android-tools/ into src, tests, and tools, with consolidated versioning plumbing. I reviewed the substantive build changes (rename-only files were spot-checked, not line-reviewed).

Verified ✅

  • Path updates are complete and consistent — all ProjectReference/Import/solution/.slnf entries (Xamarin.Android.Build.Tasks.sln, Xamarin.Android.sln, Java.Interop solutions, xa-prep-tasks, BootstrapTasks, AndroidBuildConfig, AssemblyStore, Microsoft.Android.Build.Tasks) now point at the new src\... locations. The removed external solution folder nodes were cleaned up.
  • Shared versioning targetbuild-tools/scripts/Xamarin.Android.Tools.Versioning.targets is imported by both Microsoft.Android.Build.BaseTasks and Xamarin.Android.Tools.AndroidSdk. All properties it consumes (_AndroidPackBranch, PackVersionCommitCount, XAVersionBranch, XamarinAndroidSourcePath) resolve via the XAVersionInfo.targets / Configuration.props imports that precede it. _GetXAVersionInfo is correctly gated on IsPacking=true.
  • SourceLink refactor is behavior-preserving for the root (8.0.0 was already the hardcoded value); removing the per-project Microsoft.SourceLink.GitHub reference in BaseTasks.csproj is correct since it now flows from the root Directory.Build.targets.
  • Loc metadataLocProject.json entries added at the root with LclFile paths matching the renamed Localize/loc/** files.
  • CI YAML — the stage-xamarin-android-tools-tests build/test steps were repointed to the new project paths; the test step rebuilds the test projects (and BaseTasks transitively), which is fine.

Suggestions (non-blocking)

  • 💡 NoWarn;CA1305 in BaseTasks.csproj — prefer fixing the underlying String.Format call sites with InvariantCulture (see inline).
  • 💡 Consider centralizing SourceLinkGitHubPackageVersion in eng/Versions.props (see inline).

Note

  • CI checks were still pending at review time — this isn't mergeable until the dotnet-android pipeline goes green, since a mechanical move like this is best validated by a full build + the tools test suites.

Counts: 0 ❌ · 0 ⚠️ · 2 💡

Generated by Android PR Reviewer for #12215 · 108 AIC · ⌖ 18.9 AIC · ⊞ 6.8K
Comment /review to run again

Comment thread Directory.Build.targets
Comment thread src/Microsoft.Android.Build.BaseTasks/Microsoft.Android.Build.BaseTasks.csproj Outdated
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 9590cf75-594f-4834-9762-189eaf472675
@jonathanpeppers

jonathanpeppers commented Jul 24, 2026

Copy link
Copy Markdown
Member Author

Compared the shipped artifacts from PR build 1524166 with main-equivalent build 1524155. No build exists for the exact base SHA; 1524155 used current main Android-tools inputs and changed only unrelated Java.Interop Gradle test files.

Artifact Differences Verdict
Xamarin.Android.Tools.AndroidSdk.dll The compared artifact exposed an unintended GitInfo history reset to 1.0.0.0. The moved base version now carries forward patch 192; CI-equivalent outputs are 1.0.192.0. Strong-name token, dependencies, resources, and public API remain unchanged; IL changes only add the intentional JI_JAVA_HOME precedence behavior. ✅ Fixed in e64407418
Microsoft.Android.Build.BaseTasks.dll Same assembly/file version, strong-name token, references, and public API. Size increased by 2 KB from the six intentional CA1305 fixes plus internal nullable-analysis compatibility attributes. ✅ OK; internal-only difference
AndroidSdk NuGet package Same files and dependencies. Version remains 1.0.0-ci.<commit>.0; project URL and repository commit now reference the moved location. ✅ OK
Localized resource assemblies Same sizes and resource content; hashes differ with build identity. ✅ OK

The netstandard PublicAPI baseline files are byte-identical before and after the move. Overall, the shipped API and behavior are preserved except for the intentional JDK precedence and culture-safe formatting changes.

The older direct-main artifact used 1.0.192, but that changed to 1.0.0 earlier when the tools were vendored into main, not in this PR.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 9590cf75-594f-4834-9762-189eaf472675
@jonathanpeppers jonathanpeppers added the ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). label Jul 24, 2026
@jonathanpeppers
jonathanpeppers enabled auto-merge (squash) July 24, 2026 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants