Commit 0353506
[Xamarin.Android.Build.Tasks] locate $(JdkJvmPath) only when needed (#2420)
Fixes: #2409
Context: https://github.com/xamarin/xamarin-android/wiki/Build-Performance-Results
When doing the latest performance comparison, I noticed that the
`<ResolveSdks/>` MSBuild task is a bit slower:
* VS 15.9:
80 ms ResolveSdks 7 calls
* VS 16.0 P2 (master)
127 ms ResolveSdks 7 calls
For `$(AndroidGenerateJniMarshalMethods)` support, we needed to
locate a new `$(JdkJvmPath)` location.
Since `<ResolveSdks/>` finds `$(JdkJvmPath)` on the first build and
design-time builds, it is worth making sure this task doesn't get any
slower. The initial design-time build happens on "solution create",
which is one of the more important metrics the VS team measures.
Split out the logic finding `$(JdkJvmPath)` and put it in a new
`<ResolveJdkJvmPath/>` MSBuild task.
Also setup a `Condition`, so it only runs if:
* Not a `$(DesignTimeBuild)`
* `$(AndroidGenerateJniMarshalMethods)` is enabled
* `$(JdkJvmPath)` is blank
This should save ~50ms on Design-Time-Builds and first builds.1 parent 143f397 commit 0353506
File tree
4 files changed
+78
-51
lines changed- src/Xamarin.Android.Build.Tasks
- Tasks
4 files changed
+78
-51
lines changedLines changed: 71 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 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 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | 53 | | |
57 | 54 | | |
58 | 55 | | |
| |||
96 | 93 | | |
97 | 94 | | |
98 | 95 | | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | 96 | | |
117 | 97 | | |
118 | 98 | | |
119 | 99 | | |
120 | 100 | | |
121 | 101 | | |
122 | | - | |
123 | 102 | | |
124 | 103 | | |
125 | 104 | | |
126 | 105 | | |
127 | 106 | | |
128 | 107 | | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | 108 | | |
159 | 109 | | |
160 | 110 | | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
145 | 146 | | |
146 | 147 | | |
147 | 148 | | |
| |||
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
710 | 711 | | |
711 | 712 | | |
712 | 713 | | |
713 | | - | |
714 | 714 | | |
715 | 715 | | |
716 | 716 | | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
717 | 722 | | |
718 | 723 | | |
719 | 724 | | |
| |||
0 commit comments