Programmatic implementation of Scrypto compiler which is a wrapper around rust cargo tool.
To create an instance of ScryptoCompiler
use builder()
constructor which implements builder pattern,
provide any required parameter @see ScryptoCompilerInputParams
and finally call compile()
function.
ScryptoCompiler
supports worspace compilation by providing workspace manifest as manifest_path
parameter of
running compiler from directory containg workspace Cargo.toml file. Only packages with defined metadata group:
[package.metadata.scrypto] will be used during workspace compilation (so workspace manifest can contain also non
Scrypto packages). Alternativelly packages for workspace compilation can be provided in package
input parameter,
metadata is not validated in that case.
Compilation results consists of list of BuildArtifacts
which contains generated WASM file path and its content
and path to RPD file with package definition and PackageDefinition
struct.