Skip to content

[build] Drop always-true _HasCommercialFiles / _AndroidFastDeploymentSupported gates#11576

Open
jonathanpeppers wants to merge 2 commits into
mainfrom
jonathanpeppers/drop-always-true-msbuild-gates
Open

[build] Drop always-true _HasCommercialFiles / _AndroidFastDeploymentSupported gates#11576
jonathanpeppers wants to merge 2 commits into
mainfrom
jonathanpeppers/drop-always-true-msbuild-gates

Conversation

@jonathanpeppers
Copy link
Copy Markdown
Member

@jonathanpeppers jonathanpeppers commented Jun 4, 2026

Follow-up to #11529, which inlined the external/android-platform-support repo into dotnet/android. The Debugging.targets/props files and supporting assemblies (Mono.AndroidTools, Xamarin.AndroidTools, Xamarin.Installer.*, Xamarin.Android.Build.Debugging.Tasks, fastdevtools) are now always built in-tree by Xamarin.Android.sln, so several Exists(...) MSBuild gates are always true.

This PR removes those dead gates and their dead branches:

  • build-tools/installers/create-installers.targets – drop _HasCommercialFiles and make the commercial _MSBuildFiles ItemGroup unconditional.
  • Microsoft.Android.Sdk.DefaultProperties.targets – drop _AndroidFastDeploymentSupported.
  • Microsoft.Android.Sdk.BuildOrder.targets – drop the '$(_AndroidFastDeploymentSupported)' == 'true' condition on DeployToDeviceDependsOnTargets; delete the dead != 'true' branch.
  • Microsoft.Android.Sdk.Application.targets – same treatment for _RunDependsOn; remove the now-stale comment.
  • Xamarin.Android.Common.targets – drop Exists(...) from the Xamarin.Android.Common.Debugging.targets and Xamarin.Installer.Common.targets imports (keep the '$(DesignTimeBuild)' != 'true' guards); simplify the two dead _AndroidFastDeploymentSupported conditions on EmbedAssembliesIntoApk.
  • Microsoft.Android.Sdk.targets – drop Exists(...) from the Xamarin.Android.Common.Debugging.props import (keep DTB guard).
  • Tests – drop the now-defensive proj.SetProperty ("_AndroidFastDeploymentSupported", "true") calls (and the stale //NOTE comment) from BuildTest.cs and InvalidConfigTests.cs.

TestEnvironment.CommercialBuildAvailable / BaseTest.AssertCommercialBuild() are intentionally left for a follow-up PR.

After this change git grep _HasCommercialFiles and git grep _AndroidFastDeploymentSupported both return zero hits.

…Supported gates

PR #11529 inlined the external/android-platform-support repo into
dotnet/android. The Debugging.targets/props files and supporting
assemblies (Mono.AndroidTools, Xamarin.AndroidTools, Xamarin.Installer.*,
Xamarin.Android.Build.Debugging.Tasks, fastdevtools) are now always
built in-tree by Xamarin.Android.sln, which makes several
`Exists(...)` MSBuild gates always true.

Remove the now-dead gates and their dead branches:

  * Drop `_HasCommercialFiles` from build-tools/installers/create-installers.targets
    and make the commercial `_MSBuildFiles` ItemGroup unconditional.
  * Drop `_AndroidFastDeploymentSupported` from
    Microsoft.Android.Sdk.DefaultProperties.targets, plus the dead
    `!= ''true''` branches of `DeployToDeviceDependsOnTargets` and
    `_RunDependsOn` (and the `_AndroidFastDeploymentSupported`
    condition on `EmbedAssembliesIntoApk` in
    Xamarin.Android.Common.targets).
  * Drop the `Exists(...)` portion of the `<Import>` conditions for
    Xamarin.Android.Common.Debugging.{props,targets}; keep the
    `''$(DesignTimeBuild)'' != ''true''` guard.
  * Drop now-defensive `proj.SetProperty ("_AndroidFastDeploymentSupported", "true")`
    calls from BuildTest.cs and InvalidConfigTests.cs.

`TestEnvironment.CommercialBuildAvailable` /
`BaseTest.AssertCommercialBuild()` are intentionally left for a
follow-up PR.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 4, 2026 14:55
Same reasoning as the prior commit: Xamarin.Installer.Common.targets
is shipped from src/Xamarin.Installer.Build.Tasks (CopyToOutputDirectory
=PreserveNewest) and is listed in the now-unconditional commercial
_MSBuildFiles ItemGroup, so it is always present alongside
Xamarin.Android.Common.targets. Drop the Exists(...) check and keep
only the DesignTimeBuild guard.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jonathanpeppers
Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Copy Markdown
Contributor

Copilot AI left a 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 removes now-dead MSBuild “feature detection” gates (Exists(...), _HasCommercialFiles, _AndroidFastDeploymentSupported) introduced for the former external/android-platform-support layout, reflecting that the debugging/installer components are now built in-tree.

Changes:

  • Removes _HasCommercialFiles and makes the installer/debugging _MSBuildFiles item list unconditional.
  • Removes _AndroidFastDeploymentSupported and simplifies Debug/Deploy/Run target wiring to a single path.
  • Updates build tests to stop force-setting _AndroidFastDeploymentSupported.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
build-tools/installers/create-installers.targets Removes _HasCommercialFiles gating and unconditionally includes installer/debugging artifacts.
src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets Removes _AndroidFastDeploymentSupported property initialization.
src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.BuildOrder.targets Collapses DeployToDeviceDependsOnTargets to the fast-deploy path only.
src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.Application.targets Collapses _RunDependsOn to the _Run-based path only.
src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets Simplifies EmbedAssembliesIntoApk defaults and removes Exists(...) from Debugging.targets import.
src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.targets Removes Exists(...) guard from Debugging.props import.
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs Removes _AndroidFastDeploymentSupported test scaffolding.
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/InvalidConfigTests.cs Removes _AndroidFastDeploymentSupported test scaffolding.

Comment thread src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets
@jonathanpeppers jonathanpeppers added the ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). label Jun 4, 2026
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