@Generated(value="jsii-pacmak/1.47.0 (build 86d2c33)", date="2021-12-20T00:39:28.381Z") @Stability(value=Experimental) public class Dependencies extends Component
To add a dependency you can use a project-type specific API such as
nodeProject.addDeps() or use the generic API of project.deps:
| Modifier and Type | Field and Description |
|---|---|
static String |
MANIFEST_FILE
(experimental) The project-relative path of the deps manifest file.
|
| Modifier | Constructor and Description |
|---|---|
protected |
Dependencies(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
Dependencies(software.amazon.jsii.JsiiObjectRef objRef) |
|
Dependencies(Project project)
(experimental) Adds a dependencies component to the project.
|
| Modifier and Type | Method and Description |
|---|---|
Dependency |
addDependency(String spec,
DependencyType type)
(experimental) Adds a dependency to this project.
|
Dependency |
addDependency(String spec,
DependencyType type,
Map<String,Object> metadata)
(experimental) Adds a dependency to this project.
|
List<Dependency> |
getAll()
(experimental) A copy of all dependencies recorded for this project.
|
Dependency |
getDependency(String name)
(experimental) Returns a dependency by name.
|
Dependency |
getDependency(String name,
DependencyType type)
(experimental) Returns a dependency by name.
|
static DependencyCoordinates |
parseDependency(String spec)
(experimental) Returns the coordinates of a dependency spec.
|
void |
removeDependency(String name)
(experimental) Removes a dependency.
|
void |
removeDependency(String name,
DependencyType type)
(experimental) Removes a dependency.
|
Dependency |
tryGetDependency(String name)
(experimental) Returns a dependency by name.
|
Dependency |
tryGetDependency(String name,
DependencyType type)
(experimental) Returns a dependency by name.
|
getProject, postSynthesize, preSynthesize, synthesizejsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet@Stability(value=Experimental) public static final String MANIFEST_FILE
protected Dependencies(software.amazon.jsii.JsiiObjectRef objRef)
protected Dependencies(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Experimental)
public Dependencies(@NotNull
Project project)
project - The parent project. This parameter is required.@Stability(value=Experimental) @NotNull public static DependencyCoordinates parseDependency(@NotNull String spec)
Given foo@^3.4.0 returns { name: "foo", version: "^3.4.0" }.
Given bar@npm:@bar/legacy returns { name: "bar", version: "npm:@bar/legacy" }.
spec - This parameter is required.@Stability(value=Experimental) @NotNull public Dependency addDependency(@NotNull String spec, @NotNull DependencyType type, @Nullable Map<String,Object> metadata)
spec - The dependency spec in the format `MODULE[@VERSION]` where `MODULE` is the package-manager-specific module name and `VERSION` is an optional semantic version requirement (e.g. `^3.4.0`). This parameter is required.type - The type of the dependency. This parameter is required.metadata - @Stability(value=Experimental) @NotNull public Dependency addDependency(@NotNull String spec, @NotNull DependencyType type)
spec - The dependency spec in the format `MODULE[@VERSION]` where `MODULE` is the package-manager-specific module name and `VERSION` is an optional semantic version requirement (e.g. `^3.4.0`). This parameter is required.type - The type of the dependency. This parameter is required.@Stability(value=Experimental) @NotNull public Dependency getDependency(@NotNull String name, @Nullable DependencyType type)
Fails if there is no dependency defined by that name or if type is not
provided and there is more then one dependency type for this dependency.
name - The name of the dependency. This parameter is required.type - The dependency type.@Stability(value=Experimental) @NotNull public Dependency getDependency(@NotNull String name)
Fails if there is no dependency defined by that name or if type is not
provided and there is more then one dependency type for this dependency.
name - The name of the dependency. This parameter is required.@Stability(value=Experimental)
public void removeDependency(@NotNull
String name,
@Nullable
DependencyType type)
name - The name of the module to remove (without the version). This parameter is required.type - The dependency type.@Stability(value=Experimental)
public void removeDependency(@NotNull
String name)
name - The name of the module to remove (without the version). This parameter is required.@Stability(value=Experimental) @Nullable public Dependency tryGetDependency(@NotNull String name, @Nullable DependencyType type)
Returns undefined if there is no dependency defined by that name or if
type is not provided and there is more then one dependency type for this
dependency.
name - The name of the dependency. This parameter is required.type - The dependency type.@Stability(value=Experimental) @Nullable public Dependency tryGetDependency(@NotNull String name)
Returns undefined if there is no dependency defined by that name or if
type is not provided and there is more then one dependency type for this
dependency.
name - The name of the dependency. This parameter is required.@Stability(value=Experimental) @NotNull public List<Dependency> getAll()
The list is sorted by type->name->version
Copyright © 2021. All rights reserved.