Skip to content

Commit 8e3baf9

Browse files
committed
(#3591) Remove no7zip build tasks
This commit removes the no longer required no7zip build tasks, and also the associated sln and csproj entries. Previously, it was necessary to build a version of choco.exe that didn't include the 7zip binaries, however, this version of Chocolatey CLI is no longer required. To simplify the overall build process, and also the release steps required, the decision was taken to completely remove the no7zip build.
1 parent c2636fb commit 8e3baf9

File tree

8 files changed

+4
-298
lines changed

8 files changed

+4
-298
lines changed

recipe.cake

Lines changed: 1 addition & 170 deletions
Original file line numberDiff line numberDiff line change
@@ -58,32 +58,6 @@ Func<List<ILMergeConfig>> getILMergeConfigs = () =>
5858
PrimaryAssemblyName = BuildParameters.Paths.Directories.PublishedLibraries + "/chocolatey/chocolatey.dll",
5959
AssemblyPaths = assembliesToILMerge });
6060

61-
if (DirectoryExists(BuildParameters.Paths.Directories.PublishedApplications + "/choco-no7zip/"))
62-
{
63-
var no7zAssembliesToILMerge = GetFiles(BuildParameters.Paths.Directories.PublishedApplications + "/choco-no7zip/*.{exe|dll}")
64-
- GetFiles(BuildParameters.Paths.Directories.PublishedApplications + "/choco-no7zip/choco.exe")
65-
- GetFiles(BuildParameters.Paths.Directories.PublishedApplications + "/choco-no7zip/System.Management.Automation.dll")
66-
- GetFiles(BuildParameters.Paths.Directories.PublishedApplications + "/choco-no7zip/chocolatey.tests*.dll")
67-
- GetFiles(BuildParameters.Paths.Directories.PublishedApplications + "/choco-no7zip/{Moq|nunit|Should|testcentric}*.dll")
68-
- GetFiles(BuildParameters.Paths.Directories.PublishedApplications + "/choco-no7zip/Chocolatey.PowerShell.dll");
69-
70-
Information("The following assemblies have been selected to be ILMerged for choco.exe No7zip Version...");
71-
foreach (var assemblyToILMerge in no7zAssembliesToILMerge)
72-
{
73-
Information(assemblyToILMerge.FullPath);
74-
}
75-
76-
mergeConfigs.Add(new ILMergeConfig() {
77-
KeyFile = BuildParameters.StrongNameKeyPath,
78-
LogFile = BuildParameters.Paths.Directories.Build + "/ilmerge-chocono7zipexe.log",
79-
TargetPlatform = targetPlatform,
80-
Target = "exe",
81-
Internalize = BuildParameters.RootDirectoryPath + "/src/chocolatey.console/ilmerge.internalize.ignore.txt",
82-
Output = BuildParameters.Paths.Directories.PublishedApplications + "/choco-no7zip_merged/choco.exe",
83-
PrimaryAssemblyName = BuildParameters.Paths.Directories.PublishedApplications + "/choco-no7zip/choco.exe",
84-
AssemblyPaths = no7zAssembliesToILMerge });
85-
}
86-
8761
return mergeConfigs;
8862
};
8963

@@ -93,11 +67,6 @@ Func<FilePathCollection> getScriptsToVerify = () =>
9367
GetFiles(BuildParameters.Paths.Directories.NuGetNuspecDirectory + "/**/*.{ps1|psm1|psd1}") +
9468
GetFiles(BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "/**/*.{ps1|psm1|psd1}");
9569

96-
if (DirectoryExists(BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "-no7zip"))
97-
{
98-
scriptsToVerify += GetFiles(BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "-no7zip/**/*.{ps1|psm1|psd1}");
99-
}
100-
10170
Information("The following PowerShell scripts have been selected to be verified...");
10271
foreach (var scriptToVerify in scriptsToVerify)
10372
{
@@ -129,14 +98,6 @@ Func<FilePathCollection> getFilesToSign = () =>
12998
+ GetFiles(BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "/tools/chocolateyInstall/redirects/*.exe")
13099
+ GetFiles(BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "/tools/chocolateyInstall/helpers/Chocolatey.PowerShell.dll");
131100

132-
if (DirectoryExists(BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "-no7zip"))
133-
{
134-
filesToSign += GetFiles(BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "-no7zip/tools/chocolateyInstall/choco.exe")
135-
+ GetFiles(BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "-no7zip/tools/chocolateyInstall/tools/{checksum|shimgen}.exe")
136-
+ GetFiles(BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "-no7zip/tools/chocolateyInstall/redirects/*.exe")
137-
+ GetFiles(BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "-no7zip/tools/chocolateyInstall/helpers/Chocolatey.PowerShell.dll");
138-
}
139-
140101
Information("The following assemblies have been selected to be signed...");
141102
foreach (var fileToSign in filesToSign)
142103
{
@@ -215,136 +176,6 @@ Task("Prepare-Chocolatey-Packages")
215176
}
216177
});
217178

