Equivalent for ants 'dirSet'


(Johannes Zillmann) #1

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

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

?

best

Johannes


(Luke Daley) #2

See http://www.gradle.org/docs/current/userguide/working_with_files.html#sec:file_trees


(Johannes Zillmann) #3

Hmm i already tried that… but

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

is yielding other results as

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

is doing !? Seems like it filters all directories…


(Luke Daley) #4

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


(Johannes Zillmann) #5

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 ?