-
Notifications
You must be signed in to change notification settings - Fork 528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Xamarin.Android.Build.Tasks] Parse AAPT errors so every build error isn't APT0000 #3577
Conversation
} | ||
|
||
static readonly List<Tuple<string, string>> error_codes = new List<Tuple<string, string>> () { | ||
Tuple.Create ("AndroidManifest.xml is corrupt", "APT1100"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For ease of human parsing, could the error number be first in the tuple, instead of second? That would allow all of the error messages and codes to line up vertically and be easier (for me) to read:
Tuple.Create ("APT1100", "AndroidManifest.xml is corrupt"),
Tuple.Create ("APT1001", "can't use '-u' with add"),
Tuple.Create ("APT1002", "dump failed because assets could not be loaded"),
// ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commit message/PR description should also provide where/how you got these strings. Grepping the aapt
source (with what grep
command)? Something else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
388e60a
to
0c708f7
Compare
Unit test expected output needs to be updated so that unit tests still pass. Consider:
That's because the new output is:
|
0c708f7
to
38441a5
Compare
ok another slight problem... currently we document all of our error codes here. Do we need to auto generate a bunch of documents for these new error codes? I believe they use our docs to generate the docs on the VS site which the IDE links to if you want more help on an error. |
ef39bcd
to
bfbf509
Compare
bfbf509
to
7c8e7d2
Compare
Context: https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_workitems/edit/735263 Context: https://android.googlesource.com/platform/frameworks/base/+/563abce4ed0a0d9f08f8839a8f15b548b3dcd4d1/tools/aapt Context: https://gist.github.com/grendello/72c1ce5f6e8cdd3aefd393b983576d9a Errors and warning *codes* for errors and warnings reported *within Visual Studio* from developers participating in the [Visual Studio Customer Experience Improvement Program][0] are reported "telemetry" events, but *only* the error and warning codes are reported. The warning and error message contents are not sent. Unfortunately all `aapt`-related errors are reported as APT0000, which reduces the utility of telemetry, making it more difficult to better understand where our build system could be improved. @grendello created a `grep` pipeline for the `aapt` sources to try to extract plausible error messages that we can compare against. The exact pipeline has been lost, but this is an in-progress pipeline for finding error messages from the `aapt2` sources: rgrep -Pzoh '(?s)(->|\.)Error.*?;\n' * | \ tr -d '\n' | tr ';' '\n'| \ sed -e 's/^[ \t]*//g' -e 's/^.*Error([ \t]*DiagMessage[ \t]*(.*)[ \t]*<<//g' -e 's/^.*Error(.*)//g;' -e 's/^;$//g' | \ sort | uniq Improve the `<Aapt/>` task to check against this list of "known" error strings and associate them with unique `APTxxxx` codes. This will allow for more meaningful documentation to be written in the future, and will allow our telemetry to be more meaningful and permit improved focusing of future efforts. [0]: https://docs.microsoft.com/en-us/visualstudio/ide/visual-studio-experience-improvement-program?view=vs-2019
Error messages taken from https://gist.github.com/grendello/72c1ce5f6e8cdd3aefd393b983576d9a.
Created by grepping the
aapt
source forerror
.