Commit 221a219
[Xamarin.Android.Build.Tasks] Fix Aapt2 warnings showing as errors (#2027)
Fixes (again): #1770
On Windows we are hitting the same issue where the warnings `aapt2`
is producing are being logged as errors.
The weird part is that the "file" group was not being populated
with the right information. This turns out to be down to how
`aapt2` is reporting the warnings: there may be *spaces* within the
line number portion:
W/ResourceType(23681): For resource 0x0101053d, entry index(1341) is beyond type entryCount(733)
W/ResourceType( 5536): For resource 0x0101053d, entry index(1341) is beyond type entryCount(1155)
^
This space throws off our regex and results in the entire line ending
up in the `message` property. The fix is to update the regex to
allow spaces for the `line` capture group. We then also need to Trim
that value before passing it into `int.Parse()` to ensure we don't
get an error.1 parent 967fe94 commit 221a219
File tree
4 files changed
+22
-5
lines changed- src/Xamarin.Android.Build.Tasks
- Tasks
- Tests/Xamarin.Android.Build.Tests
4 files changed
+22
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
412 | 412 | | |
413 | 413 | | |
414 | 414 | | |
415 | | - | |
| 415 | + | |
416 | 416 | | |
417 | 417 | | |
418 | 418 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
| 112 | + | |
| 113 | + | |
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| |||
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
133 | 149 | | |
134 | 150 | | |
135 | 151 | | |
| |||
0 commit comments