9 releases (4 stable)

2.1.0 Mar 10, 2023
2.0.2 Mar 1, 2023
2.0.1 Feb 20, 2023
2.0.0-rc Jan 12, 2023
2.0.0-beta.1 Dec 7, 2022

#1252 in Magic Beans

Download history 148/week @ 2022-12-03 274/week @ 2022-12-10 236/week @ 2022-12-17 118/week @ 2022-12-24 148/week @ 2022-12-31 298/week @ 2023-01-07 439/week @ 2023-01-14 665/week @ 2023-01-21 939/week @ 2023-01-28 687/week @ 2023-02-04 852/week @ 2023-02-11 913/week @ 2023-02-18 1308/week @ 2023-02-25 860/week @ 2023-03-04 1234/week @ 2023-03-11 839/week @ 2023-03-18

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

Apache-2.0

200KB
4.5K SLoC

contract-build

A crate for building ink! smart contracts. Used by cargo-contract.

Usage

use contract_build::{
    ManifestPath,
    Verbosity,
    BuildArtifacts,
    BuildMode,
    Features,
    Network,
    OptimizationPasses,
    OutputType,
    UnstableFlags,
};

let manifest_path = ManifestPath::new("my-contract/Cargo.toml").unwrap();

let args = contract_build::ExecuteArgs {
    manifest_path,
    verbosity: Verbosity::Default,
    build_mode: BuildMode::Release,
    features: Features::default(),
    network: Network::Online,
    build_artifact: BuildArtifacts::All,
    unstable_flags: UnstableFlags::default(),
    optimization_passes: Some(OptimizationPasses::default()),
    keep_debug_symbols: false,
    lint: false,
    output_type: OutputType::Json,
    skip_wasm_validation: false,
};

contract_build::execute(args);

Dependencies

~13–19MB
~398K SLoC