tags:

views:

53

answers:

1

Basically I have the following structure for a javadoc:

build
+---javadoc
+-------Module A
+-------Module B
+---Index.html

Module X are folders. I'm trying to list the folders there, ignoring subfolders, so I can create the main index. So far This is what I have:

<target name="x">
    <dirset id="dist.contents" dir="build/javadoc" excludes="build/javadoc/*/**"/>
    <property name="prop.dist.contents" refid="dist.contents"/>
    <echo>${prop.dist.contents}</echo>
</target>

But it gives me both the the Module's folder and all its subfolders. I know it should be a little detail but I can't figure it out.

+1  A: 

Change to use includes instead of excludes, and specify a wildcard that won't traverse sub-directories:

<dirset id="dist.contents" dir="build/javadoc" includes="*"/>

Further restrict the wildcard if needed:

<dirset id="dist.contents" dir="build/javadoc" includes="Module *"/>

Here's the docs on directory-based tasks.

martin clayton
Can't believe it was that simple. Thanks a lot, it did the trick!
javydreamercsw