Commit 6355de3
authored
[One .NET] fixes for IncrementalClean and FileWrites (#4905)
Context: https://github.com/xamarin/xamarin-android/blob/792d61d116cc0293bd457d1c418d1972829ec226/Documentation/guides/MSBuildBestPractices.md#filewrites-and-incrementalclean
Running under `dotnet`, a test is failing with:
GenerateJavaStubsAndAssembly(True)
android\environment.armeabi-v7a.o is not in FileWrites!
Expected: some item equal to "C:\A_work\1\s\bin\TestRelease\temp\GenerateJavaStubsAndAssemblyTrue\obj\Release\android\environment.armeabi-v7a.o"
When I authored `Microsoft.Android.Sdk.BuildOrder.targets`, I didn't
bring over the workaround to make `IncrementalClean` and `FileWrites`
work appropriately:
<CoreBuildDependsOn>
$([MSBuild]::Unescape($(CoreBuildDependsOn.Replace('IncrementalClean;', '$(_BeforeIncrementalClean);IncrementalClean;'))))
</CoreBuildDependsOn>
It appears this is still needed in the new `dotnet` world order. I
brought over the missing pieces from `Xamarin.Android.Legacy.targets`.
We can eventually use a new `$(IncrementalCleanDependsOn)` instead:
dotnet/msbuild#5499
We also need to specify the `armeabi-v7a` ABI in this test, because
the default ABIs are different in .NET 5+.
I added some helper methods to check `Builder.UseDotNet` to decide if
`$(RuntimeIdentifier)` should be used instead of `$(AndroidSupportedAbis)`.
I updated a couple tests that should use these helpers.1 parent 792d61d commit 6355de3
File tree
5 files changed
+41
-8
lines changed- src/Xamarin.Android.Build.Tasks
- Microsoft.Android.Sdk/targets
- Tests
- Xamarin.Android.Build.Tests
- Xamarin.ProjectTools/Utilities
5 files changed
+41
-8
lines changedLines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
30 | 36 | | |
31 | 37 | | |
32 | 38 | | |
| |||
43 | 49 | | |
44 | 50 | | |
45 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
46 | 55 | | |
47 | 56 | | |
48 | 57 | | |
| |||
64 | 73 | | |
65 | 74 | | |
66 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
67 | 79 | | |
68 | 80 | | |
69 | 81 | | |
| |||
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1954 | 1954 | | |
1955 | 1955 | | |
1956 | 1956 | | |
1957 | | - | |
1958 | | - | |
1959 | | - | |
| 1957 | + | |
1960 | 1958 | | |
1961 | 1959 | | |
1962 | 1960 | | |
| |||
Lines changed: 1 addition & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
| 42 | + | |
47 | 43 | | |
48 | 44 | | |
49 | 45 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
774 | 774 | | |
775 | 775 | | |
776 | 776 | | |
| 777 | + | |
777 | 778 | | |
778 | 779 | | |
779 | 780 | | |
| |||
785 | 786 | | |
786 | 787 | | |
787 | 788 | | |
| 789 | + | |
788 | 790 | | |
789 | 791 | | |
790 | 792 | | |
| |||
Lines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
7 | 32 | | |
8 | 33 | | |
9 | 34 | | |
| |||
0 commit comments