@@ -15,8 +15,8 @@ public class DocumentationRunner
1515{
1616 private readonly BuildContext context ;
1717
18- private readonly DirectoryPath changelogDirectory ;
19- private readonly DirectoryPath changelogSrcDirectory ;
18+ public DirectoryPath ChangelogDirectory { get ; }
19+ public DirectoryPath ChangelogSrcDirectory { get ; }
2020 private readonly DirectoryPath changelogDetailsDirectory ;
2121 private readonly DirectoryPath docsGeneratedDirectory ;
2222
@@ -34,19 +34,19 @@ public DocumentationRunner(BuildContext context)
3434 this . context = context ;
3535
3636 var docsDirectory = context . RootDirectory . Combine ( "docs" ) ;
37- changelogDirectory = docsDirectory . Combine ( "changelog" ) ;
38- changelogSrcDirectory = docsDirectory . Combine ( "_changelog" ) ;
39- changelogDetailsDirectory = changelogSrcDirectory . Combine ( "details" ) ;
37+ ChangelogDirectory = docsDirectory . Combine ( "changelog" ) ;
38+ ChangelogSrcDirectory = docsDirectory . Combine ( "_changelog" ) ;
39+ changelogDetailsDirectory = ChangelogSrcDirectory . Combine ( "details" ) ;
4040 docsGeneratedDirectory = docsDirectory . Combine ( "_site" ) ;
4141
4242 redirectFile = docsDirectory . Combine ( "_redirects" ) . CombineWithFilePath ( "_redirects" ) ;
4343 docfxJsonFile = docsDirectory . CombineWithFilePath ( "docfx.json" ) ;
4444 readmeFile = context . RootDirectory . CombineWithFilePath ( "README.md" ) ;
4545 rootIndexFile = docsDirectory . CombineWithFilePath ( "index.md" ) ;
46- changelogIndexFile = changelogDirectory . CombineWithFilePath ( "index.md" ) ;
47- changelogFullFile = changelogDirectory . CombineWithFilePath ( "full.md" ) ;
48- changelogTocFile = changelogDirectory . CombineWithFilePath ( "toc.yml" ) ;
49- lastFooterFile = changelogSrcDirectory . Combine ( "footer" )
46+ changelogIndexFile = ChangelogDirectory . CombineWithFilePath ( "index.md" ) ;
47+ changelogFullFile = ChangelogDirectory . CombineWithFilePath ( "full.md" ) ;
48+ changelogTocFile = ChangelogDirectory . CombineWithFilePath ( "toc.yml" ) ;
49+ lastFooterFile = ChangelogSrcDirectory . Combine ( "footer" )
5050 . CombineWithFilePath ( "v" + context . VersionHistory . CurrentVersion + ".md" ) ;
5151 }
5252
@@ -132,6 +132,10 @@ private void GenerateIndexMd()
132132 private void GenerateChangelogToc ( )
133133 {
134134 var content = new StringBuilder ( ) ;
135+
136+ content . AppendLine ( $ "- name: { context . VersionHistory . CurrentVersion } ") ;
137+ content . AppendLine ( $ " href: { context . VersionHistory . CurrentVersion } .md") ;
138+
135139 foreach ( var version in context . VersionHistory . StableVersions . Reverse ( ) )
136140 {
137141 content . AppendLine ( $ "- name: { version } ") ;
@@ -153,6 +157,8 @@ private void GenerateChangelogFull()
153157 content . AppendLine ( "" ) ;
154158 content . AppendLine ( "# Full ChangeLog" ) ;
155159 content . AppendLine ( "" ) ;
160+ content . AppendLine (
161+ $ "[!include[{ context . VersionHistory . CurrentVersion } ]({ context . VersionHistory . CurrentVersion } .md)]") ;
156162 foreach ( var version in context . VersionHistory . StableVersions . Reverse ( ) )
157163 content . AppendLine ( $ "[!include[{ version } ]({ version } .md)]") ;
158164
@@ -168,6 +174,7 @@ private void GenerateChangelogIndex()
168174 content . AppendLine ( "" ) ;
169175 content . AppendLine ( "# ChangeLog" ) ;
170176 content . AppendLine ( "" ) ;
177+ content . AppendLine ( $ "* @changelog.{ context . VersionHistory . CurrentVersion } ") ;
171178 foreach ( var version in context . VersionHistory . StableVersions . Reverse ( ) )
172179 content . AppendLine ( $ "* @changelog.{ version } ") ;
173180 content . AppendLine ( "* @changelog.full" ) ;
@@ -178,10 +185,10 @@ private void GenerateChangelogIndex()
178185 private void DocfxChangelogGenerate ( string version )
179186 {
180187 EnsureChangelogDetailsExist ( ) ;
181- var header = changelogSrcDirectory . Combine ( "header" ) . CombineWithFilePath ( version + ".md" ) ;
182- var footer = changelogSrcDirectory . Combine ( "footer" ) . CombineWithFilePath ( version + ".md" ) ;
183- var details = changelogSrcDirectory . Combine ( "details" ) . CombineWithFilePath ( version + ".md" ) ;
184- var release = changelogDirectory . CombineWithFilePath ( version + ".md" ) ;
188+ var header = ChangelogSrcDirectory . Combine ( "header" ) . CombineWithFilePath ( version + ".md" ) ;
189+ var footer = ChangelogSrcDirectory . Combine ( "footer" ) . CombineWithFilePath ( version + ".md" ) ;
190+ var details = ChangelogSrcDirectory . Combine ( "details" ) . CombineWithFilePath ( version + ".md" ) ;
191+ var release = ChangelogDirectory . CombineWithFilePath ( version + ".md" ) ;
185192
186193 var content = new StringBuilder ( ) ;
187194 content . AppendLine ( "---" ) ;
@@ -224,7 +231,7 @@ private void EnsureChangelogDetailsExist(bool forceClean = false)
224231 new DeleteDirectorySettings { Force = true , Recursive = true } ) ;
225232
226233 if ( ! context . DirectoryExists ( changelogDetailsDirectory ) )
227- context . Clone ( changelogDetailsDirectory , Repo . HttpsGitUrl , Repo . ChangelogDetailsBranch ) ;
234+ context . GitRunner . Clone ( changelogDetailsDirectory , Repo . HttpsGitUrl , Repo . ChangelogDetailsBranch ) ;
228235 }
229236
230237 private void DocfxChangelogDownload ( string version , string versionPrevious , string lastCommit = "" )
@@ -273,7 +280,7 @@ private void UpdateLastFooter()
273280 var version = context . VersionHistory . CurrentVersion ;
274281 var previousVersion = context . VersionHistory . StableVersions . Last ( ) ;
275282 var date = context . VersionStable
276- ? DateTime . Now . ToString ( "MMMM dd, yyyy" , CultureInfo . InvariantCulture )
283+ ? DateTime . Now . ToString ( "MMMM dd, yyyy" , CultureInfo . InvariantCulture )
277284 : "TBA" ;
278285
279286 var content = new StringBuilder ( ) ;
0 commit comments