Fixes #663182.
OSX allows multiple framework versions to be installed side-by-side,
and the current version is available through
/Library/Frameworks/Mono.framework/Versions/Current.
However, documentation installed into /L/F/M.f/V/C/lib/monodoc/sources
is specific for that Mono version; upgrade Mono.framework, and the
documentation is "lost," not visible to the newly installed version.
To fix this, we're creating an *unversioned* directory to contain
documentation, which will thus be persistent across Mono.framework
upgrades: /Library/Frameworks/Mono.framework/External/monodoc
This will allow Mono.framework to be upgraded without "losing" the
documentation visible within monodoc.
string layout = Path.Combine (basedir, "monodoc.xml");
doc.Load (layout);
+ string osxExternalDir = "/Library/Frameworks/Mono.framework/External/monodoc";
+ string[] osxExternalSources = Directory.Exists (osxExternalDir)
+ ? Directory.GetFiles (osxExternalDir, "*.source")
+ : new string[0];
+
return LoadTree (basedir, doc,
- Directory.GetFiles (Path.Combine (basedir, "sources"))
- .Where (file => file.EndsWith (".source")));
+ Directory.GetFiles (Path.Combine (basedir, "sources"), "*.source")
+ .Concat (osxExternalSources));
}