-
Notifications
You must be signed in to change notification settings - Fork 565
Generator support for api.xml style java docs for parameter names #920
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
Conversation
|
@Redth, |
|
I think this PR needs a rebase and massive cleanup. :-( |
This will allow api.xml style documents to be specified as java doc inputs for the ClassParse task. Java.Interop already knows how to handle this doc source type.
32cf757 to
73598ce
Compare
|
@jonpryor perhaps we want to take this in a different direction altogether in light of the cleanup around DocletType in java.interop? Basically all we're doing here is concatenation all of the 'doc type paths' into one single array which gets passed over to java.interop to do the auto detection on anyways. Instead of introducing a new |
Yes. We should introduce a new <ItemGroup>
<_DocsPath Include="$(JavaDocPaths)" />
<_DocsPath Include="$(Java7DocPaths)" />
<_DocsPath Include="$(Java8DocPaths)" />
<_DocsPath Include="$(DroidDocPaths)" />
<_DocsPath Include="@(JavaDocJar->'$(IntermediateOutputPath)javadocs\%(FileName)')" />
<_DocsPath Include="@(AndroidDocumentationatPath)" />
</ItemGroup>
<ClassParse Condition="'$(AndroidClassParser)' == 'class-parse'"
OutputFile="$(ApiOutputFile).class-parse"
SourceJars="@(EmbeddedJar);@(InputJar)"
DocumentationPaths="@(_DocsPath)"
/> |
|
@jonpryor where does |
|
Also, jar2xml still appears to use the individual path types... Is that within scope of changing here, or do we just leave it as is, since it's deprecated in favour of class-parse now anyway? |
|
@Redth asked:
It doesn't come from anywhere yet.
No. It's deprecated; leave it be. |
We previously had JavaDocPaths, Java7DocPaths, etc. etc which were all separate task input parameters and itemgroups, but ultimately were concatenated into one single list anyway. This merges the existing separate itemgroups into one new itemgroup and one single ClassParse task parameter.
|
Ahh yep, I initially misread your proposal. All makes sense, and this is what i've added. |
|
Please remove the Java.Interop bump from this PR. It isn't necessary. |
| </CreateItem> | ||
|
|
||
| <ItemGroup> | ||
| <_AndroidDocumentationPath Include="$(AndroidDocumentationPath)" /> |
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.
I think this should be @(AndroidDocumentationPath) (item group), not $(AndroidDocumentationPath) (property).
|
This should also include: git diff src/Xamarin.Android.Build.Tasks/Xamarin.Android.Bindings.targets
diff --git a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Bindings.targets b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Bindings.targets
index 4016c47..6247fcf 100755
--- a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Bindings.targets
+++ b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Bindings.targets
@@ -68,6 +68,7 @@ Copyright (C) 2012 Xamarin Inc. All rights reserved.
<!-- Get our Build Actions to show up in VS -->
<ItemGroup>
+ <AvailableItemName Include="AndroidDocumentationPath" />
<AvailableItemName Include="EmbeddedJar" />
<AvailableItemName Include="EmbeddedNativeLibrary" />
<AvailableItemName Include="EmbeddedReferenceJar" /> |
|
@atsushieno: Thoughts on the approach laid out above? |
So we get the option to pick this from within the IDE.
AndroidDocumentationPath will be assumed to be an `<ItemGroup>` entry, not a `<PropertyGroup>` property unlike the other doc paths have historically been. `$` was therefore incorrect and should be `@`
|
It is a breaking change to binding developers so we can't kill those existing doc paths. JavaDocIndex is already there, so no need to add new build action. It's for mdoc-based XML docs generation, but unless you explicitly specify the project option to generate it, it won't do the job. (And IMO we shouldn't bring in more build actions; it is already confusing developers with too many FooBarJar.) |
This doesn't "kill" those existing doc paths. They're still used, e.g.
Indeed. I'd forgotten about that. :-( The one possible problem here is that |
|
API XML had never been supported in jar2xml and people should not expect it to be supported, therefore it should be just ignored. Again, I don't like the idea of publicly accessible AndroidDocPaths build item. Not only because the reason I mentioned above (too many build actions + we already have JavaDocIndex), but also because users can never specify that target item from the IDE. Build Actions are for files, not directories on VS/VS4M. I like the idea of incorporating JavaDocJar there, although the premise that the docs must be extracted in javadoc intermediate directory is somewhat fragile. That makes dependency tracking and future refactoring difficult and error-prone. But to avoid that we first need to kill MSBuild and reimplement everything, and it won't happen for a while, so it's inevitable. |
Agreed. However, there are two ways of "ignoring":
I previously agreed with you that we shouldn't introduce a new Build action, and we should instead reuse the existing Additionally,
Are you suggesting using a Build action of
|
No, not really, JavaDocIndex is even better. I don't like the idea of injecting that build item, but then we'd have to introduce another build action if we need this feature publicly available (do we?) If it's not for public use then I'd stick to a build property which is not exposed to users. |
|
And let's stop worring about jar2xml and take option 2. I rather worry about extraneous changes to be made. Engineering cost is not free. |
|
|
||
| <!-- Get our Build Actions to show up in VS --> | ||
| <ItemGroup> | ||
| <AvailableItemName Include="AndroidDocumentationPath" /> |
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.
As per prior comments on this thread, please remove this line.
| </CreateItem> | ||
|
|
||
| <ItemGroup> | ||
| <_AndroidDocumentationPath Include="@(AndroidDocumentationPath)" /> |
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.
...and update this line to use @(JavaDocIndex).
Use JavaDocIndex instead which already exists.
Adds support to binding projects to make use of ApiXmlDocPaths as a project property for including api.xml style java docs to be used by ClassParse for resolving parameter names.
This format is used by Android Support libraries (and eventually Google Play Services / Firebase).
This requires dotnet/java-interop@61c70ec
This PR supercedes and closes #916.