xamarin-android/tests/MSBuildDeviceIntegration
Jonathan Peppers ee7c73e10b
[Xamarin.Android.Build.Tasks] $DOTNET_MODIFIABLE_ASSEMBLIES & FastDev (#9451)
Context: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=10431207&view=ms.vss-test-web.build-test-results-tab&runId=114098346&resultId=100000&paneView=debug

The `FastDeployEnvironmentFiles(false)` test fails on PRs from forks,
because the "Fast Deployment" feature is not included in OSS builds:

	The Environment variable "DOTNET_MODIFIABLE_ASSEMBLIES" was not set.
	Expected: String containing "DOTNET_MODIFIABLE_ASSEMBLIES=Debug"
	But was:  "--------- beginning of main …

The problem appears to be related to target ordering:

  * `_GetGenerateJavaStubsInputs` : uses `@(AndroidEnvironment)` to
    set `@(_EnvironmentFiles)`

  * `_GetGenerateJavaStubs` : must have same `Inputs` as
    `_GeneratePackageManagerJava`

  * `_GeneratePackageManagerJava`: actually uses `@(_EnvironmentFiles)`

  * `_GenerateEnvironmentFiles` : creates a new
    `@(AndroidEnvironment)` file that won't be used!

But when using either a `Release` build or `Debug` build with
`FastDev` enabled, everything works fine.

To fix this, rework the target ordering:

  * `_GetGenerateJavaStubsInputs` depends on
    `_GenerateEnvironmentFiles`

    Unfortunately, this is now a circular dependency that causes an
    MSBuild error.

  * Break the cycle by updating `_GenerateEnvironmentFiles` to no
    longer depend upon `_ReadAndroidManifest`.

    It does not appear that `_ReadAndroidManifest` is needed by
    `_GenerateEnvironmentFiles`, as no properties created there are
    used.
2024-10-25 13:04:14 -04:00
..
Resources [Xamarin.Android.Build.Tasks] XA1039 error for Android.Support (#8629) 2024-01-18 08:18:55 -05:00
Tests [Xamarin.Android.Build.Tasks] $DOTNET_MODIFIABLE_ASSEMBLIES & FastDev (#9451) 2024-10-25 13:04:14 -04:00
AssemblyInfo.cs [tests] remove SingleThreadedAttribute (#5986) 2021-06-02 16:13:32 -04:00
MSBuildDeviceIntegration.csproj [Xamarin.Android.Build.Tasks] Make all assemblies RID-specific (#8478) 2024-03-15 16:30:07 -04:00