The end goal for pedantic is to hook into Aether's dependency
resolution and provide feedback about the dependency tree. Using a
DependencyGraphTransformer allows us to look at the tree both before
and after conflict resolution so that downloading all of the
dependencies only occurs once.
Aether uses a NearestVersionConflictResolver to resolve which
versions to use in case of a conflict. The
NearestVersionConflictResolver uses a ConflictIdSorter to
determine those, and it will save the information in
SORTED_CONFLICT_IDS and CONFLICT_IDS. We can similarly use the
conflict information to determine which version is choosen in a
conflict.
Additional important classes from Aether:
DependencyGraphTransformationContextDependencyNodeDependencyArtifactVersionVersionConstraintThe end goal for pedantic is to hook into Aether's dependency resolution and provide feedback about the dependency tree. Using a `DependencyGraphTransformer` allows us to look at the tree both before and after conflict resolution so that downloading all of the dependencies only occurs once. Aether uses a `NearestVersionConflictResolver` to resolve which versions to use in case of a conflict. The `NearestVersionConflictResolver` uses a `ConflictIdSorter` to determine those, and it will save the information in `SORTED_CONFLICT_IDS` and `CONFLICT_IDS`. We can similarly use the conflict information to determine which version is choosen in a conflict. Additional important classes from Aether: * `DependencyGraphTransformationContext` * `DependencyNode` * `Dependency` * `Artifact` * `Version` * `VersionConstraint`
(initialize-conflict-ids! node context)Make sure that SORTED_CONFLICT_IDS and CONFLICT_IDS have been
initialized. Similar to what a NearestVersionConflictResolver will do.
Make sure that `SORTED_CONFLICT_IDS` and `CONFLICT_IDS` have been initialized. Similar to what a NearestVersionConflictResolver will do.
(set-overrides! overrides conflicts accepted-paths ranges)Check each accepted-path against its conflicting paths. If a
conflicting path fails the pedantic criteria then add information
representing this possibly confusing situation to overrides.
Check each `accepted-path` against its conflicting paths. If a conflicting path fails the pedantic criteria then add information representing this possibly confusing situation to `overrides`.
(set-ranges! ranges paths)Set ranges to contain all paths that asks for a version range
Set ranges to contain all paths that asks for a version range
(transform-graph ranges overrides node context transformer)Examine the tree with root node for version ranges, then
allow the original transformer to perform resolution, then check for
overriden dependencies.
Examine the tree with root `node` for version ranges, then allow the original `transformer` to perform resolution, then check for overriden dependencies.
(use-transformer session ranges overrides)Wrap the session's current DependencyGraphTransformer with one that checks
for version ranges and overriden dependencies.
ranges and overrides are expect to be (atom []). This provides a way to
send back information since the return value can't be used here.
After resolution:
ranges will be a vector of paths (see pedantic.path)
overrides will be a vector of maps with keys [:accepted :ignoreds :ranges].
:accepted is the path that was resolved. :ignored is a list of
paths that were not used.
:ranges is a list of paths containing version ranges that might
have affected the resolution.
Wrap the session's current `DependencyGraphTransformer` with one that checks
for version ranges and overriden dependencies.
`ranges` and `overrides` are expect to be (atom []). This provides a way to
send back information since the return value can't be used here.
After resolution:
`ranges` will be a vector of paths (see pedantic.path)
`overrides` will be a vector of maps with keys [:accepted :ignoreds :ranges].
`:accepted` is the path that was resolved. :ignored is a list of
paths that were not used.
`:ranges` is a list of paths containing version ranges that might
have affected the resolution.cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |