@NonExtensible @Incubating public interface DependencyFactory
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 Project.getDependencyFactory()
.
Note: This interface is not intended for implementation by build script or plugin authors.
Modifier and Type | Method | Description |
---|---|---|
ExternalModuleDependency |
create(java.lang.CharSequence dependencyNotation) |
Create an
ExternalModuleDependency from the "group:name:version:classifier@extension" notation. |
ExternalModuleDependency |
create(java.lang.String group,
java.lang.String name,
java.lang.String version) |
Create an
ExternalModuleDependency from a series of strings. |
ExternalModuleDependency |
create(java.lang.String group,
java.lang.String name,
java.lang.String version,
java.lang.String classifier,
java.lang.String extension) |
Create an
ExternalModuleDependency from a series of strings. |
FileCollectionDependency |
create(FileCollection fileCollection) |
Create a
FileCollectionDependency from a FileCollection . |
ProjectDependency |
create(Project project) |
Create a
ProjectDependency from a Project . |
Dependency |
gradleApi() |
Creates a dependency on the API of the current version of Gradle.
|
Dependency |
gradleTestKit() |
Creates a dependency on the Gradle test-kit API.
|
Dependency |
localGroovy() |
Creates a dependency on the version of Groovy that is distributed with the current version of Gradle.
|
ExternalModuleDependency create(java.lang.CharSequence dependencyNotation)
ExternalModuleDependency
from the "group:name:version:classifier@extension"
notation.
Classifier and extension may each separately be omitted. Version may be omitted if there is no classifier.
dependencyNotation
- the dependency notationExternalModuleDependency create(@Nullable java.lang.String group, java.lang.String name, @Nullable java.lang.String version)
ExternalModuleDependency
from a series of strings.group
- the group (optional)name
- the nameversion
- the version (optional)ExternalModuleDependency create(@Nullable java.lang.String group, java.lang.String name, @Nullable java.lang.String version, @Nullable java.lang.String classifier, @Nullable java.lang.String extension)
ExternalModuleDependency
from a series of strings.group
- the group (optional)name
- the nameversion
- the version (optional)classifier
- the classifier (optional)extension
- the extension (optional)FileCollectionDependency create(FileCollection fileCollection)
FileCollectionDependency
from a FileCollection
.fileCollection
- the file collectionProjectDependency create(Project project)
ProjectDependency
from a Project
.project
- the projectDependency gradleApi()
Dependency gradleTestKit()
Dependency localGroovy()