@@ -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-
304151Task( "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
353200ToolSettings. SetToolSettings ( context : Context ,
354201 buildMSBuildToolVersion : MSBuildToolVersion . NET40 ) ;
0 commit comments