gradle
8.4

# DependencyFactory

@NonExtensible
@Incubating
interface DependencyFactory(source)

Factory class for creating Dependency instances, with strong typing.

An instance of the factory can be injected into a task, plugin or other object by annotating a public constructor or property getter method with `javax.inject.Inject`. It is also available via getDependencyFactory.

Note: This interface is not intended for implementation by build script or plugin authors.

## Functions

create
Link copied to clipboard
abstract fun create(dependencyNotation: CharSequence): ExternalModuleDependency
Create an ExternalModuleDependency from the `"group:name:version:classifier@extension"` notation.
abstract fun create(project: Project): ProjectDependency
Create a ProjectDependency from a Project.
abstract fun create(fileCollection: FileCollection): FileCollectionDependency
Create a FileCollectionDependency from a FileCollection.
abstract fun create(@Nullable group: String, name: String, @Nullable version: String): ExternalModuleDependency
abstract fun create(@Nullable group: String, name: String, @Nullable version: String, @Nullable classifier: String, @Nullable extension: String): ExternalModuleDependency
Create an ExternalModuleDependency from a series of strings.
gradleApi
Link copied to clipboard
abstract fun gradleApi(): Dependency
Creates a dependency on the API of the current version of Gradle.
gradleTestKit
Link copied to clipboard
abstract fun gradleTestKit(): Dependency
Creates a dependency on the Gradle test-kit API.
localGroovy
Link copied to clipboard
abstract fun localGroovy(): Dependency
Creates a dependency on the version of Groovy that is distributed with the current version of Gradle.