218-
Task("Build-ChocolateyNo7zip")
219-
.WithCriteria(() => BuildParameters.Configuration == "ReleaseOfficial", "Skipping No7zip because this isn't an official release")
220-
.IsDependentOn("Build")
221-
.IsDependentOn("Test")
222-
.IsDependeeOf("Run-ILMerge")
223-
.Does<BuildData>(data => RequireTool(ToolSettings.MSBuildExtensionPackTool, () =>
224-
{
225-
Information("Building {0} with No7zip", BuildParameters.SolutionFilePath);
226-
227-
CleanDirectory(BuildParameters.Paths.Directories.PublishedApplications + "/choco-no7zip/");
228-
229-
var no7zLogPath = BuildParameters.Paths.Files.BuildLogFilePath.ToString().Replace("\\.(\\S+)$", "-no7zip.${1}");
230-
231-
if (BuildParameters.BuildAgentOperatingSystem == PlatformFamily.Windows)
232-
{
233-
var msbuildSettings = new MSBuildSettings()
234-
{
235-
ToolPath = ToolSettings.MSBuildToolPath
236-
}
237-
.SetPlatformTarget(ToolSettings.BuildPlatformTarget)
238-
.UseToolVersion(ToolSettings.BuildMSBuildToolVersion)
239-
.WithProperty("OutputPath", MakeAbsolute(new DirectoryPath(BuildParameters.Paths.Directories.PublishedApplications + "/choco-no7zip/")).FullPath)
240-
.WithProperty("TreatWarningsAsErrors", BuildParameters.TreatWarningsAsErrors.ToString())
241-
.WithTarget("Build")
242-
.SetMaxCpuCount(ToolSettings.MaxCpuCount)
243-
.SetConfiguration("ReleaseOfficialNo7zip")
244-
.WithLogger(
245-
Context.Tools.Resolve("MSBuild.ExtensionPack.Loggers.dll").FullPath,
246-
"XmlFileLogger",
247-
string.Format(
248-
"logfile=\"{0}\";invalidCharReplacement=_;verbosity=Detailed;encoding=UTF-8",
249-
no7zLogPath
250-
)
251-
);
252-
253-
MSBuild(BuildParameters.SolutionFilePath, msbuildSettings);
254-
}
255-
256-
if (FileExists(no7zLogPath))
257-
{
258-
BuildParameters.BuildProvider.UploadArtifact(no7zLogPath);
259-
}
260-
}));
261-
262-
Task("Prepare-ChocolateyNo7zip-Package")
263-
.WithCriteria(() => BuildParameters.Configuration == "ReleaseOfficial", "Skipping No7zip because this isn't an official release")
264-
.WithCriteria(() => BuildParameters.BuildAgentOperatingSystem == PlatformFamily.Windows, "Skipping because not running on Windows")
265-
.WithCriteria(() => BuildParameters.ShouldRunChocolatey, "Skipping because execution of Chocolatey has been disabled")
266-
.IsDependentOn("Build-ChocolateyNo7zip")
267-
.IsDependeeOf("Sign-Assemblies")
268-
.IsDependeeOf("Verify-PowerShellScripts")
269-
.IsDependeeOf("Create-ChocolateyNo7zip-Package")
270-
.Does(() =>
271-
{
272-
var nuspecDirectory = BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "-no7zip";
273-
// Copy the Nuget/Chocolatey directory from Root Folder to temp/nuspec/chocolatey-no7zip
274-
EnsureDirectoryExists(nuspecDirectory);
275-
CopyFiles(GetFiles("./nuspec/chocolatey/**/*"), nuspecDirectory, true);
276-
277-
// Copy legal documents
278-
CopyFile(BuildParameters.RootDirectoryPath + "/docs/legal/CREDITS.md", nuspecDirectory + "/tools/chocolateyInstall/CREDITS.txt");
279-
CopyFile(BuildParameters.Paths.Directories.PublishedApplications + "/choco-no7zip/LICENSE.txt", nuspecDirectory + "/tools/chocolateyInstall/LICENSE.txt");
280-
281-
// Copy choco.exe.manifest
282-
CopyFile(BuildParameters.Paths.Directories.PublishedApplications + "/choco-no7zip/choco.exe.manifest", nuspecDirectory + "/tools/chocolateyInstall/choco.exe.manifest");
283-
284-
// Copy external file resources
285-
EnsureDirectoryExists(nuspecDirectory + "/tools/chocolateyInstall/helpers");
286-
CopyFiles(GetFiles(BuildParameters.Paths.Directories.PublishedApplications + "/choco-no7zip/helpers/**/*"), nuspecDirectory + "/tools/chocolateyInstall/helpers", true);
287-
EnsureDirectoryExists(nuspecDirectory + "/tools/chocolateyInstall/redirects");
288-
CopyFiles(GetFiles(BuildParameters.Paths.Directories.PublishedApplications + "/choco-no7zip/redirects/**/*"), nuspecDirectory + "/tools/chocolateyInstall/redirects", true);
289-
EnsureDirectoryExists(nuspecDirectory + "/tools/chocolateyInstall/tools");
290-
CopyFiles(GetFiles(BuildParameters.Paths.Directories.PublishedApplications + "/choco-no7zip/tools/**/*"), nuspecDirectory + "/tools/chocolateyInstall/tools", true);
291-
292-
// Copy merged choco.exe
293-
CopyFile(BuildParameters.Paths.Directories.PublishedApplications + "/choco-no7zip_merged/choco.exe", nuspecDirectory + "/tools/chocolateyInstall/choco.exe");
294-
295-
// Copy Chocolatey.PowerShell.dll and help.xml file
296-
CopyFile(BuildParameters.Paths.Directories.PublishedLibraries + "/Chocolatey.PowerShell/Chocolatey.PowerShell.dll", nuspecDirectory + "/tools/chocolateyInstall/helpers/Chocolatey.PowerShell.dll");
297-
CopyFile(BuildParameters.Paths.Directories.PublishedLibraries + "/Chocolatey.PowerShell/Chocolatey.PowerShell.dll-help.xml", nuspecDirectory + "/tools/chocolateyInstall/helpers/Chocolatey.PowerShell.dll-help.xml");
298-
299-
// Tidy up logs and config folder which are not required
300-
var logsDirectory = nuspecDirectory + "/tools/chocolateyInstall/logs";
301-
var configDirectory = nuspecDirectory + "/tools/chocolateyInstall/config";
302-
303-
if (DirectoryExists(logsDirectory))
304-
{
305-
DeleteDirectory(logsDirectory, new DeleteDirectorySettings {
306-
Recursive = true,
307-
Force = true
308-
});
309-
}
310-
311-
if (DirectoryExists(configDirectory))
312-
{
313-
DeleteDirectory(configDirectory, new DeleteDirectorySettings {
314-
Recursive = true,
315-
Force = true
316-
});
317-
}
318-
});
319-
320-
Task("Create-ChocolateyNo7zip-Package")
321-
.WithCriteria(() => BuildParameters.Configuration == "ReleaseOfficial", "Skipping No7zip because this isn't an official release")
322-
.WithCriteria(() => BuildParameters.ShouldRunChocolatey, "Skipping because execution of Chocolatey has been disabled")
323-
.WithCriteria(() => BuildParameters.BuildAgentOperatingSystem == PlatformFamily.Windows, "Skipping because not running on Windows")
324-
.IsDependentOn("Prepare-ChocolateyNo7zip-Package")
325-
.IsDependeeOf("Package")
326-
.Does(() =>
327-
{
328-
var nuspecDirectory = BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "-no7zip/";
329-
var nuspecFile = nuspecDirectory + "chocolatey.nuspec";
330-
331-
ChocolateyPack(nuspecFile, new ChocolateyPackSettings {
332-
AllowUnofficial = true,
333-
Version = BuildParameters.Version.PackageVersion,
334-
OutputDirectory = nuspecDirectory,
335-
WorkingDirectory = BuildParameters.Paths.Directories.PublishedApplications
336-
});
337-
338-
MoveFile(
339-
nuspecDirectory + "chocolatey." + BuildParameters.Version.PackageVersion + ".nupkg",
340-
BuildParameters.Paths.Directories.ChocolateyPackages + "/chocolatey-no7zip." + BuildParameters.Version.PackageVersion + ".nupkg"
341-
);
342-
343-
// Due to the fact that we have chosen to ignore the no7zip package via the chocolateyNupkgGlobbingPattern, it will
344-
// no longer be automatically uploaded via Chocolatey.Cake.Recipe, so we need to handle that work here.
345-
BuildParameters.BuildProvider.UploadArtifact(BuildParameters.Paths.Directories.ChocolateyPackages + "/chocolatey-no7zip." + BuildParameters.Version.PackageVersion + ".nupkg");
346-
});
347-
348179
Task("Prepare-NuGet-Packages")
349180
.WithCriteria(() => BuildParameters.ShouldRunNuGet, "Skipping because execution of NuGet has been disabled")
350181
.IsDependeeOf("Create-NuGet-Packages")
@@ -441,7 +272,7 @@ BuildParameters.SetParameters(context: Context,
441272
shouldRunNuGet: IsRunningOnWindows(),
442273
shouldAuthenticodeSignPowerShellScripts: IsRunningOnWindows(),
443274
shouldPublishAwsLambdas: false,
444-
chocolateyNupkgGlobbingPattern: "/**/chocolatey[!-no7zip]*.nupkg");
275+
chocolateyNupkgGlobbingPattern: "/**/chocolatey*.nupkg");
445276

