-
Notifications
You must be signed in to change notification settings - Fork 528
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Xamarin.Android.Build.Tasks] ignore .csproj.user changes (#5283)
I noticed that changing the selected device or emulator in Visual Studio 2019 16.8 on Windows was causing many MSBuild targets to run again in the IDE. The time taken was similar to a `Rebuild`! Looking closer, I noticed: Building target "_CompileJava" completely. Input file "App42.csproj.user" is newer than output file "obj\Debug\_javac.stamp". `.csproj.user` is where the IDE stores the selected device or emulator. The contents of the file: <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <SelectedDevice>pixel_2_pie_9_0_-_api_28</SelectedDevice> <DefaultDevice>pixel_2_pie_9_0_-_api_28</DefaultDevice> </PropertyGroup> </Project> The reason this triggers many targets is that [`*.csproj.user` is actually imported][0], which in turn means this file is automatically included in `$(MSBuildAllProjects)`, which is used by many `Inputs` of Xamarin.Android MSBuild targets. I first tried editing `$(MSBuildAllProjects)`, but this property appears to be readonly, since it is a built-in property in MSBuild. Attempts at setting it were ignored. To solve this, create a new `@(_AndroidMSBuildAllProjects)` item group to be used instead that excludes the `.csproj.user` file. I was able to reproduce this issue in a new test in `IncrementalBuildTest`. TODO: After this goes in, there is one place in the xamarin/monodroid repo that needs to use `@(_AndroidMSBuildAllProjects)` instead of `$(MSBuildAllProjects)`. [0]: https://github.com/dotnet/msbuild/blob/7452552ce911efdca6aea5a189c409f083db7bc7/src/Tasks/Microsoft.Common.CurrentVersion.targets#L31
- Loading branch information
1 parent
113ffcc
commit fd8aa17
Showing
12 changed files
with
69 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
### Build and deployment performance | ||
|
||
* [GitHub PR 5283](https://github.com/xamarin/xamarin-android/pull/5283): | ||
Fixed an issue where changing the selected device or emulator in | ||
the IDE would cause many parts of the build to run on an | ||
incremental build. This reduced the overall build time from 5.526 | ||
seconds to 1.451 seconds for this scenario in a small test | ||
project. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters