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(path: String): RegularFile(source)

Returns a RegularFile whose location is the given path, resolved relative to this directory.

Return

The file.

Since

4.1

Parameters

path

The path. Can be absolute.


abstract fun file(path: Provider<out CharSequence>): Provider<RegularFile>(source)

Returns a Provider whose value is a RegularFile whose location is the given path resolved relative to this directory.

The return value is live and the provided path is queried each time the return value is queried.

Return

The file.

Since

4.1

Parameters

path

The path provider. Can have value that is an absolute path.