[Xamarin.Android.Tools.Bytecode] Relax _ApiXml check #772
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context: #767
Context: https://github.com/xamarin/xamarin-android/blob/a7413a2389886082c3d3422c50a7e6cc84f43d8f/src/Xamarin.Android.Build.Tasks/MSBuild/Xamarin/Android/Xamarin.Android.Bindings.ClassParse.targets#L23
Commit 69e1b80 added
java-source-utils.jar, which can parse Javasource code to extract parameter names, storing them into a
"
class-parse-like XML file".A benefit to a "
class-parse-like XML file" is that it should bepossible to use this same file with
class-parse --docspath,overriding parameter names present in Java bytecode (which typically
isn't present, as
javac -parametersis rarely used).Unfortunately, this doesn't work: if you attempt to use
java-source-utils.jaroutput w/class-parse --docspath, it fails:The problem is that we shouldn't be creating a
DroidDocScraperfor
java-source-utils.jaroutput, it should be creating aApiXmlDocScraper!We're creating the wrong
*Scrapertype becauseJavaMethodParameterNameProvider.GetDocletType()doesn't detectjava-source-utils.jaroutput as beingJavaDocletType._ApiXml;instead, it treats it as the default of
JavaDocletType.DroidDoc.JavaMethodParameterNameProvider.GetDocletType()doesn't detectjava-source-utils.jaroutput as beingJavaDocletType._ApiXml,because it requires that the XML contain:
while
java-source-utils.jarinstead emits:Relax
JavaMethodParameterNameProvider.GetDocletType()to insteadcheck for
<api. This allowsclass-parseto usejava-source-utils.jaroutput for parameter names.