{"action":"created","issue":{"url":"https://api.github.com/repos/cake-build/cake/issues/1283","repository_url":"https://api.github.com/repos/cake-build/cake","labels_url":"https://api.github.com/repos/cake-build/cake/issues/1283/labels{/name}","comments_url":"https://api.github.com/repos/cake-build/cake/issues/1283/comments","events_url":"https://api.github.com/repos/cake-build/cake/issues/1283/events","html_url":"https://github.com/cake-build/cake/issues/1283","id":182863998,"number":1283,"title":"Empty folders are not included in a ZIP archive","user":{"login":"vladimir-kazakov","id":3518844,"avatar_url":"https://avatars.githubusercontent.com/u/3518844?v=3","gravatar_id":"","url":"https://api.github.com/users/vladimir-kazakov","html_url":"https://github.com/vladimir-kazakov","followers_url":"https://api.github.com/users/vladimir-kazakov/followers","following_url":"https://api.github.com/users/vladimir-kazakov/following{/other_user}","gists_url":"https://api.github.com/users/vladimir-kazakov/gists{/gist_id}","starred_url":"https://api.github.com/users/vladimir-kazakov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vladimir-kazakov/subscriptions","organizations_url":"https://api.github.com/users/vladimir-kazakov/orgs","repos_url":"https://api.github.com/users/vladimir-kazakov/repos","events_url":"https://api.github.com/users/vladimir-kazakov/events{/privacy}","received_events_url":"https://api.github.com/users/vladimir-kazakov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2016-10-13T18:25:35Z","updated_at":"2016-10-19T19:50:54Z","closed_at":null,"body":"### What You Are Seeing?\r\nI'm trying to create a ZIP archive with pre-defined folder structure. Some folders are empty. After using `Zip(\"./Package\", \"Package.zip\");`, I see that Package.zip is created, but when I look inside it, there are no empty folders. Only folders with files are included.\r\n\r\n### What is Expected?\r\nI expect empty folders to be present in the ZIP archive.\r\n\r\n### What version of Cake are you using?\r\n0.16.2.\r\n\r\n### Are you running on a 32 or 64 bit system?\r\n64-bit.\r\n\r\n### What environment are you running on?  Windows? Linux? Mac?\r\n* Windows 10 (1511).\r\n* Ubuntu 16.04.1.\r\n\r\n### Are you running on a CI Server?  If so, which one?\r\nNo.\r\n\r\n### How Did You Get This To Happen? (Steps to Reproduce)\r\nCreate the following folder structure:\r\n```\r\n+ Package\r\n|  + Empty\r\n|  + NotEmpty\r\n|  |  - File.txt\r\n```\r\nIn the `build.cake` perform `Zip(\"./Package\", \"Package.zip\");`.\r\n\r\n### Output Log\r\n~~~sh\r\nFeeds used:\r\n  /home/havok/.local/share/NuGet/Cache\r\n  /home/havok/.nuget/packages/\r\n  https://api.nuget.org/v3/index.json\r\n\r\nAll packages listed in /home/havok/Projects/Cake/ZipEmptyFolders/tools/packages.config are already installed.\r\nModule directory does not exist.\r\nAnalyzing build script...\r\nAnalyzing /home/havok/Projects/Cake/ZipEmptyFolders/build.cake...\r\nProcessing build script...\r\nCreating script session...\r\nAdding reference to Cake.Core.dll...\r\nAdding reference to Cake.Common.dll...\r\nAdding reference to Cake.exe...\r\nAdding reference to System.Xml.dll...\r\nAdding reference to System.Xml.Linq.dll...\r\nAdding reference to System.Data.dll...\r\nImporting namespace Cake.Common...\r\nImporting namespace Cake.Common.Build...\r\nImporting namespace Cake.Common.Build.AppVeyor...\r\nImporting namespace Cake.Common.Build.AppVeyor.Data...\r\nImporting namespace Cake.Common.Build.BitbucketPipelines...\r\nImporting namespace Cake.Common.Build.BitbucketPipelines.Data...\r\nImporting namespace Cake.Common.Build.Bitrise...\r\nImporting namespace Cake.Common.Build.Bitrise.Data...\r\nImporting namespace Cake.Common.Build.ContinuaCI...\r\nImporting namespace Cake.Common.Build.ContinuaCI.Data...\r\nImporting namespace Cake.Common.Build.Jenkins...\r\nImporting namespace Cake.Common.Build.Jenkins.Data...\r\nImporting namespace Cake.Common.Build.TravisCI...\r\nImporting namespace Cake.Common.Build.TravisCI.Data...\r\nImporting namespace Cake.Common.Diagnostics...\r\nImporting namespace Cake.Common.IO...\r\nImporting namespace Cake.Common.IO.Paths...\r\nImporting namespace Cake.Common.Net...\r\nImporting namespace Cake.Common.Security...\r\nImporting namespace Cake.Common.Solution...\r\nImporting namespace Cake.Common.Solution.Project...\r\nImporting namespace Cake.Common.Solution.Project.Properties...\r\nImporting namespace Cake.Common.Solution.Project.XmlDoc...\r\nImporting namespace Cake.Common.Text...\r\nImporting namespace Cake.Common.Tools...\r\nImporting namespace Cake.Common.Tools.Cake...\r\nImporting namespace Cake.Common.Tools.Chocolatey...\r\nImporting namespace Cake.Common.Tools.Chocolatey.ApiKey...\r\nImporting namespace Cake.Common.Tools.Chocolatey.Config...\r\nImporting namespace Cake.Common.Tools.Chocolatey.Features...\r\nImporting namespace Cake.Common.Tools.Chocolatey.Install...\r\nImporting namespace Cake.Common.Tools.Chocolatey.Pack...\r\nImporting namespace Cake.Common.Tools.Chocolatey.Pin...\r\nImporting namespace Cake.Common.Tools.Chocolatey.Push...\r\nImporting namespace Cake.Common.Tools.Chocolatey.Sources...\r\nImporting namespace Cake.Common.Tools.Chocolatey.Upgrade...\r\nImporting namespace Cake.Common.Tools.DNU...\r\nImporting namespace Cake.Common.Tools.DNU.Build...\r\nImporting namespace Cake.Common.Tools.DNU.Pack...\r\nImporting namespace Cake.Common.Tools.DNU.Restore...\r\nImporting namespace Cake.Common.Tools.DotCover...\r\nImporting namespace Cake.Common.Tools.DotCover.Analyse...\r\nImporting namespace Cake.Common.Tools.DotCover.Cover...\r\nImporting namespace Cake.Common.Tools.DotNetCore...\r\nImporting namespace Cake.Common.Tools.DotNetCore.Build...\r\nImporting namespace Cake.Common.Tools.DotNetCore.Execute...\r\nImporting namespace Cake.Common.Tools.DotNetCore.Pack...\r\nImporting namespace Cake.Common.Tools.DotNetCore.Publish...\r\nImporting namespace Cake.Common.Tools.DotNetCore.Restore...\r\nImporting namespace Cake.Common.Tools.DotNetCore.Run...\r\nImporting namespace Cake.Common.Tools.DotNetCore.Test...\r\nImporting namespace Cake.Common.Tools.DupFinder...\r\nImporting namespace Cake.Common.Tools.Fixie...\r\nImporting namespace Cake.Common.Tools.GitLink...\r\nImporting namespace Cake.Common.Tools.GitReleaseManager...\r\nImporting namespace Cake.Common.Tools.GitReleaseManager.AddAssets...\r\nImporting namespace Cake.Common.Tools.GitReleaseManager.Close...\r\nImporting namespace Cake.Common.Tools.GitReleaseManager.Create...\r\nImporting namespace Cake.Common.Tools.GitReleaseManager.Export...\r\nImporting namespace Cake.Common.Tools.GitReleaseManager.Publish...\r\nImporting namespace Cake.Common.Tools.GitReleaseNotes...\r\nImporting namespace Cake.Common.Tools.GitVersion...\r\nImporting namespace Cake.Common.Tools.ILMerge...\r\nImporting namespace Cake.Common.Tools.ILRepack...\r\nImporting namespace Cake.Common.Tools.InspectCode...\r\nImporting namespace Cake.Common.Tools.MSBuild...\r\nImporting namespace Cake.Common.Tools.MSTest...\r\nImporting namespace Cake.Common.Tools.NSIS...\r\nImporting namespace Cake.Common.Tools.NuGet...\r\nImporting namespace Cake.Common.Tools.NuGet.Install...\r\nImporting namespace Cake.Common.Tools.NuGet.Pack...\r\nImporting namespace Cake.Common.Tools.NuGet.Push...\r\nImporting namespace Cake.Common.Tools.NuGet.Restore...\r\nImporting namespace Cake.Common.Tools.NuGet.SetApiKey...\r\nImporting namespace Cake.Common.Tools.NuGet.SetProxy...\r\nImporting namespace Cake.Common.Tools.NuGet.Sources...\r\nImporting namespace Cake.Common.Tools.NuGet.Update...\r\nImporting namespace Cake.Common.Tools.NUnit...\r\nImporting namespace Cake.Common.Tools.OctopusDeploy...\r\nImporting namespace Cake.Common.Tools.OpenCover...\r\nImporting namespace Cake.Common.Tools.ReportGenerator...\r\nImporting namespace Cake.Common.Tools.ReportUnit...\r\nImporting namespace Cake.Common.Tools.Roundhouse...\r\nImporting namespace Cake.Common.Tools.SignTool...\r\nImporting namespace Cake.Common.Tools.SpecFlow...\r\nImporting namespace Cake.Common.Tools.SpecFlow.StepDefinitionReport...\r\nImporting namespace Cake.Common.Tools.SpecFlow.TestExecutionReport...\r\nImporting namespace Cake.Common.Tools.TextTransform...\r\nImporting namespace Cake.Common.Tools.VSTest...\r\nImporting namespace Cake.Common.Tools.WiX...\r\nImporting namespace Cake.Common.Tools.WiX.Heat...\r\nImporting namespace Cake.Common.Tools.XBuild...\r\nImporting namespace Cake.Common.Tools.XUnit...\r\nImporting namespace Cake.Common.Xml...\r\nImporting namespace Cake.Core...\r\nImporting namespace Cake.Core.Diagnostics...\r\nImporting namespace Cake.Core.IO...\r\nImporting namespace Cake.Core.Scripting...\r\nImporting namespace System...\r\nImporting namespace System.Collections.Generic...\r\nImporting namespace System.IO...\r\nImporting namespace System.Linq...\r\nImporting namespace System.Text...\r\nImporting namespace System.Threading.Tasks...\r\nCompiling build script...\r\n\r\n========================================\r\nDefault\r\n========================================\r\nExecuting task: Default\r\nCreating zip file: /home/havok/Projects/Cake/ZipEmptyFolders/EmptyFolders.zip\r\nCompressing file /home/havok/Projects/Cake/ZipEmptyFolders/Package/NotEmpty/File.txt\r\nZip successfully created: /home/havok/Projects/Cake/ZipEmptyFolders/EmptyFolders.zip\r\nFinished executing task: Default\r\n\r\nTask                          Duration            \r\n--------------------------------------------------\r\nDefault                       00:00:00.0924718    \r\n--------------------------------------------------\r\nTotal:                        00:00:00.0924718   \r\n~~~"},"comment":{"url":"https://api.github.com/repos/cake-build/cake/issues/comments/254921290","html_url":"https://github.com/cake-build/cake/issues/1283#issuecomment-254921290","issue_url":"https://api.github.com/repos/cake-build/cake/issues/1283","id":254921290,"user":{"login":"coxp","id":447011,"avatar_url":"https://avatars.githubusercontent.com/u/447011?v=3","gravatar_id":"","url":"https://api.github.com/users/coxp","html_url":"https://github.com/coxp","followers_url":"https://api.github.com/users/coxp/followers","following_url":"https://api.github.com/users/coxp/following{/other_user}","gists_url":"https://api.github.com/users/coxp/gists{/gist_id}","starred_url":"https://api.github.com/users/coxp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coxp/subscriptions","organizations_url":"https://api.github.com/users/coxp/orgs","repos_url":"https://api.github.com/users/coxp/repos","events_url":"https://api.github.com/users/coxp/events{/privacy}","received_events_url":"https://api.github.com/users/coxp/received_events","type":"User","site_admin":false},"created_at":"2016-10-19T19:50:54Z","updated_at":"2016-10-19T19:50:54Z","body":"We just call out to the 7zip binary to compress as all the other options aren't very good. Something like this:\r\n```\r\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<packages>\r\n    <package id=\"Cake\" version=\"0.16.2\" />\r\n    <package id=\"7-Zip.CommandLine\" version=\"9.20.0\" />\r\n</packages>\r\n```\r\n```\r\nTask(\"Zip-Files\")\r\n    .IsDependentOn(\"Build-Environment-Files\")\r\n    .Does(() =>\r\n{\r\n    var packageFile = File(\"project-v\" + parameters.Version.SemVersion + \".7z\");\r\n    var packagePath = \"../\" + packageFile;\r\n\t\r\n    var exitCodeWithArgument = StartProcess(\"tools/7-Zip.CommandLine/tools/7za\", new ProcessSettings { \r\n        Arguments = \"a \" + packagePath + \" \" + \"./* -mx=5\",\r\n        WorkingDirectory = parameters.Paths.Directories.Package\r\n    });\r\n});\r\n```"}}
{"actor":{"display_login":"coxp"}}