Function wasm_deploy::commands::optimize
source · pub fn optimize(contracts: &Vec<impl Contract>) -> Result<Status, DeployError>Examples found in repository?
src/commands.rs (line 252)
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256
pub fn build(contracts: &Vec<impl Contract>, cargo_args: &Vec<String>) -> Result<Status, DeployError> {
// Build contracts
for contract in contracts {
Command::new("cargo")
.env("RUSTFLAGS", "-C link-arg=-s")
.arg("build")
.arg("--release")
.arg("--lib")
.arg("--target=wasm32-unknown-unknown")
.args(cargo_args)
.current_dir(format!("./contracts/{}", contract.name()))
.spawn()?
.wait()?
.exit_ok()?;
}
Command::new("mkdir").arg("-p").arg("artifacts").spawn()?.wait()?;
optimize(contracts)?;
set_execute_permissions(contracts)?;
Ok(Status::Quit)
}