Skip to content

Commit

Permalink
chore: replace cargo-near with cargo-near-build (#373)
Browse files Browse the repository at this point in the history
  • Loading branch information
dj8yfo authored Sep 5, 2024
1 parent ef66d9d commit 0ead99d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
2 changes: 1 addition & 1 deletion workspaces/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ async-trait = "0.1"
base64 = "0.22"
bs58 = "0.5"
cargo_metadata = { version = "0.18", optional = true }
cargo-near = { version = "0.8", default-features = false }
cargo-near-build = { version = "0.1.0" }
chrono = "0.4.19"
fs2 = "0.4"
rand = "0.8.4"
Expand Down
21 changes: 7 additions & 14 deletions workspaces/src/cargo/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,23 @@ pub async fn compile_project(project_path: &str) -> crate::Result<Vec<u8>> {
_ => ErrorKind::Io.custom(e),
})?;

let cargo_opts = cargo_near::BuildOpts {
no_release: false,
no_embed_abi: false,
// `no_abi` has become flipped true -> false
let cargo_opts = cargo_near_build::BuildOpts {
no_locked: true,
no_doc: true,
color: None,
no_abi: true,
out_dir: None,
manifest_path: Some(
cargo_near::types::utf8_path_buf::Utf8PathBuf::from_path_buf(
project_path.join("Cargo.toml"),
)
.map_err(|error_path| {
cargo_near_build::camino::Utf8PathBuf::from_path_buf(project_path.join("Cargo.toml"))
.map_err(|error_path| {
ErrorKind::Io.custom(format!(
"Unable to construct UTF-8 path from: {}",
error_path.display()
))
})?,
),
features: None,
no_default_features: false,
..Default::default()
};

let compile_artifact = cargo_near::build(cargo_opts).map_err(|e| ErrorKind::Io.custom(e))?;
let compile_artifact =
cargo_near_build::build(cargo_opts).map_err(|e| ErrorKind::Io.custom(e))?;

let file = compile_artifact
.path
Expand Down

0 comments on commit 0ead99d

Please sign in to comment.