@@ -28,22 +28,15 @@ static void Main(string[] args)
2828
2929 string version ;
3030 version = p . GetRedisVersion ( ) ;
31- // Starting with the 2.8.21 release the Release Notes file has a new format and it doesn't need to be updated
32- //p.UpdateReleaseNotes(version);
33-
3431 p . UpdateNuSpecFiles ( version ) ;
35-
3632 p . BuildReleasePackage ( version ) ;
3733
38- // Starting with the 2.8.21 release the .md documents are not anymore generated using the .docx files
39- //p.DocxToMd();
40-
4134 Console . Write ( "Release packaging complete." ) ;
4235 Environment . ExitCode = 0 ;
4336 }
4437 catch ( Exception ex )
4538 {
46- Console . WriteLine ( "Error. Failed to finish release packaging. \n " + ex . ToString ( ) ) ;
39+ Console . WriteLine ( "Error. Failed to finish release packaging.\n " + ex . ToString ( ) ) ;
4740 Environment . ExitCode = - 1 ;
4841 }
4942 }
@@ -57,70 +50,6 @@ string GetRedisVersion()
5750 return line . Substring ( start + 1 , last - start - 1 ) ;
5851 }
5952
60- void DocxToMd ( )
61- {
62- // locate converter (pandoc v1.13.0+)
63- string pandocToolPath = Path . Combine ( rootPath , @"msvs\tools\pandoc\pandoc.exe" ) ;
64- if ( File . Exists ( pandocToolPath ) )
65- {
66- var files = Directory . EnumerateFiles ( Path . Combine ( rootPath , @"msvs\setups\documentation" ) , "*.docx" ) ;
67- foreach ( string sourceFile in files )
68- {
69- string fileName = Path . GetFileName ( sourceFile ) ;
70- string destFile = Path . ChangeExtension ( Path . Combine ( rootPath , fileName ) , "md" ) ;
71- System . Diagnostics . Process p = new Process ( ) ;
72- p . StartInfo . FileName = pandocToolPath ;
73- p . StartInfo . UseShellExecute = false ;
74- p . StartInfo . Arguments = string . Format (
75- "-f {0} -t {1} -o \" {2}\" \" {3}\" " ,
76- "docx" ,
77- "markdown_github" ,
78- destFile ,
79- sourceFile ) ;
80- p . Start ( ) ;
81- p . WaitForExit ( ) ;
82- if ( p . ExitCode != 0 )
83- {
84- Console . WriteLine ( "conversion of'{0}' to '{1}' failed." , sourceFile , destFile ) ;
85- }
86- }
87- }
88- else
89- {
90- Console . WriteLine ( "pandoc tool not found. docx-->md conversion will not take place." ) ;
91- }
92- }
93-
94- void UpdateReleaseNotes ( string redisVersion )
95- {
96- string releaseNotesPath = Path . Combine ( rootPath , @"msvs\setups\documentation\Redis on Windows Release Notes.docx" ) ;
97- string templatePath = Path . Combine ( rootPath , @"msvs\setups\documentation\templates\Redis Release Notes Template.docx" ) ;
98-
99- ForceFileErase ( releaseNotesPath ) ;
100- File . Copy ( templatePath , releaseNotesPath ) ;
101-
102- var archive = ZipFile . Open ( releaseNotesPath , ZipArchiveMode . Update ) ;
103-
104- string docuemntContent = @"word/document.xml" ;
105- ZipArchiveEntry entry = archive . GetEntry ( docuemntContent ) ;
106- string updatedContent ;
107- using ( TextReader tr = new StreamReader ( entry . Open ( ) ) )
108- {
109- string documentContent = tr . ReadToEnd ( ) ;
110- updatedContent = documentContent . Replace ( versionReplacementText , redisVersion ) ;
111- }
112- entry . Delete ( ) ;
113- archive . Dispose ( ) ; // forces the file to be written to disk with the documentContent entry deleted
114-
115- archive = System . IO . Compression . ZipFile . Open ( releaseNotesPath , ZipArchiveMode . Update ) ;
116- ZipArchiveEntry updatedEntry = archive . CreateEntry ( docuemntContent , CompressionLevel . Optimal ) ;
117- using ( TextWriter tw = new StreamWriter ( updatedEntry . Open ( ) ) )
118- {
119- tw . Write ( updatedContent ) ;
120- }
121- archive . Dispose ( ) ; // rewrites the file with the updated content
122- }
123-
12453 void ForceFileErase ( string file )
12554 {
12655 if ( File . Exists ( file ) )
@@ -149,12 +78,12 @@ void CreateTextFileFromTemplate(string templatePath, string documentPath, string
14978
15079 void UpdateNuSpecFiles ( string redisVersion )
15180 {
152- string chocTemplate = Path . Combine ( rootPath , @"msvs\setups\chocolatey\template\Redis .nuspec.template" ) ;
153- string chocDocument = Path . Combine ( rootPath , @"msvs\setups\chocolatey\Redis .nuspec" ) ;
81+ string chocTemplate = Path . Combine ( rootPath , @"msvs\setups\chocolatey\template\redis .nuspec.template" ) ;
82+ string chocDocument = Path . Combine ( rootPath , @"msvs\setups\chocolatey\redis .nuspec" ) ;
15483 CreateTextFileFromTemplate ( chocTemplate , chocDocument , versionReplacementText , redisVersion ) ;
15584
156- string nugetTemplate = Path . Combine ( rootPath , @"msvs\setups\nuget\template\Redis .nuspec.template" ) ;
157- string nugetDocument = Path . Combine ( rootPath , @"msvs\setups\nuget\Redis .nuspec" ) ;
85+ string nugetTemplate = Path . Combine ( rootPath , @"msvs\setups\nuget\template\redis .nuspec.template" ) ;
86+ string nugetDocument = Path . Combine ( rootPath , @"msvs\setups\nuget\redis .nuspec" ) ;
15887 CreateTextFileFromTemplate ( nugetTemplate , nugetDocument , versionReplacementText , redisVersion ) ;
15988 }
16089
@@ -177,15 +106,17 @@ void BuildReleasePackage(string version)
177106 "redis-check-dump.exe" ,
178107 "redis-cli.exe" ,
179108 "redis-server.exe" ,
180- "redis-server.pdb"
109+ "redis-server.pdb" ,
110+ "EventLog.dll"
181111 } ;
182112 string documentsRoot = Path . Combine ( rootPath , @"msvs\setups\documentation" ) ;
183113 List < string > docuementNames = new List < string > ( )
184114 {
185115 "Redis on Windows.docx" ,
186116 "Redis on Windows Release Notes.docx" ,
187117 "Windows Service Documentation.docx" ,
188- "redis.windows.conf"
118+ "redis.windows.conf" ,
119+ "redis.windows-service.conf"
189120 } ;
190121
191122 using ( ZipArchive archive = ZipFile . Open ( releasePackagePath , ZipArchiveMode . Create ) )
0 commit comments