Struct rustwide::BuildBuilder [−][src]
pub struct BuildBuilder<'a> { /* fields omitted */ }
Expand description
Builder for configuring builds in a BuildDirectory
.
Implementations
Add a patch to this build.
Patches get added to the crate’s Cargo.toml in the patch.crates-io
table.
Example
let mut build_dir = workspace.build_dir("foo"); build_dir.build(&toolchain, &krate, sandbox) .patch_with_git("bar", "https://github.com/foo/bar", "baz") .run(|build| { build.cargo().args(&["test", "--all"]).run()?; Ok(()) })?;
Run a sandboxed build of the provided crate with the provided toolchain. The closure will
be provided an instance of Build
that allows spawning new processes
inside the sandbox.
All the state will be kept on disk as long as the closure doesn’t exit: after that things might be removed.
Example
let mut build_dir = workspace.build_dir("foo"); build_dir.build(&toolchain, &krate, sandbox).run(|build| { build.cargo().args(&["test", "--all"]).run()?; Ok(()) })?;