https://issues.apache.org/bugzilla/show_bug.cgi?id=51602
Bug #: 51602
Summary: zip reports "not found" when basedir attribute used
with fileset
Product: Ant
Version: 1.6.5
Platform: PC
Status: NEW
Severity: normal
Priority: P2
Component: Core tasks
AssignedTo: [email protected]
ReportedBy: [email protected]
Classification: Unclassified
The zip target performs validation to ensure the fileset exists before doing
zip. Unfortunately, this fileset validation is performed ignoring the basedir.
For example, assume the following directories exist:
Case #1:
C:\build
C:\zipOutput
C:\zipOutput\temp
Assume that we want to zip the temp directory to C:\zipOutput\temp.zip, and
that our build process is running inside C:\build (the ant scripts and basedir
for ant is that directory). To do this build, we would make the following zip
task:
Attributes:
zip-base-dir=C:\zipOutput
zip-filename=temp.zip
zip-dir-path=temp
Macro:
<zip destfile="@{zip-base-dir}/@{zip-filename}" basedir="@{zip-base-dir}">
<fileset dir="@{zip-dir-path}" />
</zip>
Running this task would result in the following output:
C:\build\build.xml:102: C:\build\temp not found.
This is because the ant zip target does validation that the source fileset
exists PRIOR to zipping. However, it does not consider the "basedir" flag in
this case, so errors are thrown.
Case #2:
Let's try to do the same thing, but this time, add two new folders:
C:\build\doc
C:\zipOutput\doc
Attributes:
zip-base-dir=C:\zipOutput
zip-filename=doc.zip
zip-dir-doc=temp
Macro:
<zip destfile="@{zip-base-dir}/@{zip-filename}" basedir="@{zip-base-dir}">
<fileset dir="@{zip-dir-path}" />
</zip>
In this case, the zip target will succeed because the validation first
validates that C:\build\doc exists (it does), then it proceeds to zip the
C:\zipOutput\doc folder into C:\zipOutput\doc.zip
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.