ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject AW: fileset exclude with full path
Date Mon, 17 Sep 2007 15:28:59 GMT
There is no task for that, but a core function in Ant's FileUtils which can be used


    <scriptdef name="relpath" language="javascript">
        <attribute name="property"/>
        <attribute name="base"/>
        <attribute name="file"/>
            propName = attributes.get("property");
            baseFile = attributes.get("base");
            file     = attributes.get("file");
            relPath  = FileUtils.getRelativePath(new File(baseFile), new File(file) );
            project.setNewProperty(propName, relPath);
    <target name="clean">
        <delete dir="x"/>
    <target name="prepare">
        <mkdir dir="x/a/b/c/d/e/f/g"/>
        <echo file="x/a/b/c/d/e/f/g/file.txt" message="test"/>
    <target name="test">
        <relpath property="rel" base="x/a/b" file="x/a/b/c/d/e/f/g/file.txt"/>
            File: x/a/b/c/d/e/f/g/file.txt
            Base: x/a/b
            rel : ${rel}


>-----Urspr√ľngliche Nachricht-----
>Von: Eric Dalquist [] 
>Gesendet: Montag, 17. September 2007 17:10
>Betreff: fileset exclude with full path
>I have a full path to a directory that I want to create a 
>fileset of and 
>a full path to a sub-directory that I want to exclude.
>I've tried the following and some variations on it:
><fileset id="projectFiles" dir="/a/b/c/" excludes="/a/b/c/d/**" />
>No matter what I try I can't seem to get the excludes path to 
>be honored.
>I unfortunately do not have the ability to change the 
>sub-directory path 
>to a relative path instead of a full path, it is being populated from 
>another task that I do not have control over.
>Thank you,

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message