Skip to content

Commit 9b7ebf7

Browse files
committed
[Setup] Move ReleasePackagingTool to its own solution.
- Removed unused code in ReleasePackagingTool. - Chocolatey package now imports the documentation files from the same folder where the binaries files are.
1 parent 94ae678 commit 9b7ebf7

File tree

7 files changed

+40
-104
lines changed

7 files changed

+40
-104
lines changed

msvs/RedisServer.sln

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 2013
4-
VisualStudioVersion = 12.0.21005.1
4+
VisualStudioVersion = 12.0.31101.0
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RedisServer", "RedisServer.vcxproj", "{46842776-68A5-EC98-6A09-1859BBFC73AA}"
77
ProjectSection(ProjectDependencies) = postProject
@@ -33,15 +33,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lua", "lua\lua\lua.vcxproj"
3333
EndProject
3434
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Win32_Interop", "..\src\Win32_Interop\Win32_Interop.vcxproj", "{8C07F811-C81C-432C-B334-1AE6FAECF951}"
3535
EndProject
36-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReleasePackagingTool", "ReleasePackagingTool\ReleasePackagingTool.csproj", "{74A69E5D-6540-43CC-9975-20989BF19EB0}"
37-
ProjectSection(ProjectDependencies) = postProject
38-
{46842776-68A5-EC98-6A09-1859BBFC73AA} = {46842776-68A5-EC98-6A09-1859BBFC73AA}
39-
{392BBB91-3934-4A56-AF42-65C5728311E8} = {392BBB91-3934-4A56-AF42-65C5728311E8}
40-
{52193A97-D010-41D6-BF2B-33E8E764E308} = {52193A97-D010-41D6-BF2B-33E8E764E308}
41-
{B00D4BB5-44DE-405E-839C-D16F547006CF} = {B00D4BB5-44DE-405E-839C-D16F547006CF}
42-
{A65C2CD6-72A3-441A-AEA3-D754BEA9A86A} = {A65C2CD6-72A3-441A-AEA3-D754BEA9A86A}
43-
EndProjectSection
44-
EndProject
4536
Global
4637
GlobalSection(SolutionConfigurationPlatforms) = preSolution
4738
Debug|Mixed Platforms = Debug|Mixed Platforms
@@ -182,17 +173,6 @@ Global
182173
{8C07F811-C81C-432C-B334-1AE6FAECF951}.Release|x64.Build.0 = Release|x64
183174
{8C07F811-C81C-432C-B334-1AE6FAECF951}.Release|x86.ActiveCfg = Release|Win32
184175
{8C07F811-C81C-432C-B334-1AE6FAECF951}.Release|x86.Build.0 = Release|Win32
185-
{74A69E5D-6540-43CC-9975-20989BF19EB0}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
186-
{74A69E5D-6540-43CC-9975-20989BF19EB0}.Debug|Win32.ActiveCfg = Debug|x64
187-
{74A69E5D-6540-43CC-9975-20989BF19EB0}.Debug|x64.ActiveCfg = Debug|x64
188-
{74A69E5D-6540-43CC-9975-20989BF19EB0}.Debug|x64.Build.0 = Debug|x64
189-
{74A69E5D-6540-43CC-9975-20989BF19EB0}.Debug|x86.ActiveCfg = Debug|x64
190-
{74A69E5D-6540-43CC-9975-20989BF19EB0}.Release|Mixed Platforms.ActiveCfg = Release|x64
191-
{74A69E5D-6540-43CC-9975-20989BF19EB0}.Release|Mixed Platforms.Build.0 = Release|x64
192-
{74A69E5D-6540-43CC-9975-20989BF19EB0}.Release|Win32.ActiveCfg = Release|x64
193-
{74A69E5D-6540-43CC-9975-20989BF19EB0}.Release|x64.ActiveCfg = Release|x64
194-
{74A69E5D-6540-43CC-9975-20989BF19EB0}.Release|x64.Build.0 = Release|x64
195-
{74A69E5D-6540-43CC-9975-20989BF19EB0}.Release|x86.ActiveCfg = Release|x64
196176
EndGlobalSection
197177
GlobalSection(SolutionProperties) = preSolution
198178
HideSolutionNode = FALSE

