Skip to content

Conversation

@jonathanpeppers
Copy link
Member

In cd88d9c, we introduced a new DeployToDevice target for new dotnet run support.

However, the following Condition doesn't work due to build order:

<DeployToDeviceDependsOnTargets Condition=" '$(_XASupportsFastDev)' == 'true' ">
  $(_MinimalSignAndroidPackageDependsOn);
  _Upload;
</DeployToDeviceDependsOnTargets>
<DeployToDeviceDependsOnTargets Condition=" '$(_XASupportsFastDev)' != 'true' ">
  $(_MinimalSignAndroidPackageDependsOn);
  _DeployApk;
  _DeployAppBundle;
</DeployToDeviceDependsOnTargets>
  • Microsoft.Android.Sdk.BuildOrder.targets is imported right before Xamarin.Android.Common.targets where $(_XASupportsFastDev) is set.

To fix this:

  • Let's rename $(_XASupportsFastDev) to $(_AndroidFastDeploymentSupported) to just modernize the name.

  • Move $(_AndroidFastDeploymentSupported) to Microsoft.Android.Sdk.DefaultProperties.targets that is imported early on.

  • Update a test to verify the proper targets run in DeployToDevice target.

In cd88d9c, we introduced a new `DeployToDevice` target for new
`dotnet run` support.

However, the following `Condition` doesn't work due to build order:

    <DeployToDeviceDependsOnTargets Condition=" '$(_XASupportsFastDev)' == 'true' ">
      $(_MinimalSignAndroidPackageDependsOn);
      _Upload;
    </DeployToDeviceDependsOnTargets>
    <DeployToDeviceDependsOnTargets Condition=" '$(_XASupportsFastDev)' != 'true' ">
      $(_MinimalSignAndroidPackageDependsOn);
      _DeployApk;
      _DeployAppBundle;
    </DeployToDeviceDependsOnTargets>

* `Microsoft.Android.Sdk.BuildOrder.targets` is imported right before
  `Xamarin.Android.Common.targets` where `$(_XASupportsFastDev)` is set.

To fix this:

* Let's rename `$(_XASupportsFastDev)` to `$(_AndroidFastDeploymentSupported)`
  to just modernize the name.

* Move `$(_AndroidFastDeploymentSupported)` to
  `Microsoft.Android.Sdk.DefaultProperties.targets` that is imported
  early on.

* Update a test to verify the proper targets run in `DeployToDevice`
  target.
@jonathanpeppers
Copy link
Member Author

Test looks ok:

image

@jonathanpeppers jonathanpeppers marked this pull request as ready for review December 10, 2025 19:17
@jonathanpeppers
Copy link
Member Author

We can ignore the one test failure:

Microsoft.Android.Sdk.Windows\36.1.99-ci.dev-peppers-DeployToDevice-FastDev.64\tools\Xamarin.Android.Bindings.Maven.targets(28,5): error XA4236: - core-1.9.0.jar: Response status code does not indicate success: 404 (Not Found).

If we see it on other PRs, I can look into it.

@jonathanpeppers jonathanpeppers merged commit 17c5317 into main Dec 11, 2025
56 of 59 checks passed
@jonathanpeppers jonathanpeppers deleted the dev/peppers/DeployToDevice-FastDev branch December 11, 2025 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants