ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Holger Rauch <>
Subject Re: Neither dirset nor fileset with type selector seem to select directories
Date Thu, 11 May 2006 08:52:25 GMT

first of all, thanks to both Scot and Matt for responding so quickly to my
message. I tried to incorporate your suggestions into my buildfile and, to
be honest, the results are still somewhat interesting:

a) The combination of <fileset> and a <type> selector doesn't seem to work
   at all, i.e. the property "myprop" is ALWAYS empty, no matter whether a
   <path> wrapper element is used or not and also regardless of whether
   <pathconvert> is used or <property refid="" />

   <fileset dir="test">
     <type type="dir"

   If it worked, I would prefer the <fileset>/selector combo since it
   would enable to combine various selectors which is useful for choosing
   directories in more complex path structures.

   Any idea why this particular <fileset>/selector combo doesn't work
   at all???

b) <dirset> yields the correct result with or without the <path> wrapper
   element if <pathconvert> is used instead of <property refid="" />

c) When using <dirset> in conjunction with <property refid="" />, then the  
   <path> wrapper element is needed (as Scot suggested), otherwise myprop is 

It would generally help a lot if Ant was telling how it's selecting
files/dirs behind the scenes, especially when taking into accound Matt's
hint with the toString() method. But, unfortunately, not even "-d" seems to
help here. Is there any other way to get more info from Ant???

Here's the path structure I was playing with and my modified build file
(most stuff commented out, so that it can be selectively reenabled for
testing purposes).

> >Holger Rauch wrote:
> [...]
> >>
> >>test    (dir)
> >>  |--> blah    (dir)
> >>  |--> blubber    (dir)
> >>  |--> hallo    (file)
> [...]

<?xml version="1.0" encoding="iso-8859-1"?>

<project name="test" basedir="." default="pretest">

  <target name="pretest">
    <!-- Doesn't work (value of myprop is empty) regardless
         of the task used to set the property's value
    <path id="all-dir">
      <fileset dir="test">
        <type type="dir" />
    <!-- Doesn't work either
    <fileset id="all-dir" dir="test">
      <type type="dir" />
    <!-- Works in conjunction with pathconvert
         but NOT in conjunction with <property refid="" />!!!
    <dirset id="all-dir" dir="test" />
    <!-- Works with both <property refid="" /> and pathconvert!!!
    <path id="all-dir">
      <dirset dir="test" />
    <pathconvert property="myprop" pathsep=" " refid="all-dir" />
    <property name="myprop" refid="all-dir" />
    <echo message="myprop = ${myprop}" />


Thanks in advance for any advice!

Kind regards,


View raw message