JvmComponentDependencies

API Documentation:JvmComponentDependencies

Note: This class is incubating and may change in a future version of Gradle.

This DSL element is used to add dependencies to a component, like JvmTestSuite.

  • implementation dependencies are used at compilation and runtime.
  • compileOnly dependencies are used only at compilation and are not available at runtime.
  • runtimeOnly dependencies are not available at compilation and are used only at runtime.
  • annotationProcessor dependencies are used only at compilation, and are added to the annotation processor classpath

Properties

PropertyDescription
annotationProcessor
Incubating

Returns a DependencyAdder to add to the set of annotation processor dependencies.

compileOnly
Incubating

Returns a DependencyAdder to add to the set of compile-only dependencies.

implementation
Incubating

Returns a DependencyAdder to add to the set of implementation dependencies.

runtimeOnly
Incubating

Returns a DependencyAdder to add to the set of runtime-only dependencies.

Methods

MethodDescription
enforcedPlatform(dependency)
Incubating

Takes a given ModuleDependency and modifies it to select the Enforced Platform variant of the given module.

enforcedPlatform(dependencyNotation)
Incubating

Create an ExternalModuleDependency from the given notation and modifies it to select the Enforced Platform variant of the given module.

enforcedPlatform(providerToDependency)
Incubating

Takes a given Provider to a ModuleDependency and modifies the dependency to select the Enforced Platform variant of the given module.

enforcedPlatform(providerConvertibleToDependency)
Incubating

Takes a given Provider to a MinimalExternalModuleDependency and modifies the dependency to select the Enforced Platform variant of the given module.

gradleApi()
Incubating

Creates a dependency on the API of the current version of Gradle.

gradleTestKit()
Incubating

Creates a dependency on the Gradle test-kit API.

localGroovy()
Incubating

Creates a dependency on the version of Groovy that is distributed with the current version of Gradle.

module(dependencyNotation)
Incubating

Create an ExternalModuleDependency from the given notation.

module(group, name, version)
Incubating

Create an ExternalModuleDependency from a series of strings.

platform(dependency)
Incubating

Takes a given ModuleDependency and modifies it to select the Platform variant of the given module.

platform(dependencyNotation)
Incubating

Create an ExternalModuleDependency from the given notation and modifies it to select the Platform variant of the given module.

platform(providerToDependency)
Incubating

Takes a given Provider to a ModuleDependency and modifies the dependency to select the Platform variant of the given module.

platform(providerConvertibleToDependency)
Incubating

Takes a given Provider to a MinimalExternalModuleDependency and modifies the dependency to select the Platform variant of the given module.

project()
Incubating

Returns the current project as a ProjectDependency.

project(projectPath)
Incubating

Converts an absolute or relative path to a project into a ProjectDependency. Project paths are separated by colons. This method fails if the project cannot be found.

testFixtures(dependency)
Incubating

Takes a given ModuleDependency and modifies it to select the Test Fixtures variant of the given module.

testFixtures(dependencyNotation)
Incubating

Create an ExternalModuleDependency from the given notation and modifies it to select the Test Fixtures variant of the given module.

testFixtures(providerToDependency)
Incubating

Takes a given Provider to a ExternalModuleDependency and modifies the dependency to select the Test Fixtures variant of the given module.

testFixtures(providerConvertibleToDependency)
Incubating

Takes a given Provider to a MinimalExternalModuleDependency and modifies the dependency to select the Test Fixtures variant of the given module.

Script blocks

No script blocks

Property details

DependencyAdder annotationProcessor (read-only)

Note: This property is incubating and may change in a future version of Gradle.

Returns a DependencyAdder to add to the set of annotation processor dependencies.

annotationProcessor dependencies are used only at compilation, and are added to the annotation processor classpath.

DependencyAdder compileOnly (read-only)

Note: This property is incubating and may change in a future version of Gradle.

Returns a DependencyAdder to add to the set of compile-only dependencies.

compileOnly dependencies are used only at compilation and are not available at runtime.

DependencyAdder implementation (read-only)

Note: This property is incubating and may change in a future version of Gradle.

Returns a DependencyAdder to add to the set of implementation dependencies.

implementation dependencies are used at compilation and runtime.

DependencyAdder runtimeOnly (read-only)

Note: This property is incubating and may change in a future version of Gradle.

