KotlinDependencyHandler

Represents a DSL for managing the dependencies of Kotlin entities that implement a HasKotlinDependencies interface.

Functions

Link copied to clipboard
abstract fun api(dependencyNotation: Any): Dependency?
abstract fun api(dependencyNotation: String, configure: ExternalModuleDependency.() -> Unit): ExternalModuleDependency
open fun api(dependencyNotation: String, configure: Action<ExternalModuleDependency>): ExternalModuleDependency

Adds an api module dependency to this entity.

abstract fun <T : Dependency> api(dependency: T, configure: T.() -> Unit): T
open fun <T : Dependency> api(dependency: T, configure: Action<T>): T

Adds an api dependency to this entity.

Link copied to clipboard
abstract fun compileOnly(dependencyNotation: Any): Dependency?
abstract fun compileOnly(dependencyNotation: String, configure: ExternalModuleDependency.() -> Unit): ExternalModuleDependency
open fun compileOnly(dependencyNotation: String, configure: Action<ExternalModuleDependency>): ExternalModuleDependency

Adds a compileOnly module dependency to this entity.

abstract fun <T : Dependency> compileOnly(dependency: T, configure: T.() -> Unit): T
open fun <T : Dependency> compileOnly(dependency: T, configure: Action<T>): T

Adds a compileOnly dependency to this entity.

Link copied to clipboard
abstract fun devNpm(directory: File): Dependency

Deprecated - wrapping npm dependencies in implementation(devNpm(...)) is deprecated. Declare them with npmDev instead, as a standalone statement with an explicit dependency name:

abstract fun devNpm(name: String, directory: File): Dependency
abstract fun devNpm(name: String, version: String): Dependency

Deprecated - wrapping npm dependencies in implementation(devNpm(...)) is deprecated. Declare them with npmDev instead, as a standalone statement:

Link copied to clipboard
abstract fun implementation(dependencyNotation: Any): Dependency?
abstract fun implementation(dependencyNotation: String, configure: ExternalModuleDependency.() -> Unit): ExternalModuleDependency
open fun implementation(dependencyNotation: String, configure: Action<ExternalModuleDependency>): ExternalModuleDependency

Adds an implementation module dependency to this entity.

abstract fun <T : Dependency> implementation(dependency: T, configure: T.() -> Unit): T
open fun <T : Dependency> implementation(dependency: T, configure: Action<T>): T

Adds an implementation dependency to this entity.

Link copied to clipboard
open fun kotlin(simpleModuleName: String): ExternalModuleDependency

Creates a dependency to an official Kotlin library with the same version that is configured in org.jetbrains.kotlin.gradle.dsl.KotlinBaseExtension.coreLibrariesVersion.

abstract fun kotlin(simpleModuleName: String, version: String?): ExternalModuleDependency

Creates a dependency to an official Kotlin library.

Link copied to clipboard
abstract fun npm(directory: File): Dependency

Deprecated - deriving the NPM dependency name from the directory is deprecated. Declare the name explicitly instead:

abstract fun npm(name: String, directory: File): Dependency

Declares a dependency on the NPM module located in a local directory.

abstract fun npm(name: String, version: String): Dependency
abstract fun npm(name: String, version: Provider<String>)

Declares a dependency on the NPM module.

Link copied to clipboard
abstract fun npmDev(name: String, directory: File)

Declares a dependency on a NPM module located in a local directory that is added to devDependencies.

abstract fun npmDev(name: String, version: String)
abstract fun npmDev(name: String, version: Provider<String>)

Declares a dependency on a NPM module that is added to devDependencies.

Link copied to clipboard
abstract fun npmDevDirectory(name: String, directory: Provider<Directory>)

Declares a dependency on a NPM module located in a local directory that is added to devDependencies.

Link copied to clipboard
abstract fun npmOptional(name: String, directory: File)

Declares a dependency on a NPM module located in a local directory that is added to optionalDependencies.

abstract fun npmOptional(name: String, version: String)
abstract fun npmOptional(name: String, version: Provider<String>)

Declares a dependency on a NPM module that is added to optionalDependencies.

Link copied to clipboard
abstract fun npmOptionalDirectory(name: String, directory: Provider<Directory>)

Declares a dependency on a NPM module located in a local directory that is added to optionalDependencies.

Link copied to clipboard
abstract fun npmPeer(name: String, version: String)
abstract fun npmPeer(name: String, version: Provider<String>)

Declares a dependency on a NPM module that is added to peerDependencies.

Link copied to clipboard
abstract fun optionalNpm(directory: File): Dependency

Deprecated - wrapping npm dependencies in implementation(optionalNpm(...)) is deprecated. Declare them with npmOptional instead, as a standalone statement with an explicit dependency name:

abstract fun optionalNpm(name: String, directory: File): Dependency
abstract fun optionalNpm(name: String, version: String): Dependency

Deprecated - wrapping npm dependencies in implementation(optionalNpm(...)) is deprecated. Declare them with npmOptional instead, as a standalone statement:

Link copied to clipboard
abstract fun peerNpm(name: String, version: String): Dependency

Deprecated - wrapping npm dependencies in implementation(peerNpm(...)) is deprecated. Declare them with npmPeer instead, as a standalone statement:

Link copied to clipboard
open fun project(path: String): ProjectDependency
abstract fun project(notation: Map<String, Any?>): ProjectDependency
open fun project(path: String, configuration: String? = null): ProjectDependency

Creates a Gradle project dependency.

Link copied to clipboard
abstract fun runtimeOnly(dependencyNotation: Any): Dependency?
abstract fun runtimeOnly(dependencyNotation: String, configure: ExternalModuleDependency.() -> Unit): ExternalModuleDependency
open fun runtimeOnly(dependencyNotation: String, configure: Action<ExternalModuleDependency>): ExternalModuleDependency

Adds a runtimeOnly module dependency to this entity.

abstract fun <T : Dependency> runtimeOnly(dependency: T, configure: T.() -> Unit): T
open fun <T : Dependency> runtimeOnly(dependency: T, configure: Action<T>): T

Adds a runtimeOnly dependency to this entity.