-
Notifications
You must be signed in to change notification settings - Fork 1k
Split dependency resolution into resolve and downloading (lock dependency) #2989
Copy link
Copy link
Closed
Labels
Milestone
Description
steps
- Run
updatetask (orcompiletask that callsupdate) on a newly created project.
expectation
updateinternally callsresolveDependencies.resolveDependenciesperforms Ivy resolution and persists the resulting dependency graph into a JSON file undersrc/sbt/resolveDependencies.json. This file might contain:
a. SHA-1 of the inputlibraryDependencies, and SHA-1 of alllibraryDependenciesacross the build ("build clock").
b. URLs for all artifacts. Or an expression relative to resolvers.
c. Timestamp for-SNAPSHOTresolution.- Using the persisted dependency graph,
updatetask downloads required artifacts.
steps 2
- The user git commits
src/sbt/resolveDependencies.json. - Later day, some other user Bob git clones and runs
compiletask (that internally callsupdate).
expectation 2
compileinternally callsupdate, which internally callsresolveDependencies.resolveDependenciesfinds that there's a persisted dependency graph atsrc/sbt/resolveDependencies.json, and returns it without calling Ivy.- Using the returned dependency graph,
updatetask downloads required artifacts.
steps 3
- Bob adds
commons-io1.0 tolibraryDependencies. - Bob reloads the build.
- Bob runs
compile.
expectation 3
compileinternally callsupdate, which internally callsresolveDependencies.- Detecting the change in
libraryDependencies, which changes the SHA-1 of all libraryDependencies ("build clock"), allresolveDependencies.jsonare invalidated, and performs Ivy resolution and overwrites the file.
note
This should work similar to Gemfile.lock.
In addition, by using our own caching mechanism, we should be able to avoid global Ivy locking when Ivy is not invoked. Note that it will need special handling for -SNAPSHOT.
Ref #290
Reactions are currently unavailable