KotlinProjectScriptTemplate

@Incubating
abstract class KotlinProjectScriptTemplate(host: KotlinScriptHost<Project>) : DefaultKotlinScript(source)

Base class for Gradle Kotlin DSL standalone Project scripts IDE support, aka. build scripts.

Since

8.1

Constructors

Link copied to clipboard
constructor(host: KotlinScriptHost<Project>)

Properties

Link copied to clipboard
open override val logger: Logger

Logger for scripts. You can use this in your script to write log messages.

Link copied to clipboard
open override val logging: LoggingManager

The LoggingManager which can be used to receive logging and to control the standard output/error capture for this script. By default, System.out is redirected to the Gradle logging system at the QUIET log level, and System.err is redirected at the ERROR log level.

Link copied to clipboard
open override val resources: ResourceHandler

Provides access to resource-specific utility methods, for example factory methods that create various resources.

Functions

Link copied to clipboard
open fun buildscript(block: ScriptHandlerScope.() -> Unit)

Configures the build script classpath for this project.

Link copied to clipboard
open override fun copy(configuration: Action<CopySpec>): WorkResult

Copies the specified files.

Link copied to clipboard
open override fun copySpec(): CopySpec
open override fun copySpec(configuration: Action<CopySpec>): CopySpec

Creates a {@link CopySpec} which can later be used to copy files or create an archive.

Link copied to clipboard
open override fun delete(vararg paths: Any): Boolean

Deletes files and directories.

open override fun delete(configuration: Action<DeleteSpec>): WorkResult

Deletes the specified files.

Link copied to clipboard
open override fun exec(configuration: Action<ExecSpec>): ExecResult

Executes an external command.

Link copied to clipboard
open override fun file(path: Any): File
open override fun file(path: Any, validation: PathValidation): File

Resolves a file path relative to this script's target base directory.

Link copied to clipboard
open override fun files(vararg paths: Any): ConfigurableFileCollection
open override fun files(paths: Any, configuration: Action<ConfigurableFileCollection>): ConfigurableFileCollection

Creates a ConfigurableFileCollection containing the given files.

Link copied to clipboard
open override fun fileTree(baseDir: Any): ConfigurableFileTree
open override fun fileTree(baseDir: Any, configuration: Action<ConfigurableFileTree>): ConfigurableFileTree

Creates a new ConfigurableFileTree using the given base directory.

Link copied to clipboard

The ScriptHandler for this script.

Link copied to clipboard
open override fun javaexec(configuration: Action<JavaExecSpec>): ExecResult

Executes an external Java process.

Link copied to clipboard
open override fun mkdir(path: Any): File

Creates a directory and returns a file pointing to it.

Link copied to clipboard

Configures the plugin dependencies for this project.

Link copied to clipboard
open override fun relativePath(path: Any): String

Returns the relative path from this script's target base directory to the given path.

Link copied to clipboard
open override fun tarTree(tarPath: Any): FileTree

Creates a new FileTree which contains the contents of the given TAR file.

Link copied to clipboard
open override fun uri(path: Any): URI

Resolves a file path to a URI, relative to this script's target base directory.

Link copied to clipboard
open override fun zipTree(zipPath: Any): FileTree

Creates a new FileTree which contains the contents of the given ZIP file.