Skip to content

Commit 272f9f5

Browse files
authored
Merge pull request #3634 from gep13/issue-3591-support
(#3591) Remove no7zip build tasks
2 parents 6b819ce + c6309c3 commit 272f9f5

File tree

7 files changed

+6
-240
lines changed

7 files changed

+6
-240
lines changed

recipe.cake

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

62-
if (DirectoryExists(BuildParameters.Paths.Directories.PublishedApplications + "/choco-no7zip/"))
63-
{
64-
var no7zAssembliesToILMerge = GetFiles(BuildParameters.Paths.Directories.PublishedApplications + "/choco-no7zip/*.{exe|dll}")
65-
- GetFiles(BuildParameters.Paths.Directories.PublishedApplications + "/choco-no7zip/choco.exe")
66-
- GetFiles(BuildParameters.Paths.Directories.PublishedApplications + "/choco-no7zip/System.Management.Automation.dll")
67-
- GetFiles(BuildParameters.Paths.Directories.PublishedApplications + "/choco-no7zip/chocolatey.tests*.dll")
68-
- GetFiles(BuildParameters.Paths.Directories.PublishedApplications + "/choco-no7zip/{Moq|nunit.framework|Should}.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-
8762
return mergeConfigs;
8863
};
8964

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

96-
if (DirectoryExists(BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "-no7zip"))
97-
{
98-
scriptsToVerify += GetFiles(BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "-no7zip/**/*.{ps1|psm1|psd1}");
99-
}
100-
10171
Information("The following PowerShell scripts have been selected to be verified...");
10272
foreach (var scriptToVerify in scriptsToVerify)
10373
{
@@ -128,13 +98,6 @@ Func<FilePathCollection> getFilesToSign = () =>
12898
+ GetFiles(BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "/tools/chocolateyInstall/tools/{checksum|shimgen}.exe")
12999
+ GetFiles(BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "/tools/chocolateyInstall/redirects/*.exe");
130100

131-
if (DirectoryExists(BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "-no7zip"))
132-
{
133-
filesToSign += GetFiles(BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "-no7zip/tools/chocolateyInstall/choco.exe")
134-
+ GetFiles(BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "-no7zip/tools/chocolateyInstall/tools/{checksum|shimgen}.exe")
135-
+ GetFiles(BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "-no7zip/tools/chocolateyInstall/redirects/*.exe");
136-
}
137-
138101
Information("The following assemblies have been selected to be signed...");
139102
foreach (var fileToSign in filesToSign)
140103
{
@@ -185,122 +148,6 @@ Task("Prepare-Chocolatey-Packages")
185148
}
186149
});
187150

188-
Task("Build-ChocolateyNo7zip")
189-
.WithCriteria(() => BuildParameters.Configuration == "ReleaseOfficial", "Skipping No7zip because this isn't an official release")
190-
.IsDependentOn("Build")
191-
.IsDependentOn("Test")
192-
.IsDependeeOf("Run-ILMerge")
193-
.Does<BuildData>(data => RequireTool(ToolSettings.MSBuildExtensionPackTool, () =>
194-
{
195-
Information("Building {0} with No7zip", BuildParameters.SolutionFilePath);
196-
197-
CleanDirectory(BuildParameters.Paths.Directories.PublishedApplications + "/choco-no7zip/");
198-
199-
var no7zLogPath = BuildParameters.Paths.Files.BuildLogFilePath.ToString().Replace("\\.(\\S+)$", "-no7zip.${1}");
200-
201-
if (BuildParameters.BuildAgentOperatingSystem == PlatformFamily.Windows)
202-
{
203-
var msbuildSettings = new MSBuildSettings
204-
{
205-
ToolPath = ToolSettings.MSBuildToolPath
206-
}
207-
.SetPlatformTarget(ToolSettings.BuildPlatformTarget)
208-
.UseToolVersion(ToolSettings.BuildMSBuildToolVersion)
209-
.WithProperty("OutputPath", MakeAbsolute(new DirectoryPath(BuildParameters.Paths.Directories.PublishedApplications + "/choco-no7zip/")).FullPath)
210-
.WithProperty("TreatWarningsAsErrors", BuildParameters.TreatWarningsAsErrors.ToString())
211-
.WithTarget("Build")
212-
.SetMaxCpuCount(ToolSettings.MaxCpuCount)
213-
.SetConfiguration("ReleaseOfficialNo7zip")
214-
.WithLogger(
215-
Context.Tools.Resolve("MSBuild.ExtensionPack.Loggers.dll").FullPath,
216-
"XmlFileLogger",
217-
string.Format(
218-
"logfile=\"{0}\";invalidCharReplacement=_;verbosity=Detailed;encoding=UTF-8",
219-
no7zLogPath
220-
)
221-
);
222-
223-
MSBuild(BuildParameters.SolutionFilePath, msbuildSettings);
224-
}
225-
226-
if (FileExists(no7zLogPath))
227-
{
228-
BuildParameters.BuildProvider.UploadArtifact(no7zLogPath);
229-
}
230-
}));
231-
232-
Task("Prepare-ChocolateyNo7zip-Package")
233-
.WithCriteria(() => BuildParameters.Configuration == "ReleaseOfficial", "Skipping No7zip because this isn't an official release")
234-
.WithCriteria(() => BuildParameters.BuildAgentOperatingSystem == PlatformFamily.Windows, "Skipping because not running on Windows")
235-
.WithCriteria(() => BuildParameters.ShouldRunChocolatey, "Skipping because execution of Chocolatey has been disabled")
236-
.IsDependentOn("Build-ChocolateyNo7zip")
237-
.IsDependeeOf("Sign-Assemblies")
238-
.IsDependeeOf("Verify-PowerShellScripts")
239-
.IsDependeeOf("Create-ChocolateyNo7zip-Package")
240-
.Does(() =>
241-
{
242-
var nuspecDirectory = BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "-no7zip";
243-
// Copy the Nuget/Chocolatey directory from Root Folder to temp/nuspec/chocolatey-no7zip
244-
EnsureDirectoryExists(nuspecDirectory);
245-
CopyFiles(GetFiles("./nuspec/chocolatey/**/*"), nuspecDirectory, true);
246-
247-
// Copy legal documents
248-
CopyFile(BuildParameters.RootDirectoryPath + "/docs/legal/CREDITS.md", nuspecDirectory + "/tools/chocolateyInstall/CREDITS.txt");
249-
250-
// Run Chocolatey Unpackself
251-
CopyFile(BuildParameters.Paths.Directories.PublishedApplications + "/choco-no7zip_merged/choco.exe", nuspecDirectory + "/tools/chocolateyInstall/choco.exe");
252-
253-
StartProcess(nuspecDirectory + "/tools/chocolateyInstall/choco.exe", new ProcessSettings{ Arguments = "unpackself -f -y --allow-unofficial-build" });
254-
255-
// Tidy up logs and config folder which are not required
256-
var logsDirectory = nuspecDirectory + "/tools/chocolateyInstall/logs";
257-
var configDirectory = nuspecDirectory + "/tools/chocolateyInstall/config";
258-
259-
if (DirectoryExists(logsDirectory))
260-
{
261-
DeleteDirectory(logsDirectory, new DeleteDirectorySettings {
262-
Recursive = true,
263-
Force = true
264-
});
265-
}
266-
267-
if (DirectoryExists(configDirectory))
268-
{
269-
DeleteDirectory(configDirectory, new DeleteDirectorySettings {
270-
Recursive = true,
271-
Force = true
272-
});
273-
}
274-
});
275-
276-
Task("Create-ChocolateyNo7zip-Package")
277-
.WithCriteria(() => BuildParameters.Configuration == "ReleaseOfficial", "Skipping No7zip because this isn't an official release")
278-
.WithCriteria(() => BuildParameters.ShouldRunChocolatey, "Skipping because execution of Chocolatey has been disabled")
279-
.WithCriteria(() => BuildParameters.BuildAgentOperatingSystem == PlatformFamily.Windows, "Skipping because not running on Windows")
280-
.IsDependentOn("Prepare-ChocolateyNo7zip-Package")
281-
.IsDependeeOf("Package")
282-
.Does(() =>
283-
{
284-
var nuspecDirectory = BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "-no7zip/";
285-
var nuspecFile = nuspecDirectory + "chocolatey.nuspec";
286-
287-
ChocolateyPack(nuspecFile, new ChocolateyPackSettings {
288-
AllowUnofficial = true,
289-
Version = BuildParameters.Version.PackageVersion,
290-
OutputDirectory = nuspecDirectory,
291-
WorkingDirectory = BuildParameters.Paths.Directories.PublishedApplications
292-
});
293-
294-
MoveFile(
295-
nuspecDirectory + "chocolatey." + BuildParameters.Version.PackageVersion + ".nupkg",
296-
BuildParameters.Paths.Directories.ChocolateyPackages + "/chocolatey-no7zip." + BuildParameters.Version.PackageVersion + ".nupkg"
297-
);
298-
299-
// Due to the fact that we have chosen to ignore the no7zip package via the chocolateyNupkgGlobbingPattern, it will
300-
// no longer be automatically uploaded via Chocolatey.Cake.Recipe, so we need to handle that work here.
301-
BuildParameters.BuildProvider.UploadArtifact(BuildParameters.Paths.Directories.ChocolateyPackages + "/chocolatey-no7zip." + BuildParameters.Version.PackageVersion + ".nupkg");
302-
});
303-
304151
Task("Prepare-NuGet-Packages")
305152
.WithCriteria(() => BuildParameters.ShouldRunNuGet, "Skipping because execution of NuGet has been disabled")
306153
.IsDependeeOf("Create-NuGet-Packages")
@@ -348,7 +195,7 @@ BuildParameters.SetParameters(context: Context,
348195
shouldRunNuGet: IsRunningOnWindows(),
349196
shouldAuthenticodeSignPowerShellScripts: IsRunningOnWindows(),
350197
shouldPublishAwsLambdas: false,
351-
chocolateyNupkgGlobbingPattern: "/**/chocolatey[!-no7zip]*.nupkg");
198+
chocolateyNupkgGlobbingPattern: "/**/chocolatey*.nupkg");
352199

