[Xamarin.Android.Build.Tasks] fix $DOTNET_MODIFIABLE_ASSEMBLIES when FastDev is off #9451
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.
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 problem appears to be related to target ordering:
_GetGenerateJavaStubsInputs
: uses@(AndroidEnvironment)
to set@(_EnvironmentFiles)
_GetGenerateJavaStubs
: must have sameInputs
as_GeneratePackageManagerJava
_GeneratePackageManagerJava
: actually uses@(_EnvironmentFiles)
_GenerateEnvironmentFiles
: creates a new@(AndroidEnvironment)
file, that won't be used!But when using either a
Release
build orDebug
build withFastDev
enabled, everything works fine.To fix this, we can rework the target ordering:
_GetGenerateJavaStubsInputs
depends on_GenerateEnvironmentFiles
Unfortunately, this is now a circular dependency that causes an MSBuild error.
_GenerateEnvironmentFiles
no longer depends on_ReadAndroidManifest
to break the cycle.I does not appear that
_ReadAndroidManifest
is needed, as no properties created there are used.