# DependencyFactory

@NonExtensible
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.

#### Since

7.6

## 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: @Nullable String, name: String, @Nullable version: @Nullable String): ExternalModuleDependency
abstract fun create(@Nullable group: @Nullable String, name: String, @Nullable version: @Nullable String, @Nullable classifier: @Nullable String, @Nullable extension: @Nullable String): ExternalModuleDependency
Create an ExternalModuleDependency from a series of strings.
createProjectDependency
Link copied to clipboard
abstract fun createProjectDependency(): ProjectDependency
Create a ProjectDependency for the current project.
abstract fun createProjectDependency(projectPath: String): ProjectDependency
Create a ProjectDependency from a Project path.
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.