# InitScriptApi

abstract class InitScriptApi(val delegate: ERROR CLASS: Symbol not found for Gradle) : GradleDelegate(source)

### Deprecated

Kept for compatibility with precompiled script plugins published with Gradle versions prior to 6.0

#### Replace with

    import org.gradle.api.invocation.Gradle

Content copied to clipboard

    Gradle

Content copied to clipboard

Standard implementation of the API exposed to all types of Gradle scripts, precompiled and otherwise.

#### Inheritors

KotlinInitScript

## Constructors

InitScriptApi
Link copied to clipboard
constructor(delegate: ERROR CLASS: Symbol not found for Gradle)

## Properties

delegate
Link copied to clipboard
open override val delegate: ERROR CLASS: Symbol not found for Gradle
logger
Link copied to clipboard
val logger: ERROR CLASS: Symbol not found for Logger

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

logging
Link copied to clipboard
val logging: ERROR CLASS: Symbol not found for ConfigurableFileCollection

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.

resources
Link copied to clipboard
val resources: ERROR CLASS: Symbol not found for ResourceHandler

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

## Functions

addBuildListener
Link copied to clipboard
open fun addBuildListener(buildListener: org/gradle/BuildListener)
addListener
Link copied to clipboard
open fun addListener(listener: Any)
addProjectEvaluationListener
Link copied to clipboard
open fun addProjectEvaluationListener(listener: org/gradle/api/ProjectEvaluationListener): org/gradle/api/ProjectEvaluationListener
afterProject
Link copied to clipboard
open fun afterProject(action: org/gradle/api/Action<in org/gradle/api/Project>)
open fun afterProject(closure: Closure<Any>)
allprojects
Link copied to clipboard
open fun allprojects(action: org/gradle/api/Action<in org/gradle/api/Project>)
apply
Link copied to clipboard
open fun apply(action: org/gradle/api/Action<in org/gradle/api/plugins/ObjectConfigurationAction>)
open fun apply(closure: Closure<Any>)
open fun apply(options: Map<String, *>)
beforeProject
Link copied to clipboard
open fun beforeProject(action: org/gradle/api/Action<in org/gradle/api/Project>)
open fun beforeProject(closure: Closure<Any>)
beforeSettings
Link copied to clipboard
open fun beforeSettings(action: org/gradle/api/Action<in org/gradle/api/initialization/Settings>)
open fun beforeSettings(closure: Closure<*>)
buildFinished
Link copied to clipboard
open fun buildFinished(action: org/gradle/api/Action<in org/gradle/BuildResult>)
open fun buildFinished(closure: Closure<Any>)
copy
Link copied to clipboard
fun copy(configuration: ERROR CLASS: Symbol not found for CopySpec.() -> Unit): ERROR CLASS: Symbol not found for WorkResult

Copies the specified files.

copySpec
Link copied to clipboard
fun copySpec(): ERROR CLASS: Symbol not found for CopySpec
fun copySpec(configuration: ERROR CLASS: Symbol not found for CopySpec.() -> Unit): ERROR CLASS: Symbol not found for CopySpec

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

delete
Link copied to clipboard
fun delete(configuration: ERROR CLASS: Symbol not found for DeleteSpec.() -> Unit): ERROR CLASS: Symbol not found for WorkResult

Deletes the specified files.

fun delete(vararg paths: Any): Boolean

Deletes files and directories.

file
Link copied to clipboard
fun file(path: Any): File
fun file(path: Any, validation: ERROR CLASS: Symbol not found for PathValidation): File

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

files
Link copied to clipboard
fun files(vararg paths: Any): ERROR CLASS: Symbol not found for ConfigurableFileCollection
fun files(paths: Any, configuration: ERROR CLASS: Symbol not found for ConfigurableFileCollection.() -> Unit): ERROR CLASS: Symbol not found for ConfigurableFileCollection

Creates a ConfigurableFileCollection containing the given files.

