DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40912>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40912

           Summary: patternset include "unless" not behaving as expected
           Product: Ant
           Version: 1.6.5
          Platform: PC
        OS/Version: Windows XP
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: Build Process
        AssignedTo: dev@ant.apache.org
        ReportedBy: [EMAIL PROTECTED]


In the following testcases, it seems the file is deleted whether the property 
is set or not. Therefore, I believe there is a bug with patternset. When I 
don't use patternset, all works as expected. See tests 3 and 4.

# test 1 listing 

<?xml version="1.0"?>
<project name="test1" basedir="." default="test1">
        
        <property name="test-prop" value="true" />
        
        <patternset id="test.patternset">
                <include name="myfile" unless="test-prop" />
        </patternset>
        
        <!-- using patternset, property is set -->
        
        <target name="test1">   
                <echo>${test-prop}</echo>
                <mkdir dir="mydir" />
                <touch file="mydir/myfile" />
                <delete failonerror="false">
                        <fileset dir="mydir">
                                <patternset refid="test.patternset" />
                        </fileset>
                </delete>
        </target>

</project>

# test1 results

Buildfile: test1.xml

test1:
     [echo] true
    [mkdir] Created dir: C:\ant-bug\mydir
    [touch] Creating C:\ant-bug\mydir\myfile
   [delete] Deleting 1 files from C:\ant-bug\mydir

BUILD SUCCESSFUL
Total time: 1 second

#test2 listing

<?xml version="1.0"?>
<project name="test2" basedir="." default="test2">
        
        <patternset id="test.patternset">
                <include name="myfile" unless="test-prop" />
        </patternset>


        <!-- using patternset, property is not set -->
        <target name="test2">
                
                <echo>${test-prop}</echo>
                <mkdir dir="mydir" />
                <touch file="mydir/myfile" />
                <delete failonerror="false">
                        <fileset dir="mydir">
                                <patternset refid="test.patternset" />
                        </fileset>
                </delete>
        </target>
</project>

#test2 results

Buildfile: test2.xml

test2:
     [echo] ${test-prop}
    [touch] Creating C:\ant-bug\mydir\myfile
   [delete] Deleting 1 files from C:\ant-bug\mydir

BUILD SUCCESSFUL
Total time: 1 second

#test3 listing

<?xml version="1.0"?>
<project name="test3" basedir="." default="test3">
        
        <property name="test-prop" value="true" />

        <target name="test3">
                <!-- not using patternset, property is set -->
                <property name="test-prop" value="true" />
                <echo>${test-prop}</echo>
                <mkdir dir="mydir" />
                <touch file="mydir/myfile" />
                <delete failonerror="false">
                        <fileset dir="mydir">
                                <include name="myfile" unless="test-prop" />
                        </fileset>
                </delete>
        </target>
        

</project>

#test3 results

Buildfile: test3.xml

test3:
     [echo] true
    [touch] Creating C:\ant-bug\mydir\myfile

BUILD SUCCESSFUL
Total time: 1 second

#test4 listing

<?xml version="1.0"?>
<project name="test4" basedir="." default="test4">
        
        <!-- not using patternset, property is not set -->
        
        <target name="test4">
                <echo>${test-prop}</echo>
                <mkdir dir="mydir" />
                <touch file="mydir/myfile" />
                <delete failonerror="false">
                        <fileset dir="mydir">
                                <include name="myfile" unless="test-prop" />
                        </fileset>
                </delete>
        </target>

</project>

#test4 results

Buildfile: test4.xml

test4:
     [echo] ${test-prop}
   [delete] Deleting 1 files from C:\ant-bug\mydir

BUILD SUCCESSFUL
Total time: 1 second

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to