Bug 58596 - ImportJavaDoc Task fails on Windows due to bad path separator
Summary: ImportJavaDoc Task fails on Windows due to bad path separator
Status: RESOLVED NORESPONSE
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: dean.ellis
URL:
Depends on:
Blocks:
 
Reported: 2017-08-04 18:50 UTC by Wasi Haider
Modified: 2017-10-13 17:33 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NORESPONSE

Description Wasi Haider 2017-08-04 18:50:53 UTC
Hi Xamarin folks,

I'm working on an Android bindings project. The binding itself works quite well but the ImportjavaDoc task is failing. Here is the error:


IMPORTJAVADOC : warning JavadocToMDoc0001: Could not find source JavaDoc file: obj\Debug\javadocs\java-sdk-1.5.1-javadoc\com/mparticle/BuildConfig.html.
1>IMPORTJAVADOC : warning JavadocToMDoc0001: Could not find source JavaDoc file: obj\Debug\javadocs\java-sdk-1.5.1-javadoc\com/mparticle/DeepLinkError.html.


Look carefully at the path. Do you see the problem?

I was able to look at the IL for javadoc-to-mdoc.exe and I think the issue is in the Xamarin.Android.Tools.JavaDocToMdoc.HtmlLoader.GetJavaDocPath.


StringBuilder stringBuilder = new StringBuilder(this.SourceDocumentationRoot.Length + 1 + name.Length + 5).Append(this.SourceDocumentationRoot).Append(Path.DirectorySeparatorChar).Append(name.Replace('$', '.')).Append(".html");


I'm willing to bet that Path.DirectorySeparatorChar is not returning a valid separator. 

Please fix or let me know of a workaround.

Thanks,

Wasi -- Yes the same Wasi who used to work in the Xamarin BD Team  :)
Comment 1 Wasi Haider 2017-08-04 19:13:13 UTC
Actually to make a correction, it is not the path separator but rather what appears to be the package name (i.e. like com/mparticle/DeepLinkError)
Comment 2 Wasi Haider 2017-08-04 21:10:10 UTC
Ok so I edited the IL myself (using ILSpy and Reflexil) to do an additional replace but it looks like there is another problem after that

1>IMPORTJAVADOC : warning JavadocToMDoc0005: Could not find parameter 'provider' for type 'mParticle.Xamarin.Android.MParticle', member 'public virtual void EnableLocationTracking (string p0, long p1, long p2);'.

p0 is suppose to be 'provider'. For reasons I don't completely understand yet, it seems to be looking at the post-generator parameter names instead of the ones from the doc itself.

Looks like I'll need to resort to manually doing this in Metadata.xml

=(
Comment 3 Jon Douglas [MSFT] 2017-08-28 17:47:20 UTC
Hi Wasi,

For our team to dig further into this issue, they will want a reproduction project that demonstrates this problem. You can feel free to upload a zip of a binding project that shows these warnings(Use a File->New Project as a template to minimize the test case)

Secondly, it would be very helpful if you can add a few sections to your bug report:

- Steps to Reproduce
- Actual Results
- Expected Results
- Version Information

https://bugzilla.xamarin.com/page.cgi?id=bug-writing.html

As for your issues with the parameter names, you should be able to easily rename these items using Metadata.xml. I have a guide that might help in some areas:

https://gist.github.com/JonDouglas/dda6d8ace7d071b0e8cb

Thanks in advance!
Comment 4 Jon Douglas [MSFT] 2017-10-13 17:33:58 UTC
Because we have not received a reply to our request for more information we are closing this issue. If you are still encountering this issue, please reopen the ticket with the requested information. Thanks!