Package org.pkl.core.project
Class ProjectDeps
java.lang.Object
org.pkl.core.project.ProjectDeps
The Java representation of a project's resolved dependency list. Resolved dependencies are stored
as JSON as a sibling file to PklProject. Each key in the JSON file records an entry for each
dependency via its base URI, and the major version number.
A resolved dependency can either be local or remote. A remote dependency will have its checksums recorded, while a local dependency will point to the relative path of the project holding the dependency.
Sample structure:
{
"schemaVersion": 1,
"resolvedDependencies": {
"package://example.com/my/package@0": {
"type": "remote",
"uri": "projectpackage://example.com/my/package@0.5.0",
"checksums": {
"sha256": "abc123"
}
},
"package://example.com/other/package@1": {
"type": "local",
"uri": "projectpackage://example.com/other/package@1.5.0",
"path": "../sibling"
}
}
}
-
Constructor Summary
ConstructorsConstructorDescriptionProjectDeps(org.graalvm.collections.EconomicMap<CanonicalPackageUri, Dependency> resolvedDependencies) -
Method Summary
Modifier and TypeMethodDescriptionbooleanget(CanonicalPackageUri canonicalPackageUri) Given a declared dependency, return the resolved dependency.inthashCode()static ProjectDepsstatic ProjectDepstoString()voidwriteTo(OutputStream out) Serializes project dependencies to JSON, and writes it to the provided output stream.
-
Constructor Details
-
ProjectDeps
public ProjectDeps(org.graalvm.collections.EconomicMap<CanonicalPackageUri, Dependency> resolvedDependencies)
-
-
Method Details
-
parse
public static ProjectDeps parse(Path path) throws IOException, URISyntaxException, Json.JsonParseException -
parse
- Throws:
Json.JsonParseException
-
get
Given a declared dependency, return the resolved dependency. -
writeTo
Serializes project dependencies to JSON, and writes it to the provided output stream.- Throws:
IOException
-
toString
-
equals
-
hashCode
public int hashCode()
-