|
5 | 5 | using System.Globalization; |
6 | 6 | using System.IO; |
7 | 7 | using System.Linq; |
| 8 | +using System.Runtime.InteropServices; |
8 | 9 | using System.Text; |
9 | 10 | using System.Xml; |
10 | 11 | using System.Xml.Linq; |
|
16 | 17 | using Mono.Documentation.Updater.Statistics; |
17 | 18 | using Mono.Documentation.Util; |
18 | 19 | using Mono.Options; |
19 | | - |
| 20 | +using SchwabenCode.QuickIO; |
20 | 21 | using MyXmlNodeList = System.Collections.Generic.List<System.Xml.XmlNode>; |
21 | 22 | using StringList = System.Collections.Generic.List<string>; |
22 | 23 | using StringToXmlNodeMap = System.Collections.Generic.Dictionary<string, System.Xml.XmlNode>; |
@@ -692,8 +693,8 @@ private static void WriteNamespaceStub (string ns, string outdir) |
692 | 693 | index_remarks.InnerText = "To be added."; |
693 | 694 | index_docs.AppendChild (index_remarks); |
694 | 695 |
|
695 | | - WriteFile (outdir + "/ns-" + ns + ".xml", FileMode.CreateNew, |
696 | | - writer => WriteXml (index.DocumentElement, writer)); |
| 696 | + var nsDocPath = DocUtils.PathCombine(outdir, $"ns-{ns}.xml"); |
| 697 | + WriteFile (nsDocPath, FileMode.CreateNew, writer => WriteXml (index.DocumentElement, writer)); |
697 | 698 | } |
698 | 699 |
|
699 | 700 | public void DoUpdateTypes (string basepath, List<string> typenames, string dest) |
@@ -1039,7 +1040,7 @@ private void AddIndexType (TypeDefinition type, XmlElement index_types) |
1039 | 1040 |
|
1040 | 1041 | private void DoUpdateAssemblies (string source, string dest) |
1041 | 1042 | { |
1042 | | - string indexfile = dest + "/index.xml"; |
| 1043 | + string indexfile = DocUtils.PathCombine(dest, "index.xml"); |
1043 | 1044 | XmlDocument index; |
1044 | 1045 | if (System.IO.File.Exists (indexfile)) |
1045 | 1046 | { |
@@ -1417,10 +1418,8 @@ private void CleanupFiles (string dest, HashSet<string> goodfiles) |
1417 | 1418 |
|
1418 | 1419 | private static TextWriter OpenWrite (string path, FileMode mode) |
1419 | 1420 | { |
1420 | | - var w = new StreamWriter ( |
1421 | | - new FileStream (path, mode), |
1422 | | - new UTF8Encoding (false) |
1423 | | - ); |
| 1421 | + var fs = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? QuickIOFile.Open(Path.GetFullPath(path), mode) : new FileStream(path, mode); |
| 1422 | + var w = new StreamWriter (fs, new UTF8Encoding (false)); |
1424 | 1423 | w.NewLine = "\n"; |
1425 | 1424 | return w; |
1426 | 1425 | } |
@@ -4176,6 +4175,19 @@ private void MakeTypeParameters (FrameworkTypeEntry entry, XmlElement root, ILis |
4176 | 4175 | } |
4177 | 4176 | } |
4178 | 4177 | } |
| 4178 | + |
| 4179 | + nodes = e.SelectNodes("TypeParameter").Cast<XmlElement>().ToArray(); |
| 4180 | + if (nodes.Length != typeParams.Count) |
| 4181 | + { |
| 4182 | + foreach (var node in nodes) |
| 4183 | + { |
| 4184 | + var existing = typeParams.FirstOrDefault(x => x.Name == node.GetAttribute("Name")); |
| 4185 | + if (existing == null) |
| 4186 | + { |
| 4187 | + node.ParentNode.RemoveChild(node); |
| 4188 | + } |
| 4189 | + } |
| 4190 | + } |
4179 | 4191 | } |
4180 | 4192 |
|
4181 | 4193 | private void MakeParameters (XmlElement root, MemberReference mi, FrameworkTypeEntry typeEntry, ref bool fxAlternateTriggered, bool shouldDuplicateWithNew) |
|
0 commit comments