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] Install should skip Build when inside t…
…he IDE Context: https://github.com/xamarin/xamarin-android/wiki/IDE-Performance-Results Context: https://github.com/jonathanpeppers/HelloWorld When doing some performance measurements *inside* of Visual Studio, I noticed we seem to have significant overhead in a build with no changes. In a "Hello World" Xamarin.Forms app: Preparation Time: 00:03.9 Launch Time: 00:02.5 Where `Preparation Time` is everything MSBuild, and `Launch Time` is the time it takes to start the Android application and attach the debugger. `Preparation Time` is effectively: msbuild Foo.Android.csproj /p:BuildingInsideVisualStudio=True /t:Build msbuild Foo.Android.csproj /p:BuildingInsideVisualStudio=True /t:Install One concern here is that `Install` depends on `SignAndroidPackage`, which depends on `Build`. We are doing a lot of MSBuild work here twice, since MSBuild needs to run through certain targets twice and decide they can be skipped. This work is "not free" and mostly involved MSBuild evaluating properties and time stamps on files. What I found we could do here is skip `Build` on the `Install` target when `$(BuildingInsideVisualStudio)` is `True`. Due to the dependency chain, this also affects `SignAndroidPackage`. The minimal list of targets for `SignAndroidPackage` that still work: - `_CreatePropertiesCache` - `ResolveReferences` - `_CopyPackage` - `_Sign` Initial results from the IDE show: Preparation Time: 00:02.06s This is a ~2 second saving on the inner dev loop! ~~ Concerns ~~ Since our MSBuild tests set `$(BuildingInsideVisualStudio)`, a lot of our tests might break. We might have to add an additional call to `Build` in each failing test.
- Loading branch information