353200
ToolSettings.SetToolSettings(context: Context,
354201
buildMSBuildToolVersion: MSBuildToolVersion.NET40);

src/chocolatey.console/chocolatey.console.csproj

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -118,26 +118,6 @@
118118
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
119119
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
120120
</PropertyGroup>
121-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseOfficialNo7zip|x86'">
122-
<OutputPath>bin\x86\ReleaseOfficialNo7zip\</OutputPath>
123-
<DefineConstants>TRACE;FORCE_CHOCOLATEY_OFFICIAL_KEY</DefineConstants>
124-
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
125-
<Optimize>true</Optimize>
126-
<PlatformTarget>x86</PlatformTarget>
127-
<ErrorReport>prompt</ErrorReport>
128-
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
129-
</PropertyGroup>
130-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseOfficialNo7zip|AnyCPU'">
131-
<OutputPath>bin\ReleaseOfficialNo7zip\</OutputPath>
132-
<DefineConstants>TRACE;FORCE_CHOCOLATEY_OFFICIAL_KEY</DefineConstants>
133-
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
134-
<Optimize>true</Optimize>
135-
<PlatformTarget>AnyCPU</PlatformTarget>
136-
<ErrorReport>prompt</ErrorReport>
137-
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
138-
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
139-
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
140-
</PropertyGroup>
141121
<ItemGroup>
142122
<Reference Include="AlphaFS, Version=2.1.0.0, Culture=neutral, PublicKeyToken=4d31a58f7d7ad5c9, processorArchitecture=MSIL">
143123
<SpecificVersion>False</SpecificVersion>

