For AI agents: the documentation index is at https://docs.gradle.org/llms.txt. Request any page with the header Accept: text/markdown to get Markdown. User manual pages are also available as Markdown by replacing .html with .md in the URL.

getSourceDirectories

Returns the source directories that make up this set, represented as a FileCollection. Does not filter source directories that do not exist. Generally, it is preferable to use this method instead of getSrcDirs, as this method does not require the source directories to be calculated when it is called. Instead, the source directories are calculated when queried. The return value of this method also maintains dependency information.

The returned collection is live and reflects changes to this source directory set.

Since

3.2