msvs/ReleasePackagingTool/Program.cs

Lines changed: 9 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -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))

msvs/ReleasePackagingTool/ReleasePackagingTool.csproj

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<AssemblyName>ReleasePackagingTool</AssemblyName>
1212
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
1313
<FileAlignment>512</FileAlignment>
14+
<IsWebBootstrapper>false</IsWebBootstrapper>
1415
<PublishUrl>publish\</PublishUrl>
1516
<Install>true</Install>
1617
<InstallFrom>Disk</InstallFrom>
@@ -23,7 +24,6 @@
2324
<MapFileExtensions>true</MapFileExtensions>
2425
<ApplicationRevision>0</ApplicationRevision>
2526
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
26-
<IsWebBootstrapper>false</IsWebBootstrapper>
2727
<UseApplicationTrust>false</UseApplicationTrust>
2828
<BootstrapperEnabled>true</BootstrapperEnabled>
2929
</PropertyGroup>
@@ -51,6 +51,9 @@
5151
<PropertyGroup>
5252
<RunPostBuildEvent>Always</RunPostBuildEvent>
5353
</PropertyGroup>
54+
<PropertyGroup>
55+
<StartupObject>ReleasePackagingTool.Program</StartupObject>
56+
</PropertyGroup>
5457
<ItemGroup>
5558
<Reference Include="System" />
5659
<Reference Include="System.Core" />
@@ -88,7 +91,8 @@
8891
</ItemGroup>
8992
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
9093
<PropertyGroup>
91-
<PostBuildEvent>$(TargetPath)</PostBuildEvent>
94+
<PostBuildEvent>
95+
</PostBuildEvent>
9296
</PropertyGroup>
9397
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
9498
Other similar extension points exist, see Microsoft.Common.targets.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 2013
4+
VisualStudioVersion = 12.0.31101.0
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReleasePackagingTool", "ReleasePackagingTool.csproj", "{74A69E5D-6540-43CC-9975-20989BF19EB0}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|x64 = Debug|x64
11+
Release|x64 = Release|x64
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{74A69E5D-6540-43CC-9975-20989BF19EB0}.Debug|x64.ActiveCfg = Debug|x64
15+
{74A69E5D-6540-43CC-9975-20989BF19EB0}.Debug|x64.Build.0 = Debug|x64
16+
{74A69E5D-6540-43CC-9975-20989BF19EB0}.Release|x64.ActiveCfg = Release|x64
17+
{74A69E5D-6540-43CC-9975-20989BF19EB0}.Release|x64.Build.0 = Release|x64
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
EndGlobal

msvs/setups/chocolatey/Redis.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
33
<metadata>
44
<id>redis-64</id>
5-
<title>redis-64</title>
5+
<title>Redis 64</title>
66
<version>2.8.21</version>
77
<authors>Alexis Campailla, Enrico Giordani, Jonathan Pickett</authors>
88
<owners>Microsoft Open Technologies, Inc.</owners>

msvs/setups/chocolatey/template/Redis.nuspec.template

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
33
<metadata>
44
<id>redis-64</id>
5-
<title>redis-64</title>
5+
<title>Redis 64</title>
66
<version>CurrentRedisVersion</version>
77
<authors>Alexis Campailla, Enrico Giordani, Jonathan Pickett</authors>
88
<owners>Microsoft Open Technologies, Inc.</owners>
@@ -18,6 +18,5 @@
1818
</metadata>
1919
<files>
2020
<file src="..\signed_binaries\*.*" target=".\" />
21-
<file src="..\documentation\*.*" target=".\" />
2221
</files>
2322
</package>
Binary file not shown.

0 commit comments

Comments
 (0)