src/chocolatey.resources/chocolatey.resources.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<ErrorReport>prompt</ErrorReport>
3939
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
4040
</PropertyGroup>
41-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseOfficial|AnyCPU' or '$(Configuration)|$(Platform)' == 'ReleaseOfficialNo7zip|AnyCPU'">
41+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseOfficial|AnyCPU'">
4242
<OutputPath>bin\ReleaseOfficial\</OutputPath>
4343
<DefineConstants>TRACE;FORCE_CHOCOLATEY_OFFICIAL_KEY</DefineConstants>
4444
<Optimize>true</Optimize>
@@ -104,7 +104,7 @@
104104
<EmbeddedResource Include="redirects\cpush.exe" />
105105
<EmbeddedResource Include="redirects\cuninst.exe" />
106106
<EmbeddedResource Include="redirects\cup.exe" />
107-
<EmbeddedResource Include="tools\7zip.license.txt" Condition="'$(Configuration)' != 'ReleaseOfficialNo7zip'" />
107+
<EmbeddedResource Include="tools\7zip.license.txt" />
108108
<EmbeddedResource Include="tools\checksum.exe" />
109109
<EmbeddedResource Include="tools\checksum.license.txt" />
110110
<EmbeddedResource Include="tools\shimgen.exe" />
@@ -155,15 +155,15 @@
155155
<ItemGroup>
156156
<EmbeddedResource Include="helpers\functions\Get-UninstallRegistryKey.ps1" />
157157
</ItemGroup>
158-
<ItemGroup Condition="'$(Configuration)' != 'ReleaseOfficialNo7zip'">
158+
<ItemGroup>
159159
<EmbeddedResource Include="tools\7z.dll" />
160160
<EmbeddedResource Include="tools\7z.exe" />
161161
</ItemGroup>
162-
<ItemGroup Condition="'$(Configuration)' != 'ReleaseOfficialNo7zip'">
162+
<ItemGroup>
163163
<EmbeddedResource Include="tools\7z.exe.ignore" />
164164
<EmbeddedResource Include="tools\7z.exe.manifest" />
165165
</ItemGroup>
166-
<ItemGroup Condition="'$(Configuration)' != 'ReleaseOfficialNo7zip'">
166+
<ItemGroup>
167167
<EmbeddedResource Include="tools\7z.dll.manifest" />
168168
</ItemGroup>
169169
<ItemGroup>

0 commit comments

Comments
 (0)