DependencyConstraintHandler - Gradle DSL Version 5.1

# DependencyConstraintHandler

API Documentation: | `DependencyConstraintHandler`

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

A `DependencyConstraintHandler` is used to declare dependency constraints.

### Properties

No properties

### Methods

Method | Description
`add(configurationName, dependencyConstraintNotation)` | Incubating Adds a dependency constraint to the given configuration.
`add(configurationName, dependencyNotation, configureAction)` | Incubating Adds a dependency constraint to the given configuration, and configures the dependency constraint using the given closure.
`create(dependencyConstraintNotation)` | Incubating Creates a dependency constraint without adding it to a configuration.
`create(dependencyConstraintNotation, configureAction)` | Incubating Creates a dependency constraint without adding it to a configuration, and configures the dependency constraint using the given closure.
`enforcedPlatform(notation)` | Incubating Declares a constraint on an enforced platform. If the target coordinates represent multiple potential components, the platform component will be selected, instead of the library. An enforced platform is a platform for which the direct dependencies are forced, meaning that they would override any other version found in the graph.
`enforcedPlatform(notation, configureAction)` | Incubating Declares a constraint on an enforced platform. If the target coordinates represent multiple potential components, the platform component will be selected, instead of the library. An enforced platform is a platform for which the direct dependencies are forced, meaning that they would override any other version found in the graph.
`platform(notation)` | Incubating Declares a constraint on a platform. If the target coordinates represent multiple potential components, the platform component will be selected, instead of the library.
`platform(notation, configureAction)` | Incubating Declares a constraint on a platform. If the target coordinates represent multiple potential components, the platform component will be selected, instead of the library.

### Script blocks

No script blocks

### Method details

#### `DependencyConstraint` `add`(`String` configurationName, `Object` dependencyConstraintNotation)

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

Adds a dependency constraint to the given configuration.

#### `DependencyConstraint` `add`(`String` configurationName, `Object` dependencyNotation, ``Action`<? super `DependencyConstraint`>` configureAction)

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

Adds a dependency constraint to the given configuration, and configures the dependency constraint using the given closure.

#### `DependencyConstraint` `create`(`Object` dependencyConstraintNotation)

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

Creates a dependency constraint without adding it to a configuration.

#### `DependencyConstraint` `create`(`Object` dependencyConstraintNotation, ``Action`<? super `DependencyConstraint`>` configureAction)

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

Creates a dependency constraint without adding it to a configuration, and configures the dependency constraint using the given closure.

#### `DependencyConstraint` `enforcedPlatform`(`Object` notation)

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

Declares a constraint on an enforced platform. If the target coordinates represent multiple potential components, the platform component will be selected, instead of the library. An enforced platform is a platform for which the direct dependencies are forced, meaning that they would override any other version found in the graph.

#### `DependencyConstraint` `enforcedPlatform`(`Object` notation, ``Action`<? super `DependencyConstraint`>` configureAction)

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

Declares a constraint on an enforced platform. If the target coordinates represent multiple potential components, the platform component will be selected, instead of the library. An enforced platform is a platform for which the direct dependencies are forced, meaning that they would override any other version found in the graph.

#### `DependencyConstraint` `platform`(`Object` notation)

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

Declares a constraint on a platform. If the target coordinates represent multiple potential components, the platform component will be selected, instead of the library.

#### `DependencyConstraint` `platform`(`Object` notation, ``Action`<? super `DependencyConstraint`>` configureAction)

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

Declares a constraint on a platform. If the target coordinates represent multiple potential components, the platform component will be selected, instead of the library.