Commit 9ed1469
authored
[Xamarin.Android.Build.Tasks] Rework DTB to use .aar files directly (#9700)
Context: https://developer.android.com/studio/projects/android-library#aar-contents
One of the big issues we have with design time builds is the shear
amount of time they take. This is principally because we have to
discover and extract *all* the `.aar`/`.zip` files which we need
before we can do a build.
This used to be because we embedded the data into the assemblies, but
we ship these resources as `.aar` file these days.
Let's take advantage of that.
Rather then extracting to disk and then reading the files from disk,
we instead read the `.aar` directly for a design time build.
We extract the required data into memory which will allow us to
generate the required `R.txt` file. Note that only a small amount of
data is needed from the `.aar`, its mostly entry filenames and the
contents of any `.xml`/`.axml` files which we find in the `res` folder.
This will cut down the amount of data we need.
We only use this for design time builds.
The typical build is left as-is, and if the on disk cache is available
the design time build will use that instead of the `.aar`s.
One of the things that was missing from our design time build tests
was the `SkipCompilerExecution` MSBuild parameter. This is one of
the important parameters which VS uses, as it stops the `<Csc/>` Task
from creating an assembly on disk. This was the main speed issue we
had in our unit tests, and adding this flag cut a second off of our
design time build times.
| | Average Time |
| ------------- | ------------: |
| ef9912a | 2026.2504ms |
| This Commit | 592.1775ms |1 parent 7a772f0 commit 9ed1469
File tree
21 files changed
+291
-109
lines changed- build-tools/xaprepare/xaprepare/Steps
- src/Xamarin.Android.Build.Tasks
- MSBuild/Xamarin/Android
- Microsoft.Android.Sdk/targets
- Tasks
- Tests
- Xamarin.Android.Build.Tests
- Utilities
- Xamarin.ProjectTools/Common
- Utilities
- tests
- MSBuildDeviceIntegration/Tests
- msbuild-times-reference
21 files changed
+291
-109
lines changedLines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
| |||
Lines changed: 1 addition & 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 | 33 | | |
| |||
Lines changed: 37 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
47 | 48 | | |
| 49 | + | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
| |||
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
59 | 90 | | |
60 | 91 | | |
61 | | - | |
| 92 | + | |
62 | 93 | | |
63 | 94 | | |
64 | 95 | | |
65 | 96 | | |
66 | 97 | | |
67 | 98 | | |
| 99 | + | |
68 | 100 | | |
69 | 101 | | |
70 | 102 | | |
| |||
75 | 107 | | |
76 | 108 | | |
77 | 109 | | |
78 | | - | |
| 110 | + | |
79 | 111 | | |
80 | 112 | | |
81 | 113 | | |
82 | 114 | | |
83 | 115 | | |
84 | 116 | | |
| 117 | + | |
85 | 118 | | |
86 | 119 | | |
87 | 120 | | |
| |||
159 | 192 | | |
160 | 193 | | |
161 | 194 | | |
| 195 | + | |
| 196 | + | |
162 | 197 | | |
163 | 198 | | |
164 | 199 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
| |||
105 | 106 | | |
106 | 107 | | |
107 | 108 | | |
| 109 | + | |
108 | 110 | | |
109 | 111 | | |
110 | 112 | | |
| |||
Lines changed: 2 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
116 | 115 | | |
117 | 116 | | |
118 | 117 | | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | 118 | | |
124 | 119 | | |
125 | 120 | | |
126 | 121 | | |
127 | 122 | | |
128 | 123 | | |
129 | 124 | | |
130 | | - | |
131 | 125 | | |
132 | 126 | | |
133 | 127 | | |
| |||
142 | 136 | | |
143 | 137 | | |
144 | 138 | | |
| 139 | + | |
145 | 140 | | |
146 | 141 | | |
147 | | - | |
148 | 142 | | |
149 | 143 | | |
150 | 144 | | |
| |||
171 | 165 | | |
172 | 166 | | |
173 | 167 | | |
| 168 | + | |
174 | 169 | | |
175 | 170 | | |
176 | 171 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
| 29 | + | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
Lines changed: 42 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
9 | 13 | | |
10 | 14 | | |
11 | 15 | | |
| |||
22 | 26 | | |
23 | 27 | | |
24 | 28 | | |
| 29 | + | |
| 30 | + | |
25 | 31 | | |
26 | 32 | | |
27 | 33 | | |
| |||
64 | 70 | | |
65 | 71 | | |
66 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
67 | 109 | | |
68 | 110 | | |
69 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| |||
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
34 | | - | |
| 36 | + | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1029 | 1029 | | |
1030 | 1030 | | |
1031 | 1031 | | |
1032 | | - | |
| 1032 | + | |
1033 | 1033 | | |
1034 | 1034 | | |
1035 | 1035 | | |
| |||
0 commit comments