Package org.gradle.api.artifacts.dsl
Interface DependencyFactory
-
@NonExtensible @Incubating public interface DependencyFactory
Factory class for creatingDependencyinstances, 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 viaProject.getDependencyFactory().Note: This interface is not intended for implementation by build script or plugin authors.
- Since:
- 7.6
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ExternalModuleDependencycreate(java.lang.CharSequence dependencyNotation)Create anExternalModuleDependencyfrom the"group:name:version:classifier@extension"notation.ExternalModuleDependencycreate(java.lang.String group, java.lang.String name, java.lang.String version)Create anExternalModuleDependencyfrom a series of strings.ExternalModuleDependencycreate(java.lang.String group, java.lang.String name, java.lang.String version, java.lang.String classifier, java.lang.String extension)Create anExternalModuleDependencyfrom a series of strings.FileCollectionDependencycreate(FileCollection fileCollection)Create aFileCollectionDependencyfrom aFileCollection.ProjectDependencycreate(Project project)Create aProjectDependencyfrom aProject.DependencygradleApi()Creates a dependency on the API of the current version of Gradle.DependencygradleTestKit()Creates a dependency on the Gradle test-kit API.DependencylocalGroovy()Creates a dependency on the version of Groovy that is distributed with the current version of Gradle.
-
-
-
Method Detail
-
create
ExternalModuleDependency create(java.lang.CharSequence dependencyNotation)
Create anExternalModuleDependencyfrom the"group:name:version:classifier@extension"notation.Classifier and extension may each separately be omitted. Version may be omitted if there is no classifier.
- Parameters:
dependencyNotation- the dependency notation- Returns:
- the new dependency
-
create
ExternalModuleDependency create(@Nullable java.lang.String group, java.lang.String name, @Nullable java.lang.String version)
Create anExternalModuleDependencyfrom a series of strings.- Parameters:
group- the group (optional)name- the nameversion- the version (optional)- Returns:
- the new dependency
-
create
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)
Create anExternalModuleDependencyfrom a series of strings.- Parameters:
group- the group (optional)name- the nameversion- the version (optional)classifier- the classifier (optional)extension- the extension (optional)- Returns:
- the new dependency
-
create
FileCollectionDependency create(FileCollection fileCollection)
Create aFileCollectionDependencyfrom aFileCollection.- Parameters:
fileCollection- the file collection- Returns:
- the new dependency
-
create
ProjectDependency create(Project project)
Create aProjectDependencyfrom aProject.- Parameters:
project- the project- Returns:
- the new dependency
-
gradleApi
Dependency gradleApi()
Creates a dependency on the API of the current version of Gradle.- Returns:
- The dependency.
- Since:
- 7.6
-
gradleTestKit
Dependency gradleTestKit()
Creates a dependency on the Gradle test-kit API.- Returns:
- The dependency.
- Since:
- 7.6
-
localGroovy
Dependency localGroovy()
Creates a dependency on the version of Groovy that is distributed with the current version of Gradle.- Returns:
- The dependency.
- Since:
- 7.6
-
-