#build #cargo #build-script #near #smart-contracts #docker #abi

cargo-near-build

Library for building Rust smart contracts on NEAR, basis of cargo-near crate/CLI

6 releases

new 0.3.2 Nov 19, 2024
0.3.1 Nov 14, 2024
0.3.0 Oct 30, 2024
0.2.0 Oct 16, 2024
0.1.1 Sep 13, 2024

#657 in Magic Beans

Download history 75/week @ 2024-08-27 94/week @ 2024-09-03 549/week @ 2024-09-10 274/week @ 2024-09-17 320/week @ 2024-09-24 310/week @ 2024-10-01 659/week @ 2024-10-08 1057/week @ 2024-10-15 736/week @ 2024-10-22 1023/week @ 2024-10-29 607/week @ 2024-11-05 1238/week @ 2024-11-12

3,715 downloads per month
Used in 4 crates (2 directly)

MIT/Apache

145KB
3.5K SLoC

Crate features

  • build_script - Adds [extended] module for use in build scripts
  • abi_build - Additional functionality, needed for build of ABI separately
  • docker - Adds docker module for functionality of building in docker with WASM reproducibility.

Default features

None are enabled by default

Re-exports

  1. [camino] is re-exported, because it is used in [BuildOpts], and [BuildArtifact] as type of some of fields
  2. [near_abi] is re-exported, because details of ABI generated depends on specific version of near-abi dependency
  3. [bon] is re-exported for the convenience of bon::vec helper macro

Sample usage:

Default:

let artifact = cargo_near_build::build(Default::default()).expect("some error during build");

With some options set:

let build_opts = cargo_near_build::BuildOpts::builder().features("some_contract_feature_1").build();
let artifact = cargo_near_build::build(build_opts).expect("some error during build");

Dependencies

~16–28MB
~468K SLoC