* Mono.Documentation/monodocer.cs: When deleting the ExtensionMethods
[mono.git] / mcs / tools / mdoc / Mono.Documentation / monodocs2html.cs
index 3838f80c218f18ab8a7aa77ffa909ac766941427..0426cebe74900e3acc702f0837d1a8b4e88bf3ae 100644 (file)
@@ -25,11 +25,23 @@ class MDocToHtmlConverterOptions {
        public string template;
        public bool   dumptemplate;
        public bool   forceUpdate;
-       public List<string> versions = new List<string> ();
+       public HashSet<string> versions = new HashSet<string> ();
 }
 
 class MDocToHtmlConverter : MDocCommand {
 
+       static Dictionary<string, string[]> profiles = new Dictionary<string, string[]>() {
+               //                      FxVersions-----                   VsVersions-----
+               { "monotouch",    new[]{"0.0.0.0", "2.0.5.0"              } },
+               { "net_1_0",      new[]{"1.0.3300.0",                     "7.0.3300.0"} },
+               { "net_1_1",      new[]{"1.0.5000.0",                     "7.0.5000.0"} },
+               { "net_2_0",      new[]{"2.0.0.0",                        "8.0.0.0"} },
+               { "net_3_0",      new[]{"2.0.0.0", "3.0.0.0",             "8.0.0.0"} },
+               { "net_3_5",      new[]{"2.0.0.0", "3.0.0.0", "3.5.0.0",  "8.0.0.0"} },
+               { "net_4_0",      new[]{"4.0.0.0"                         } },
+               { "silverlight",  new[]{"2.0.5.0",                        "9.0.0.0"} },
+       };
+
        public override void Run (IEnumerable<string> args)
        {
                opts = new MDocToHtmlConverterOptions ();
@@ -51,11 +63,22 @@ class MDocToHtmlConverter : MDocCommand {
                                v => opts.dest = v },
                        { "template=",
                                "An XSLT {FILE} to use to generate the created " + 
-                                       "files.  If not specified, uses the template generated by " + 
+                                       "files.If not specified, uses the template generated by " + 
                                        "--default-template.",
                                v => opts.template = v },
+                       { "with-profile=",
+                               "The .NET {PROFILE} to generate documentation for.  This is " + 
+                                       "equivalent to using --with-version for all of the " +
+                                       "versions that a profile uses.  Valid profiles are:\n  " +
+                                       string.Join ("\n  ", profiles.Keys.OrderBy (v => v).ToArray ()),
+                               v => {
+                                       if (!profiles.ContainsKey (v))
+                                               throw new ArgumentException (string.Format ("Unsupported profile '{0}'.", v));
+                                       foreach (var ver in profiles [v.ToLowerInvariant ()])
+                                               opts.versions.Add (ver);
+                               } },
                        { "with-version=",
-                               "The assembly VERSION to generate documentation for.  This allows " + 
+                               "The assembly {VERSION} to generate documentation for.  This allows " + 
                                        "display of a subset of types/members that correspond to the given " +
                                        "assembly version.  May be specified multiple times.  " + 
                                        "If not specified, all versions are displayed.",