446277
ToolSettings.SetToolSettings(context: Context);
447278

src/Chocolatey.PowerShell/Chocolatey.PowerShell.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<ErrorReport>prompt</ErrorReport>
3232
<WarningLevel>4</WarningLevel>
3333
</PropertyGroup>
34-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseOfficial|AnyCPU' or '$(Configuration)|$(Platform)' == 'ReleaseOfficialNo7zip|AnyCPU'">
34+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseOfficial|AnyCPU'">
3535
<DebugSymbols>true</DebugSymbols>
3636
<OutputPath>bin\ReleaseOfficial\</OutputPath>
3737
<DefineConstants>TRACE;FORCE_CHOCOLATEY_OFFICIAL_KEY</DefineConstants>

src/chocolatey.console/chocolatey.console.csproj

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -130,26 +130,6 @@
130130
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
131131
<Prefer32Bit>false</Prefer32Bit>
132132
</PropertyGroup>
133-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseOfficialNo7zip|x86'">
134-
<OutputPath>bin\x86\ReleaseOfficialNo7zip\</OutputPath>
135-
<DefineConstants>TRACE;FORCE_CHOCOLATEY_OFFICIAL_KEY</DefineConstants>
136-
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
137-
<Optimize>true</Optimize>
138-
<PlatformTarget>x86</PlatformTarget>
139-
<ErrorReport>prompt</ErrorReport>
140-
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
141-
</PropertyGroup>
142-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseOfficialNo7zip|AnyCPU'">
143-
<OutputPath>bin\ReleaseOfficialNo7zip\</OutputPath>
144-
<DefineConstants>TRACE;FORCE_CHOCOLATEY_OFFICIAL_KEY</DefineConstants>
145-
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
146-
<Optimize>true</Optimize>
147-
<PlatformTarget>AnyCPU</PlatformTarget>
148-
<ErrorReport>prompt</ErrorReport>
149-
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
150-
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
151-
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
152-
</PropertyGroup>
153133
<ItemGroup>
154134
<Reference Include="AlphaFS, Version=2.1.0.0, Culture=neutral, PublicKeyToken=4d31a58f7d7ad5c9, processorArchitecture=MSIL">
155135
<SpecificVersion>False</SpecificVersion>

src/chocolatey.resources/chocolatey.resources.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
4444
<Prefer32Bit>false</Prefer32Bit>
4545
</PropertyGroup>
46-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseOfficial|AnyCPU' or '$(Configuration)|$(Platform)' == 'ReleaseOfficialNo7zip|AnyCPU'">
46+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseOfficial|AnyCPU'">
4747
<OutputPath>bin\ReleaseOfficial\</OutputPath>
4848
<DefineConstants>TRACE;FORCE_CHOCOLATEY_OFFICIAL_KEY</DefineConstants>
4949
<Optimize>true</Optimize>
@@ -235,7 +235,7 @@
235235
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
236236
</EmbeddedResource>
237237
</ItemGroup>
238-
<ItemGroup Condition="'$(Configuration)' != 'ReleaseOfficialNo7zip'">
238+
<ItemGroup>
239239
<EmbeddedResource Include="tools\7z.dll">
240240
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
241241
</EmbeddedResource>

0 commit comments

Comments
 (0)