Package org.gradle.api.artifacts.dsl
Interface Dependencies
-
- All Known Subinterfaces:
GradleDependencies,JvmComponentDependencies
@Incubating public interface Dependencies
Universal APIs that are available for alldependenciesblocks.- Since:
- 7.6
- See Also:
- Creating custom dependencies blocks.
- API Note:
- This interface is intended to be used to mix-in DSL methods for
dependenciesblocks. - Implementation Requirements:
- The default implementation of all methods should not be overridden.
- Implementation Note:
- Changes to this interface may require changes to the
extension module for Groovy DSLorextension functions for Kotlin DSL.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default DependencyConstraintconstraint(java.lang.CharSequence dependencyConstraintNotation)Create aDependencyConstraintfrom the given notation.default DependencyConstraintconstraint(ProjectDependency project)Create aDependencyConstraintfrom a project.default Provider<? extends DependencyConstraint>constraint(Provider<? extends MinimalExternalModuleDependency> dependencyConstraint)Create aDependencyConstraintfrom a minimal dependency.default Provider<? extends DependencyConstraint>constraint(ProviderConvertible<? extends MinimalExternalModuleDependency> dependencyConstraint)Create aDependencyConstraintfrom a minimal dependency.DependencyConstraintFactorygetDependencyConstraintFactory()A dependency constraint factory is used to convert supported dependency notations intoDependencyConstraintinstances.DependencyFactorygetDependencyFactory()A dependency factory is used to convert supported dependency notations intoDependencyinstances.ObjectFactorygetObjectFactory()Injected service to create named objects.ProjectgetProject()The current project.default ExternalModuleDependencymodule(java.lang.CharSequence dependencyNotation)Create anExternalModuleDependencyfrom the given notation.default ExternalModuleDependencymodule(java.lang.String group, java.lang.String name, java.lang.String version)Create anExternalModuleDependencyfrom a series of strings.default ProjectDependencyproject()Returns the current project as aProjectDependency.default ProjectDependencyproject(java.lang.String projectPath)Converts an absolute or relative path to a project into aProjectDependency.
-
-
-
Method Detail
-
getDependencyFactory
@Inject DependencyFactory getDependencyFactory()
A dependency factory is used to convert supported dependency notations intoDependencyinstances.- Returns:
- a dependency factory
- See Also:
DependencyFactory- Implementation Requirements:
- Do not implement this method. Gradle generates the implementation automatically.
-
getDependencyConstraintFactory
@Inject DependencyConstraintFactory getDependencyConstraintFactory()
A dependency constraint factory is used to convert supported dependency notations intoDependencyConstraintinstances.- Returns:
- a dependency constraint factory
- See Also:
DependencyConstraintFactory- Implementation Requirements:
- Do not implement this method. Gradle generates the implementation automatically.
-
getProject
@Inject Project getProject()
- Returns:
- current project
- Since:
- 8.0
- Implementation Requirements:
- Do not implement this method. Gradle generates the implementation automatically.
-
project
default ProjectDependency project(java.lang.String projectPath)
Converts an absolute or relative path to a project into aProjectDependency. Project paths are separated by colons. This method fails if the project cannot be found.- Parameters:
projectPath- an absolute or relative path (from the current project) to a project- Returns:
- a
ProjectDependencyfor the given path - See Also:
Project.project(String)
-
project
default ProjectDependency project()
Returns the current project as aProjectDependency.- Returns:
- the current project as a dependency
-
module
default ExternalModuleDependency module(java.lang.CharSequence dependencyNotation)
Create anExternalModuleDependencyfrom the given notation.- Parameters:
dependencyNotation- dependency to add- Returns:
- the new dependency
- See Also:
Valid dependency notation for this method
-
module
default ExternalModuleDependency module(@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
-
constraint
default DependencyConstraint constraint(java.lang.CharSequence dependencyConstraintNotation)
Create aDependencyConstraintfrom the given notation.- Parameters:
dependencyConstraintNotation- dependency constraint to add- Returns:
- the new dependency constraint
- Since:
- 8.7
- See Also:
Valid dependency constraint notation for this method
-
constraint
default Provider<? extends DependencyConstraint> constraint(Provider<? extends MinimalExternalModuleDependency> dependencyConstraint)
Create aDependencyConstraintfrom a minimal dependency.- Parameters:
dependencyConstraint- dependency constraint to add- Returns:
- the new dependency constraint
- Since:
- 8.7
-
constraint
default Provider<? extends DependencyConstraint> constraint(ProviderConvertible<? extends MinimalExternalModuleDependency> dependencyConstraint)
Create aDependencyConstraintfrom a minimal dependency.- Parameters:
dependencyConstraint- dependency constraint to add- Returns:
- the new dependency constraint
- Since:
- 8.7
-
constraint
default DependencyConstraint constraint(ProjectDependency project)
Create aDependencyConstraintfrom a project.- Parameters:
project- the project- Returns:
- the new dependency constraint
- Since:
- 8.7
-
getObjectFactory
@Inject ObjectFactory getObjectFactory()
Injected service to create named objects.- Returns:
- injected service
- Implementation Requirements:
- Do not implement this method. Gradle generates the implementation automatically.
-
-