* Mono.Documentation/monodocer.cs: ".NET support": ensure that we
authorJonathan Pryor <jpryor@novell.com>
Mon, 23 Nov 2009 18:44:11 +0000 (18:44 -0000)
committerJonathan Pryor <jpryor@novell.com>
Mon, 23 Nov 2009 18:44:11 +0000 (18:44 -0000)
  always get Unix line endings so that we can update documentation
  under both Mono & .NET w/o continually changing the file due to
  line-ending differences.

svn path=/trunk/mcs/; revision=146762

mcs/tools/mdoc/ChangeLog
mcs/tools/mdoc/Mono.Documentation/monodocer.cs

index 13a0029b1d97dc364bdbe13e7e392a199dadbff0..182798cda7aa0264d4bba6d41c71b9be2cdded94 100644 (file)
@@ -1,3 +1,10 @@
+2009-11-23  Jonathan Pryor <jpryor@novell.com>
+
+       * Mono.Documentation/monodocer.cs: ".NET support": ensure that we
+         always get Unix line endings so that we can update documentation
+         under both Mono & .NET w/o continually changing the file due to
+         line-ending differences.
+
 2009-11-06  Jonathan Pryor <jpryor@novell.com>
 
        * Mono.Documentation/monodocer.cs: When deleting the ExtensionMethods
index 203debad998d0a2b78694f81ab40d744727c7eb3..86afe17265549b31c28d9acb3352722f29d747e1 100644 (file)
@@ -130,8 +130,11 @@ class MDocUpdater : MDocCommand
                                                        Error ("Unable to read XML file: {0}.", import);
                                        }
                                        if (r.LocalName == "doc") {
+                                               var xml = File.ReadAllText (import);
+                                               // Ensure Unix line endings
+                                               xml = xml.Replace ("\r", "");
                                                slashdocs = new XmlDocument();
-                                               slashdocs.Load (import);
+                                               slashdocs.LoadXml (xml);
                                        }
                                        else if (r.LocalName == "Libraries") {
                                                ecmadocs = new XmlTextReader (import);
@@ -774,10 +777,12 @@ class MDocUpdater : MDocCommand
 
        private static TextWriter OpenWrite (string path, FileMode mode)
        {
-               return new StreamWriter (
+               var w = new StreamWriter (
                        new FileStream (path, mode),
                        new UTF8Encoding (false)
                );
+               w.NewLine = "\n";
+               return w;
        }
 
        private string[] GetAssemblyVersions ()