# Equivalent for ants 'dirSet'

**URL:** <https://discuss.gradle.org/t/equivalent-for-ants-dirset/6125>\
**Category:** Old Forum Archive\
**Created:** [May 7, 2013, 1:25pm UTC](https://discuss.gradle.org/t/equivalent-for-ants-dirset/6125 "2013-05-07T13:25:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Johannes\_Zillmann](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/johannes_zillmann/32/726_2.png) [@Johannes\_Zillmann](https://discuss.gradle.org/u/Johannes_Zillmann)\
**Post date:** [May 7, 2013, 1:25pm UTC](https://discuss.gradle.org/t/equivalent-for-ants-dirset/6125/1 "2013-05-07T13:25:00Z")

</div>

Is there an pure gradle equivalent for ants ‘dirSet’ ? Like

```gradle
def path = ant.path {
  dirset(dir: './', includes: '*/modules/common/src/main/hadoop')
}

```

?

best

Johannes

---

<div class="post-metadata">

**Author:** ![luke\_daley](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/luke_daley/32/9890_2.png) [@luke\_daley](https://discuss.gradle.org/u/luke_daley)\
**Post date:** [May 7, 2013, 4:04pm UTC](https://discuss.gradle.org/t/equivalent-for-ants-dirset/6125/2 "2013-05-07T16:04:00Z")

</div>

See [http://www.gradle.org/docs/current/userguide/working\_with\_files.html#sec:file\_trees](http://www.gradle.org/docs/current/userguide/working_with_files.html#sec:file_trees)

---

<div class="post-metadata">

**Author:** ![Johannes\_Zillmann](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/johannes_zillmann/32/726_2.png) [@Johannes\_Zillmann](https://discuss.gradle.org/u/Johannes_Zillmann)\
**Post date:** [May 7, 2013, 4:24pm UTC](https://discuss.gradle.org/t/equivalent-for-ants-dirset/6125/3 "2013-05-07T16:24:00Z")

</div>

Hmm i already tried that… but

```gradle
ant.path {
        dirset(dir: datameerProjectRoot, includes: 'modules/common/src/main/hadoop')
    }.list().each {
     println "_1__$it"
    }

```

is yielding other results as

```gradle
fileTree(datameerProjectRoot).include('modules/common/src/main/hadoop').each {
     println "_2__$it"
    }

```

is doing !? Seems like it filters all directories…

---

<div class="post-metadata">

**Author:** ![luke\_daley](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/luke_daley/32/9890_2.png) [@luke\_daley](https://discuss.gradle.org/u/luke_daley)\
**Post date:** [May 7, 2013, 4:28pm UTC](https://discuss.gradle.org/t/equivalent-for-ants-dirset/6125/4 "2013-05-07T16:28:00Z")

</div>

If you use the visit method you can collect the dirs.

---

<div class="post-metadata">

**Author:** ![Johannes\_Zillmann](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/johannes_zillmann/32/726_2.png) [@Johannes\_Zillmann](https://discuss.gradle.org/u/Johannes_Zillmann)\
**Post date:** [May 7, 2013, 4:31pm UTC](https://discuss.gradle.org/t/equivalent-for-ants-dirset/6125/5 "2013-05-07T16:31:00Z")

</div>

Yes, but then i would have to apply custom matcher logic right, since it gives me also the parent files of the matched dirs… correct ?
