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.

file

abstract fun file(file: Provider<File>): Provider<RegularFile>(source)

Creates a RegularFile provider whose location is calculated from the given Provider.

File system locations based on relative paths will be resolved against this layout's reference location, as defined by getProjectDirectory.

Since

4.1