forc_pkg

Function compile

Source
pub fn compile(
    pkg: &PackageDescriptor,
    profile: &BuildProfile,
    engines: &Engines,
    namespace: Root,
    source_map: &mut SourceMap,
    experimental: ExperimentalFeatures,
) -> Result<CompiledPackage>
Expand description

Compiles the given package.

§Program Types

Behaviour differs slightly based on the package’s program type.

§Library Packages

A Library package will have JSON ABI generated for all publicly exposed abis. The library’s namespace is returned as the second argument of the tuple.

§Contract

Contracts will output both their JSON ABI and compiled bytecode.

§Script, Predicate

Scripts and Predicates will be compiled to bytecode and will not emit any JSON ABI.