Skip to content
This repository was archived by the owner on Oct 20, 2025. It is now read-only.

Conversation

@JasonPierce
Copy link

This allows users to specify a common directory for the archive.

@pwelter34
Copy link
Member

How is this different from WorkingDirectory?

@JasonPierce
Copy link
Author

This pull request adds a feature which lets you specify a root directory that you want the archived files to be placed within, inside the generated zip file.

Example

User has two files to archive:

<RootDir>C:\Foo</RootDir>
<MyFiles
  Include="$(RootDir)\Bar.txt;$(RootDir)\Baz.txt" />

Case 1: Without RootDirectory

<Zip
  ZipFileName="Qux.zip"
  Files="@(MyFiles)"
  WorkingDirectory="$(RootDir)"
  ZipLevel="9" />

Generated Zip File

  • Qux.zip
    • Bar.txt
    • Baz.txt

Case 2: With RootDirectory

<Zip
  ZipFileName="Qux.zip"
  Files="@(MyFiles)"
  WorkingDirectory="$(RootDir)"
  RootDirectory="MyCustomFolder"
  ZipLevel="9" />

Generated Zip File

  • Qux.zip
    • MyCustomFolder
      • Bar.txt
      • Baz.txt

@JasonPierce
Copy link
Author

A better name for this option might be "ArchiveFolder" vs "RootDirectory", now that I think about it. What do you think?

arlm added a commit to arlm/msbuildtasks that referenced this pull request Feb 15, 2017
Added RootDirectory option to Zip task  loresoft#58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants