ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 54026] New: Zip task on <mappedresources> that excludes certain files by way of the mapper results in a NullPointerException
Date Thu, 18 Oct 2012 22:15:04 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=54026

          Priority: P2
            Bug ID: 54026
          Assignee: notifications@ant.apache.org
           Summary: Zip task on <mappedresources> that excludes certain
                    files by way of the mapper results in a
                    NullPointerException
          Severity: normal
    Classification: Unclassified
          Reporter: dtrebbien@gmail.com
          Hardware: All
            Status: NEW
           Version: 1.8.2
         Component: Core tasks
           Product: Ant

Steps to reproduce:

1. Create a folder named `test' with the following:

   test/
   test/test1
   test/subdir/
   test/subdir/test2

   (`test1' and `test2' are regular files.)

2. Create a `build.xml' with the following:

<project name="testcase" default="go" basedir=".">
    <target name="go">
        <zip destfile="destzip.zip">
            <mappedresources>
                <fileset dir="test"/>
                <globmapper from="subdir/*" to="subdir.orig/*"/>
            </mappedresources>
        </zip>
    </target>
</project>

3. Run `ant'.



Actual result:
NullPointerException thrown in org.apache.tools.ant.taskdefs.Zip.addResources.



Expected result:
`ant' finishes without error and there is a new ZIP file called `destzip.zip'
in the current directory. `zip -sf destzip.zip' should print:

Archive contains:
  subdir.orig/
  subdir.orig/test2
Total 2 entries



Tested in:
Ant 1.8.2 and 1.8.4 on Mac OS 10.7.5.



Known work-around:
Add an `excludes' attribute to the <fileset> to exclude all files not matched
by the "from" glob. For the given example, `excludes="test1"'.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Mime
View raw message