Returns a DependencyAdder to add to the set of runtime-only dependencies.

runtimeOnly dependencies are not available at compilation and are used only at runtime.

Method details

D enforcedPlatform(D dependency)

Note: This method is incubating and may change in a future version of Gradle.

Takes a given ModuleDependency and modifies it to select the Enforced Platform variant of the given module.

ExternalModuleDependency enforcedPlatform(CharSequence dependencyNotation)

Note: This method is incubating and may change in a future version of Gradle.

Create an ExternalModuleDependency from the given notation and modifies it to select the Enforced Platform variant of the given module.

Provider<D> enforcedPlatform(Provider<D> providerToDependency)

Note: This method is incubating and may change in a future version of Gradle.

Takes a given Provider to a ModuleDependency and modifies the dependency to select the Enforced Platform variant of the given module.

Provider<? extends MinimalExternalModuleDependency> enforcedPlatform(ProviderConvertible<? extends MinimalExternalModuleDependency> providerConvertibleToDependency)

Note: This method is incubating and may change in a future version of Gradle.

Takes a given Provider to a MinimalExternalModuleDependency and modifies the dependency to select the Enforced Platform variant of the given module.

Dependency gradleApi()

Note: This method is incubating and may change in a future version of Gradle.

Creates a dependency on the API of the current version of Gradle.

Dependency gradleTestKit()

Note: This method is incubating and may change in a future version of Gradle.

Creates a dependency on the Gradle test-kit API.

Dependency localGroovy()

Note: This method is incubating and may change in a future version of Gradle.

Creates a dependency on the version of Groovy that is distributed with the current version of Gradle.

ExternalModuleDependency module(CharSequence dependencyNotation)

Note: This method is incubating and may change in a future version of Gradle.

Create an ExternalModuleDependency from the given notation.

ExternalModuleDependency module(String group, String name, String version)

Note: This method is incubating and may change in a future version of Gradle.

Create an ExternalModuleDependency from a series of strings.

D platform(D dependency)

Note: This method is incubating and may change in a future version of Gradle.

Takes a given ModuleDependency and modifies it to select the Platform variant of the given module.

ExternalModuleDependency platform(CharSequence dependencyNotation)

Note: This method is incubating and may change in a future version of Gradle.

Create an ExternalModuleDependency from the given notation and modifies it to select the Platform variant of the given module.

Provider<D> platform(Provider<D> providerToDependency)

Note: This method is incubating and may change in a future version of Gradle.

Takes a given Provider to a ModuleDependency and modifies the dependency to select the Platform variant of the given module.

Provider<? extends MinimalExternalModuleDependency> platform(ProviderConvertible<? extends MinimalExternalModuleDependency> providerConvertibleToDependency)

Note: This method is incubating and may change in a future version of Gradle.

Takes a given Provider to a MinimalExternalModuleDependency and modifies the dependency to select the Platform variant of the given module.

Note: This method is incubating and may change in a future version of Gradle.

Returns the current project as a ProjectDependency.

ProjectDependency project(String projectPath)

Note: This method is incubating and may change in a future version of Gradle.

Converts an absolute or relative path to a project into a ProjectDependency. Project paths are separated by colons. This method fails if the project cannot be found.

D testFixtures(D dependency)

Note: This method is incubating and may change in a future version of Gradle.

Takes a given ModuleDependency and modifies it to select the Test Fixtures variant of the given module.

ExternalModuleDependency testFixtures(CharSequence dependencyNotation)

Note: This method is incubating and may change in a future version of Gradle.

Create an ExternalModuleDependency from the given notation and modifies it to select the Test Fixtures variant of the given module.

Provider<? extends ExternalModuleDependency> testFixtures(Provider<? extends ExternalModuleDependency> providerToDependency)

Note: This method is incubating and may change in a future version of Gradle.

Takes a given Provider to a ExternalModuleDependency and modifies the dependency to select the Test Fixtures variant of the given module.

Provider<? extends MinimalExternalModuleDependency> testFixtures(ProviderConvertible<? extends MinimalExternalModuleDependency> providerConvertibleToDependency)

Note: This method is incubating and may change in a future version of Gradle.

Takes a given Provider to a MinimalExternalModuleDependency and modifies the dependency to select the Test Fixtures variant of the given module.