NormandErwan / DocFxForUnity

DocFX usage example for Unity projects
https://normanderwan.github.io/DocFxForUnity/
MIT License
213 stars 31 forks source link

Issues getting the Xref working #10

Closed UnityCreativeDesign closed 3 years ago

UnityCreativeDesign commented 4 years ago

Having a few issues getting the pipeline with the Xref for unity working. I am using Azure pipelines and have all the documentation generating, but do not have the references to any unity behaviours.

When running it locally i have the names, but no links to the actual unity documentation (is it meant to have a link like it does to object?)

thanks for any pointers that may help

UnityCreativeDesign commented 4 years ago

So i got a bit further, i have uploaded the site generated from the Xrefmaps to a new repo with its own github page and pointed the xref variable in the docfx.json to this .yml file. When generating the main documentation though local powershell this now works, however when generating though Azure pipelines it looks like its missing all the unity behaviour and just shows Object as a base class skipping all the unity stuff.

Edit: So it looks like its not generating the correct links, if i pull the site into git and try to upload the full script the difference is

image

looking though the pipeline output i get a lot of the following warning:

[20-03-27 11:02:59.034]Warning:MetadataCommand.ExtractMetadataWorkspace failed with: [Failure] Msbuild failed when processing the file 'D:\a\1\s\LiteDb.Custom.csproj' with message: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets: (2110, 5): There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "mscorlib", "AMD64". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.

dont know if this would be what is causing the issue/what the solution would be

NormandErwan commented 4 years ago

Hi, thank you for opening the issue!

The first problem you have is the same as #3. I'm near to fix it. The generation of the Xref maps of the Unity API is almost good (can be found here). It's very long to generate them therefore I'm putting this program to a GitHub CI in order to generate them every week and push them on GitHub Pages. Thus they will be available for everyone to use. You won't have to generate them again as you did on your second message.

The second problem you have is the second purpose of the small generating program above: fix the generated links of the xref maps to point to the Unity API. It's almost working, some links are not perfectly handled, but I'm going to fix that too.

For your third problem (the warnings), I have no idea. I think it's related to DocFX. You could ask them by openning an issue on their repo?

I will keep you informed when the xref maps of the Unity API will be online.

NormandErwan commented 4 years ago

I fixed #3, you can use the xref maps of the Unity API I generated.

On your docfx.json:

{
    ...
    "build": {
        ...
        "xref": [ "https://normanderwan.github.io/DocFxForUnity/Unity/xrefmap.yml" ],
        ...
    }
}

If you want a specific version of the Unity API, use instead: https://normanderwan.github.io/DocFxForUnity/Unity/<version>/xrefmap.yml where <version> is a Unity version in the form of YYYY.x (e.g. 2017.4, 2018.4 or 2019.3).

UnityCreativeDesign commented 4 years ago

Thanks very much for the help, will run a generation later today and double check all the results, will go to docfx as well for the warning thats popping up.

UnityCreativeDesign commented 4 years ago

Hi there I've tried to regenerate it with the above changes, but its still missing out the field links to unity, not sure if i have missed something else though

image

NormandErwan commented 4 years ago

Your setup is good, it's on my side. Thank you for pinpointing the problem! References are missing in the xrefmap.yml

I'm fixing it, I'll keep you informed

NormandErwan commented 4 years ago

Sorry, I forgot to ping you. References should be working now! Could you try and tell me if it's all good on your side?

UnityCreativeDesign commented 4 years ago

Hi there Thanks for letting me know, i ran another cycle and looks like the links were still not generated for myself, was there any other changes i need to run/pull update into the docs folder (i just rerun the setup i had)

NormandErwan commented 3 years ago

I'm closing the issue. Feel free to comment if you still have the problem, I will re-open it.