Hello All,

I'm trying to do some run-time inspection of a gradle multi-project build
What I need, is to list all directories, that are used as a source directory
by fully evaluated build.
Here is the code:

task printInfo {
    printProjectSrc(project)
}

void printProjectSrc(Project proj) {
  proj.sourceSets.all*.allSource.srcDirs*.each { println it }
  proj.sourceSets.all*.resources.srcDirs*.each { println it }
  proj.subprojects.each { printProjectSrc(it, root) }
}

It gives me following error

* What went wrong:
A problem occurred evaluating root project 'gradle-runner'.
Cause: No such property: srcDirs for class:
org.gradle.api.internal.file.UnionFileTree

But JavaDoc says getAllSource() returns instance of SourceDirectorySet
(which has getSrcDirs method required).

What am I doing wrong?

-- 
Best regards,
Nikita Skvortsov

Reply via email to