Try this:

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

<project name="test" basedir="." default="pretest">
   <target name="pretest">
       <path id = "all-dir">
           <dirset dir="test"/>
       </path>
       <property name="myprop" refid="all-dir" />
       <echo message="myprop = ${myprop}" />
   </target>
</project>

Not sure what's going on when you simply use dirset with an id... Your example threw me for a second :)

Scot P. Floess wrote:
Holger:

Very odd indeed...I am looking at this and get back to you...but sure enough...dirset yields the file instead of the directories...

Holger Rauch wrote:
Hi!

I've created the following simple directory structure for testing purposes.
I would like to see only dirs below test ("blah" and "blubber") in my
dirset/fileset. The Ant version I'm using is 1.6.5 in conjunction with
JDK 1.5.0_06 on Linux:

test    (dir)
  |--> blah    (dir)
  |--> blubber    (dir)
  |--> hallo    (file)

I would like to select only directories, and this, according to the Ant
manual, is possible using either

- dirsets or
- filesets in conjunction with selectors

Given the following simple build file

----------------------------------------

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

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

  <target name="pretest">
    <dirset id="all-dir" dir="test" />
    <property name="myprop" refid="all-dir" />
    <echo message="myprop = ${myprop}" />
  </target>

</project>

------------------------------------------

the output I get is:

============================

Buildfile: mytest.xml

pretest:
     [echo] myprop = hallo

BUILD SUCCESSFUL
Total time: 2 seconds

============================

When using a fileset in conjunction with selectors instead of the dirset,
like

<fileset id="all-dir" dir="test">
  <type type="dir" />
</fileset>

the output is

Buildfile: mytest.xml

pretest:
     [echo] myprop =
BUILD SUCCESSFUL
Total time: 2 seconds

===> myprop is EMPTY!

Obvious question: Why do neither of those two methods yield the desired
result?

Thanks in advance for any info!

Kind regards,

    Holger


--
Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-754-4592 (Work)

Chief Architect JPlate  http://sourceforge.net/projects/jplate
Chief Architect JavaPIM http://sourceforge.net/projects/javapim


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

Reply via email to