Skip to content

Commit d288cc2

Browse files
committed
profile
1 parent a54b307 commit d288cc2

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

wasm-deploy/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ wasm-deploy-derive = { version = "0.6.0", path = "../wasm-deploy-derive" }
2020
cosm-utils = { git = "https://github.com/cryptechdev/cosm-utils.git", features = [
2121
"keyring",
2222
] }
23-
# tendermint-rpc = "0.38"
2423
wasm-opt = { version = "=0.110.2", optional = true }
2524
serde = { version = "1", default-features = false, features = ["derive"] }
2625
serde_json = "1"

wasm-deploy/src/commands.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,8 @@ pub async fn build(
445445
.env("RUSTFLAGS", "-C link-arg=-s")
446446
.env("RUSTUP_TOOLCHAIN", "1.69.0")
447447
.arg("build")
448-
.arg("--release")
448+
.arg("--profile")
449+
.arg(settings.build_profile.as_str())
449450
.arg("--lib")
450451
.arg("--target=wasm32-unknown-unknown")
451452
.args(cargo_args)

wasm-deploy/src/config/workspace_settings.rs

+12
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ pub struct WorkspaceSettings {
2020
pub(crate) deployment_dir: PathBuf,
2121
/// absolute or relative to workspace root
2222
pub(crate) artifacts_dir: PathBuf,
23+
/// absolute or relative to workspace root
24+
pub(crate) build_profile: String,
2325
}
2426

2527
impl WorkspaceSettings {
@@ -36,6 +38,7 @@ impl WorkspaceSettings {
3638
target_dir: workspace_root.join("target"),
3739
deployment_dir: workspace_root.join("deployment"),
3840
artifacts_dir: workspace_root.join("artifacts"),
41+
build_profile: "release".to_string(),
3942
})
4043
}
4144

@@ -90,4 +93,13 @@ impl WorkspaceSettings {
9093
self.artifacts_dir = artifacts_dir;
9194
Ok(self)
9295
}
96+
97+
/// Default path is `artifacts`
98+
pub fn set_build_profile<T: ?Sized + AsRef<str>>(
99+
mut self,
100+
build_profile: &T,
101+
) -> anyhow::Result<Self> {
102+
self.build_profile = build_profile;
103+
Ok(self)
104+
}
93105
}

0 commit comments

Comments
 (0)