Skip to content

Commit

Permalink
Merge pull request #83 from crazymerlyn/bins
Browse files Browse the repository at this point in the history
feat: Support `--bins`
  • Loading branch information
epage authored Feb 25, 2024
2 parents 38fddf5 + 8acd949 commit 8b91740
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,28 @@ impl CargoBuild {
pub fn package<S: AsRef<ffi::OsStr>>(self, name: S) -> Self {
self.arg("--package").arg(name)
}

/// Build all binaries.
///
/// # Example
///
/// ```rust
/// extern crate escargot;
/// extern crate assert_fs;
///
/// let temp = assert_fs::TempDir::new().unwrap();
/// escargot::CargoBuild::new()
/// .bins()
/// .manifest_path("tests/fixtures/bin/Cargo.toml")
/// .target_dir(temp.path())
/// .exec()
/// .unwrap();
/// ```
pub fn bins(mut self) -> Self {
self.bin = true;
self.arg("--bins")
}

/// Build only `name` binary.
///
/// # Example
Expand Down

0 comments on commit 8b91740

Please sign in to comment.