Initial implementation of project-lock.json.

This commit adds a initial implementation of project-lock.json, a build
system agnostic method of specifying the crate graph and roots.
This commit is contained in:
David Wood 2019-03-05 22:29:23 +01:00
parent b1a1d20e06
commit 00d927a188
No known key found for this signature in database
GPG key ID: 01760B4F9F53F154
9 changed files with 309 additions and 96 deletions

View file

@ -99,12 +99,7 @@ impl BatchDatabase {
let ws = ProjectWorkspace::discover(root.as_ref())?;
let mut roots = Vec::new();
roots.push(root.clone());
for pkg in ws.cargo.packages() {
roots.push(pkg.root(&ws.cargo).to_path_buf());
}
for krate in ws.sysroot.crates() {
roots.push(krate.root_dir(&ws.sysroot).to_path_buf())
}
ws.add_roots(&mut roots);
let (mut vfs, roots) = Vfs::new(roots);
let mut load = |path: &Path| {
let vfs_file = vfs.load(path);