Skip to content
This repository has been archived by the owner on Dec 11, 2024. It is now read-only.

Commit

Permalink
delete all stub targets
Browse files Browse the repository at this point in the history
  • Loading branch information
noise64 committed Nov 12, 2024
1 parent 405586c commit 9713ad1
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions wasm-rpc-stubgen/src/commands/declarative.rs
Original file line number Diff line number Diff line change
Expand Up @@ -770,15 +770,13 @@ async fn build_stub(ctx: &ApplicationContext, component_name: &str) -> anyhow::R
})
.collect();

let stub_wasm = ctx.application.stub_wasm(component_name);
let stub_wit = ctx.application.stub_wit(component_name);

if is_up_to_date(
ctx.config.skip_up_to_date_checks,
|| stub_inputs,
|| {
[
ctx.application.stub_wasm(component_name),
ctx.application.stub_wit(component_name),
]
},
|| [stub_wit.clone(), stub_wasm.clone()],
) {
log_skipping_up_to_date(format!(
"building wasm rpc stub for {}",
Expand All @@ -793,19 +791,16 @@ async fn build_stub(ctx: &ApplicationContext, component_name: &str) -> anyhow::R
let _indent = LogIndent::new();

delete_path("stub temp build dir", &target_root)?;
delete_path("stub wit", &stub_wit)?;
delete_path("stub wasm", &stub_wasm)?;

log_action(
"Creating",
format!("stub temp build dir {}", target_root.log_color_highlight()),
);
std::fs::create_dir_all(&target_root)?;

commands::generate::build(
&stub_def,
&ctx.application.stub_wasm(component_name),
&ctx.application.stub_wit(component_name),
)
.await?;
commands::generate::build(&stub_def, &stub_wasm, &stub_wit).await?;

delete_path("stub temp build dir", &target_root)?;

Expand Down

0 comments on commit 9713ad1

Please sign in to comment.