Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added RootDirectory option to Zip task #58

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants