Skip to content

Commit e74bcbd

Browse files
authored
Merge pull request #697 from mono/develop
Fix bug [966887] : FrameworksIndex files not cleaned up (#696)
2 parents 233b49a + bb0706f commit e74bcbd

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

Diff for: mdoc/Consts.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ namespace Mono.Documentation
33
{
44
public static class Consts
55
{
6-
public static string MonoVersion = "5.9.3.1";
6+
public static string MonoVersion = "5.9.3.2";
77
public const string DocId = "DocId";
88
public const string CppCli = "C++ CLI";
99
public const string CppCx = "C++ CX";

Diff for: mdoc/Mono.Documentation/Updater/Frameworks/FrameworkIndex.cs

+18-4
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,12 @@ public void WriteToDisk (string path)
8686
if (string.IsNullOrWhiteSpace (this.path))
8787
return;
8888

89-
string outputPath = Path.Combine (path, Consts.FrameworksIndex);
89+
string outputPath = Path.Combine (path, Consts.FrameworksIndex);
9090

9191
if (!Directory.Exists (outputPath))
9292
Directory.CreateDirectory (outputPath);
9393

94-
foreach (var fx in this.frameworks)
94+
foreach (var fx in this.frameworks)
9595
{
9696
XElement frameworkElement = new XElement("Framework", new XAttribute("Name", fx.Name));
9797
XDocument doc = new XDocument(
@@ -139,6 +139,20 @@ public void WriteToDisk (string path)
139139
doc.WriteTo (writer);
140140
}
141141
}
142-
}
143-
}
142+
CleanupFrameworksIndex(outputPath);
143+
}
144+
145+
private void CleanupFrameworksIndex(string outputPath)
146+
{
147+
var files = Directory.GetFiles(outputPath);
148+
var frameworkNames = frameworks.ToDictionary(item => item.Name, item => item);
149+
foreach (var file in files)
150+
{
151+
if (!frameworkNames.ContainsKey(Path.GetFileNameWithoutExtension(file)))
152+
{
153+
File.Delete(file);
154+
}
155+
}
156+
}
157+
}
144158
}

Diff for: mdoc/mdoc.nuspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package >
33
<metadata>
44
<id>mdoc</id>
5-
<version>5.9.3.1</version>
5+
<version>5.9.3.2</version>
66
<title>mdoc</title>
77
<authors>Microsoft</authors>
88
<owners>Microsoft</owners>

0 commit comments

Comments
 (0)