fileTree
Link copied to clipboard
fun fileTree(baseDir: Any): ERROR CLASS: Symbol not found for ConfigurableFileTree
fun fileTree(baseDir: Any, configuration: ERROR CLASS: Symbol not found for ConfigurableFileTree.() -> Unit): ERROR CLASS: Symbol not found for ConfigurableFileTree

Creates a new ConfigurableFileTree using the given base directory.

getBuildPath
Link copied to clipboard
open fun getBuildPath(): String
getExtensions
Link copied to clipboard
open fun getExtensions(): org/gradle/api/plugins/ExtensionContainer
getGradle
Link copied to clipboard
open fun getGradle(): org/gradle/api/invocation/Gradle
getGradleHomeDir
Link copied to clipboard
open fun getGradleHomeDir(): File?
getGradleUserHomeDir
Link copied to clipboard
open fun getGradleUserHomeDir(): File
getGradleVersion
Link copied to clipboard
open fun getGradleVersion(): String
getIncludedBuilds
Link copied to clipboard
open fun getIncludedBuilds(): MutableCollection<org/gradle/api/initialization/IncludedBuild>
getLifecycle
Link copied to clipboard
open fun getLifecycle(): org/gradle/api/invocation/GradleLifecycle
getParent
Link copied to clipboard
open fun getParent(): org/gradle/api/invocation/Gradle??
getPluginManager
Link copied to clipboard
open fun getPluginManager(): org/gradle/api/plugins/PluginManager
getPlugins
Link copied to clipboard
open fun getPlugins(): org/gradle/api/plugins/PluginContainer
getProviders
Link copied to clipboard
open fun getProviders(): org/gradle/api/provider/ProviderFactory
getRootProject
Link copied to clipboard
open fun getRootProject(): org/gradle/api/Project
getSharedServices
Link copied to clipboard
open fun getSharedServices(): org/gradle/api/services/BuildServiceRegistry
getStartParameter
Link copied to clipboard
open fun getStartParameter(): org/gradle/StartParameter
getTaskGraph
Link copied to clipboard
open fun getTaskGraph(): org/gradle/api/execution/TaskExecutionGraph
includedBuild
Link copied to clipboard
open fun includedBuild(name: String): org/gradle/api/initialization/IncludedBuild
initscript
Link copied to clipboard
open fun initscript(block: ScriptHandlerScope.() -> Unit)

Configures the classpath of the init script.

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

Creates a directory and returns a file pointing to it.

projectsEvaluated
Link copied to clipboard
open fun projectsEvaluated(action: org/gradle/api/Action<in org/gradle/api/invocation/Gradle>)
open fun projectsEvaluated(closure: Closure<Any>)
projectsLoaded
Link copied to clipboard
open fun projectsLoaded(action: org/gradle/api/Action<in org/gradle/api/invocation/Gradle>)
open fun projectsLoaded(closure: Closure<Any>)
relativePath
Link copied to clipboard
fun relativePath(path: Any): String

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

removeListener
Link copied to clipboard
open fun removeListener(listener: Any)
removeProjectEvaluationListener
Link copied to clipboard
open fun removeProjectEvaluationListener(listener: org/gradle/api/ProjectEvaluationListener)
rootProject
Link copied to clipboard
open fun rootProject(action: org/gradle/api/Action<in org/gradle/api/Project>)
settingsEvaluated
Link copied to clipboard
open fun settingsEvaluated(action: org/gradle/api/Action<in org/gradle/api/initialization/Settings>)
open fun settingsEvaluated(closure: Closure<Any>)
tarTree
Link copied to clipboard
fun tarTree(tarPath: Any): ERROR CLASS: Symbol not found for FileTree

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

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

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

useLogger
Link copied to clipboard
open fun useLogger(logger: Any)
zipTree
Link copied to clipboard
fun zipTree(zipPath: Any): ERROR CLASS: Symbol not found for FileTree

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