fun file(path: Any): File
Resolves a file path relative to this script's target base directory.
If this script targets org.gradle.api.Project,
then path
is resolved relative to the project directory.
If this script targets org.gradle.api.initialization.Settings,
then path
is resolved relative to the build root directory.
This method converts the supplied path based on its type:
file:
is treated as a file URL.File
.file:
URLs are supported.
path
- The object to resolve as a File
.
Return
The resolved file.
fun file(path: Any, validation: PathValidation): File
Resolves a file path relative to this script's target base directory.
path
- The object to resolve as a File
.
validation
- The validation to perform on the file.
Return
The resolved file.
See Also