Package org.savantbuild.dep
Interface DependencyService
- All Known Implementing Classes:
DefaultDependencyService
public interface DependencyService
Provides all of the dependency management services. The main workflow for managing dependencies is:
1. Download and parse all of the AMD (AbstractArtifact Meta Data) files to build a dependency graph. 2. Traverse the graph and verify that it is a valid graph (doesn't contain conflicting versions of specific artifacts) 3. Traverse the graph and download the dependencies
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classControls how resolution functions for each dependency-group. -
Method Summary
Modifier and TypeMethodDescriptionbuildGraph(ReifiedArtifact project, Dependencies dependencies, Workflow workflow) Builds a dependency graph for the given dependencies of the given project.voidpublish(Publication publication, PublishWorkflow workflow) Publishes the given Publication (artifact, meta-data, source file, etc) with the given workflow.reduce(DependencyGraph graph) Reduces the DependencyGraph by ensuring that each dependency only has one version.resolve(ArtifactGraph graph, Workflow workflow, DependencyService.TraversalRules rules, DependencyListener... listeners) Resolves the graph by downloading the artifacts.
-
Method Details
-
buildGraph
DependencyGraph buildGraph(ReifiedArtifact project, Dependencies dependencies, Workflow workflow) throws ArtifactMetaDataMissingException, ProcessFailureException, org.savantbuild.security.MD5Exception Builds a dependency graph for the given dependencies of the given project.- Parameters:
project- The artifact that represents the project.dependencies- The declared dependencies of the project.workflow- The workflow to use for downloading and caching the AMD files.- Returns:
- The dependency graph.
- Throws:
ArtifactMetaDataMissingException- If any artifacts AMD files could not be downloaded or found locally.ProcessFailureException- If a workflow process failed while fetching the meta-data.org.savantbuild.security.MD5Exception- If any MD5 files didn't match the AMD file when downloading.
-
publish
Publishes the given Publication (artifact, meta-data, source file, etc) with the given workflow.- Parameters:
publication- The publication to publish.workflow- The workflow to publish with.- Throws:
PublishException- If the publication failed.
-
reduce
ArtifactGraph reduce(DependencyGraph graph) throws CompatibilityException, org.savantbuild.util.CyclicException Reduces the DependencyGraph by ensuring that each dependency only has one version. This also prunes unused dependencies and ensures there are no compatibility issues in the graph.- Parameters:
graph- The dependency graph.- Returns:
- The reduced graph.
- Throws:
CompatibilityException- If an dependency has incompatible versions.org.savantbuild.util.CyclicException- If the graph has a cycle in it.
-
resolve
ResolvedArtifactGraph resolve(ArtifactGraph graph, Workflow workflow, DependencyService.TraversalRules rules, DependencyListener... listeners) throws org.savantbuild.util.CyclicException, ArtifactMissingException, ProcessFailureException, org.savantbuild.security.MD5Exception, LicenseException Resolves the graph by downloading the artifacts. This will use the Workflow to download the artifacts in the graph. This does not check version compatibility. That is done in thereduce(DependencyGraph)method.- Parameters:
graph- The ArtifactGraph to resolve.workflow- The workflow used to resolve the artifacts.listeners- Any listeners that want to receive callbacks when artifacts are resolved.rules- The traversal rules that are applied while traversing the graph during the reduction.- Returns:
- The resolved graph.
- Throws:
ProcessFailureException- If a workflow process failed while fetching an artifact or its source.ArtifactMissingException- If any of the required artifacts are missing.org.savantbuild.util.CyclicException- If any of the artifact graph has any cycles in it.org.savantbuild.security.MD5Exception- If the item's MD5 file did not match the item.LicenseException- If an invalid license is encountered during the resolution process.
-