ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 21511] New: - Custom file selectors have no project instance.
Date Fri, 11 Jul 2003 13:46:48 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21511>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21511

Custom file selectors have no project instance.

           Summary: Custom file selectors have no project instance.
           Product: Ant
           Version: 1.5.3
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Core
        AssignedTo: dev@ant.apache.org
        ReportedBy: brunner@pixel.de


Custom file selectors for file sets can't use their project member (e.g. for
logging or for resolving properties) as it is always null.

Provided a minimum example below.

Bye Rudi

-------------------------- Java code --------------------------
package my.selector;

import org.apache.tools.ant.types.selectors.BaseSelector;
import java.io.File;

public class MySelector extends BaseSelector
{
    public boolean isSelected(File file, String s, File file1)
    {
        System.out.println("project = " + project);
        return true;
    }
}
---------------------------------------------------------------

-------------------------- Ant build file ---------------------
<?xml version="1.0" encoding="UTF-8"?>

<project name="MySelector" default="compile">

    <property name="classesdir" value="classes" />
    <property name="srcdir" value="src" />

    <target name="test">
        <zip destfile="test.zip">
            <fileset dir="${srcdir}" includes="**/*.java">
                <custom classname="my.selector.MySelector"
classpath="${classesdir}"/>
            </fileset>
        </zip>
    </target>

    <target name="compile">
        <mkdir dir="${classesdir}"/>
        <javac srcdir="${srcdir}" destdir="${classesdir}"/>
    </target>

    <target name="clean">
        <delete dir="${classesdir}" />
    </target>

</project>
---------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message