aboutsummaryrefslogtreecommitdiff
path: root/samples/Groovy/build.gradle
blob: c1ac812c41c08a4de9df82c9984fc57e3044878e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
task echoDirListViaAntBuilder() {
    description = 'Uses the built-in AntBuilder instance to echo and list files'
    //Docs: http://ant.apache.org/manual/Types/fileset.html
    
    //Echo the Gradle project name via the ant echo plugin
    ant.echo(message: project.name)
    ant.echo(path)
    ant.echo("${projectDir}/samples")
    
    //Gather list of files in a subdirectory
    ant.fileScanner{
        fileset(dir:"samples")
    }.each{
        //Print each file to screen with the CWD (projectDir) path removed.
        println it.toString() - "${projectDir}"
    }
}