[package]
name = "sails-rs"
description = "Main abstractions for the Sails framework"
documentation = "https://docs.rs/sails-rs"
readme = "../README.md"
version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true

[dependencies]
alloy-primitives = { workspace = true, optional = true }
alloy-sol-types = { workspace = true, optional = true }
convert_case = { workspace = true, optional = true }
futures.workspace = true
gear-core-errors.workspace = true
gcore.workspace = true
gprimitives.workspace = true
gstd = { workspace = true, optional = true }
gsys.workspace = true
gwasm-builder = { workspace = true, optional = true }
hashbrown.workspace = true
hex.workspace = true
keccak-const.workspace = true
mockall = { workspace = true, optional = true }
parity-scale-codec = { workspace = true, features = ["derive"] }
paste.workspace = true
pin-project-lite.workspace = true
sails-client-gen-v2 = { workspace = true, optional = true }
sails-idl-embed = { workspace = true, optional = true }
sails-idl-gen = { workspace = true, optional = true }
sails-idl-meta.workspace = true
sails-macros.workspace = true
sails-reflect-hash.workspace = true
sails-type-registry = { workspace = true, features = ["derive", "gprimitives"] }
spin.workspace = true
thiserror.workspace = true
tokio-stream = { workspace = true, optional = true }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
gear-core = { workspace = true, optional = true } # Needed for compilation of gstd in native mode
gclient = { workspace = true, optional = true }
gtest = { workspace = true, optional = true }
log = { workspace = true, optional = true }

[dev-dependencies]
tokio = { workspace = true, features = ["rt", "macros"] }

[features]
default = ["gstd"]
build = ["client-builder", "wasm-builder"]
debug = ["gstd?/debug"]
ethexe = [
    "gstd",
    "gprimitives/ethexe",
    "gcore/ethexe",
    "gstd?/ethexe",
    "gsys/ethexe",
    "dep:alloy-primitives",
    "dep:alloy-sol-types",
    "sails-macros/ethexe",
    "sails-reflect-hash/alloy-primitives",
    "sails-type-registry/alloy-primitives",
]
gclient = ["dep:gclient", "dep:tokio-stream"]
gstd = ["dep:gstd", "dep:gear-core"]
gtest = ["std", "dep:gtest", "dep:log", "dep:tokio-stream"]
idl-gen = ["dep:sails-idl-gen"]
client-builder = ["std", "idl-gen", "idl-embed", "dep:sails-client-gen-v2", "dep:convert_case"]
idl-embed = ["dep:sails-idl-embed"]
mockall = ["std", "dep:mockall"]
std = ["futures/std", "sails-idl-gen?/std", "gear-core?/std"]
wasm-builder = ["dep:gwasm-builder"]
