api-doc-tools icon indicating copy to clipboard operation
api-doc-tools copied to clipboard

Add a MonoDoc nuget package

Open mhutch opened this issue 7 years ago • 13 comments

Fixes #228

mhutch avatar May 02 '18 19:05 mhutch

Does this fix https://github.com/mono/api-doc-tools/issues/227 ?

Otherwise, it won't work

Therzok avatar May 04 '18 07:05 Therzok

No, it doesn't

mhutch avatar May 04 '18 15:05 mhutch

@joelmartinez I added a bunch of comments :)

mhutch avatar May 25 '18 21:05 mhutch

Currently failing with

 /usr/local/share/dotnet/sdk/2.1.200/Sdks/NuGet.Build.Tasks.Pack/build/NuGet.Build.Tasks.Pack.targets(198,5): warning : A stable release of a package should not have a prerelease dependency. Either modify the version spec of dependency "SharpZipLib [1.0.0-alpha2, )" or update the version field in the nuspec. [/Users/builder/jenkins/workspace/Docs-MonoApiDocTools/monodoc/monodoc.csproj]

mhutch avatar May 25 '18 21:05 mhutch

Ok, I took a look at this, and it seems like the newer version of nunit changed something about the way paths are resolved (maybe the default working directory, or something) ... so as a result, a bunch of tests that have to load some assemblies are failing.

I played around and got some of them passing by making this one change:

diff --git a/mdoc/mdoc.Test/BasicTests.cs b/mdoc/mdoc.Test/BasicTests.cs
index cddbcbd..ef136aa 100644
--- a/mdoc/mdoc.Test/BasicTests.cs
+++ b/mdoc/mdoc.Test/BasicTests.cs
@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.IO;
 using Mono.Cecil;
 
 namespace mdoc.Test
@@ -18,7 +19,10 @@ namespace mdoc.Test
 
             if (!moduleCash.ContainsKey(filepath))
             {
-                var readModule = ModuleDefinition.ReadModule(filepath);
+                var testAssemblyFilename = this.GetType ().Assembly.Modules.First().FullyQualifiedName;
+                var testDirectory = Path.GetDirectoryName (testAssemblyFilename);
+                var assemblyToOpenPath = Path.Combine (testDirectory, filepath);
+                var readModule = ModuleDefinition.ReadModule(assemblyToOpenPath);
                 moduleCash.Add(filepath, readModule);
             }

But there are still some other tests failing ... I've got to focus on putting a release together, so I'm probably not going to be able to look at this for another two weeks or so (given upcoming travel, etc).

Is there a way that maybe the scope of changes could be scaled back a bit? I fully understand and agree that SDK style projects are much nicer, but maybe that should be a standalone change/upgrade from the monodoc nuget? same for some of the other changes in this PR ...

joelmartinez avatar May 29 '18 20:05 joelmartinez

@joelmartinez the reason I migrated to SDK style projects was specifically because it makes it much easier to define/build the nuget packages though. I can't really separate them.

mhutch avatar May 29 '18 20:05 mhutch

@mhutch ok, fair enough ... then could it perhaps be decoupled from upgrading nunit (assuming that was the change that otherwise broke the unit tests)?

joelmartinez avatar May 29 '18 20:05 joelmartinez

@joelmartinez unfortunately nunit 2.6.4 doesn't support netstandard... :(

mhutch avatar May 29 '18 21:05 mhutch

@mhutch gotcha ... ok, I'll try to keep working on getting the unit tests passing here, but as I mentioned above, this will probably land after I'm able to get 5.7 out (ie. in a few weeks) :)

joelmartinez avatar May 29 '18 21:05 joelmartinez

fair enough!

mhutch avatar May 29 '18 22:05 mhutch

Ping: I'm waiting packaged monodoc :) what suspended reason?

kekyo avatar Jul 03 '18 09:07 kekyo

@kekyo It is on my agenda to revisit this soon ... no specific ETA, but it's definitely on the agenda. The PR needs some changes to ensure the unit tests still pass, not to mention some recent master changes that will have to be carefully merged

joelmartinez avatar Jul 03 '18 15:07 joelmartinez

I'm going to be breaking out some of these changes into separate/individual commits ... starting with updating to the latest nunit. This way I can make sure that all the unit tests continue passing as we subsequently move to SDK style projects, etc

joelmartinez avatar Jul 09 '18 19:07 joelmartinez