[monodoc/osx] Look for docs in additional directories.
authorJonathan Pryor <jonpryor@vt.edu>
Tue, 11 Jan 2011 01:54:43 +0000 (20:54 -0500)
committerJonathan Pryor <jonpryor@vt.edu>
Tue, 11 Jan 2011 01:54:43 +0000 (20:54 -0500)
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.

mcs/tools/monodoc/Monodoc/provider.cs

index d54a60c009f6b3f168b3c3fd2082aa85b91294d1..c2cee5592224a25433ccb313bd2b4a1067fda383 100644 (file)
@@ -881,9 +881,14 @@ public class RootTree : Tree {
                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));
        }