This repository was archived by the owner on Jun 20, 2023. It is now read-only.
Commit 3881f37
committed
[msbuild] make _VerifyXamarinAndroidSupportVersions incremental
When reviewing build logs from 2019 GA, I noticed an MSBuild target
from the support libraries taking some time:
377 ms _VerifyXamarinAndroidSupportVersions 1 calls
In a build with no changes, it was the 5th longest duration:
463 ms _SetLatestTargetFrameworkVersion 1 calls
554 ms _ResolveAssemblies 1 calls
606 ms _GetProjectReferenceTargetFrameworkProperties 2 calls
682 ms ResolveProjectReferences 2 calls
*NOTE: you can do `msbuild foo.csproj /clp:performancesummary` for
this breakdown.*
It looks like there are a couple things we can improve here:
1. This target runs on design-time builds.
2. This target always runs on every build, even when there is no
changes.
No. 1 we can add a `Condition`, as I don't think it is worth the build
time--DTBs are supposed to be as quick as possible. I don't think it's
needed during DTBs at all?
For No. 2, we can also skip this target after the first build unless:
* The project file changes.
* The `AndroidManifest.xml` changes.
So I setup a simple `.stamp` file, that will allow these target to
skip unless one of the inputs changes.
Details about how we do this in Xamarin.Android here:
https://github.com/xamarin/xamarin-android/blob/master/Documentation/guides/MSBuildBestPractices.md#stamp-files1 parent f2e01b6 commit 3881f37
File tree
1 file changed
+16
-1
lines changed- source/com.android.support/support-annotations
1 file changed
+16
-1
lines changedLines changed: 16 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
8 | 12 | | |
9 | 13 | | |
10 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
11 | 18 | | |
12 | 19 | | |
13 | 20 | | |
| |||
24 | 31 | | |
25 | 32 | | |
26 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
27 | 42 | | |
28 | 43 | | |
29 | 44 | | |
0 commit comments