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

ZipTask cannot create zip using basedir #1242

Closed
jawira opened this issue Jan 24, 2020 · 2 comments · Fixed by #1255
Closed

ZipTask cannot create zip using basedir #1242

jawira opened this issue Jan 24, 2020 · 2 comments · Fixed by #1255
Labels
Milestone

Comments

@jawira
Copy link
Contributor

jawira commented Jan 24, 2020

Hello. I can't make work the following code, the .zip file is never created:

    <zip basedir="src" destfile="./demo.zip"/>

However when I use <fileset> everything works as expected:

    <zip destfile="./demo.zip">
      <fileset dir="src">
        <include name="**"/>
      </fileset>
    </zip>

If this is a bug, and you can point me out where the bug is, I'm more than willing to create a PR to fix this :)

@siad007 siad007 added the defect label Jan 25, 2020
@siad007
Copy link
Member

siad007 commented Jan 25, 2020

Confirmed as a bug. We can reproduce it and with log level verbose there is also this output given:

[PHP Error] ZipArchive::close(): Read error: Bad file descriptor [line 230 of C:\Users\XXX\phing-repo\classes\phing\tasks\ext\ZipTask.php]

It seems that the current implementation can not take use of the fileset member var of the MatchingTask. In case of using basedir it would be possible to add it as single element to the filesets array in ZipTask. But there might be other issues with the MatchingTask dependency.

We should start with test cases covering both and have a look at the MatchingTask as well.
Feel free to add your PR @jawira

@siad007 siad007 added this to the 3.0.0-alpha4 milestone Jan 25, 2020
@jawira
Copy link
Contributor Author

jawira commented Jan 27, 2020

I'm working on it.

@siad007 siad007 linked a pull request Feb 9, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

2 participants