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.

fromFile

abstract fun fromFile(file: Any, charset: String): TextResource(source)

Creates a text resource backed by the given file.

Return

a text resource backed by the given file

Since

2.2

Parameters

file

a text file evaluated as per files

charset

the file's character encoding (e.g. "utf-8")


abstract fun fromFile(file: Any): TextResource(source)

Same as fromFile(file, Charset.defaultCharset()).

Since

2.2

See also