[release/8.0.2xx] [Xamarin.Android.Build.Tasks] DTBs should not rm generator output #8835
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.
Backport of: #8706
Fixes: #8658
Fixes: #8698
Design-time builds don't play nicely with binding project builds:
After this initial Design-Time build, we have the following generated source code for the binding:
Run a Design-Time build again:
…and we're now missing files (?!):
In particular,
$(IntermediateOutputPath)generated/*/**.cs
is gone, includingE.Example.cs
!The result of this is that Design-Time builds and "normal" builds "fight" each other, constantly generating and deleting files, slowing down incremental builds.
The root of the problem is the
_ClearGeneratedManagedBindings
target: It was designed to clean out thegenerated
folder in the case where no binding libraries were present. However, it turns out it was running during a design time build! During design time builds the binding library item groups are not evaluated, so the_ClearGeneratedManagedBindings
target would run, deleting everything.Fix this by ensuring we only run the
_ClearGeneratedManagedBindings
target in in "standard"/non-Design-Time builds.