Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions crates/build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,31 @@ fn build_components(
fn build_component(build_info: ComponentBuildInfo, app_dir: &Path) -> Result<()> {
match build_info.build {
Some(b) => {
for command in b.commands() {
terminal::step!("Building", "component {} with `{}`", build_info.id, command);
let command_count = b.commands().len();

if command_count > 1 {
terminal::step!(
"Building",
"component {} ({} commands)",
build_info.id,
command_count
);
}

for (index, command) in b.commands().enumerate() {
if command_count > 1 {
terminal::step!(
"Running build step",
"{}/{} for component {} with '{}'",
index + 1,
command_count,
build_info.id,
command
);
} else {
terminal::step!("Building", "component {} with `{}`", build_info.id, command);
}

let workdir = construct_workdir(app_dir, b.workdir.as_ref())?;
if b.workdir.is_some() {
println!("Working directory: {}", quoted_path(&workdir));
Expand Down
2 changes: 1 addition & 1 deletion crates/manifest/src/schema/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ pub struct ComponentBuildConfig {

impl ComponentBuildConfig {
/// The commands to execute for the build
pub fn commands(&self) -> impl Iterator<Item = &String> {
pub fn commands(&self) -> impl ExactSizeIterator<Item = &String> {
let as_vec = match &self.command {
Commands::Single(cmd) => vec![cmd],
Commands::Multiple(cmds) => cmds.iter().collect(),
Expand Down
Loading