[workspace]
resolver = "2"
members = [
    "ixa-*",
    "examples/basic-infection",
    "examples/births-deaths",
    "examples/profiling",
    "integration-tests/ixa-*",
]
exclude = ["docs/book/models/disease_model"]

[workspace.package]
edition = "2021"
repository = "https://github.com/CDCgov/ixa"
license = "Apache-2.0"
homepage = "https://github.com/CDCgov/ixa"
authors = ["The Ixa Developers <cfa@cdc.gov>"]

[workspace.dependencies]
approx = "^0.5.1"
rand = { version = "^0.9.2", features = ["std", "small_rng"] }
rand_distr = "^0.5.1"
csv = "^1.3.1"
serde = { version = "^1.0.217", features = ["derive"] }
serde_derive = "^1.0.217"
serde_json = "^1.0.135"
bincode = { version = "^2.0.1", default-features = false, features = [
    "std",
    "serde",
] }
ixa-derive = { version = "2.0.0-beta.1", path = "ixa-derive" }
seq-macro = "^0.3.5"
paste = "^1.0.15"
ctor = "^0.5.0"
clap = { version = "^4.5.26", features = ["derive"] }
clap-markdown = "0.1.5"
log = "^0.4.22"
log4rs = { version = "^1.3.0", default-features = false, features = [
    "console_appender",
] }
xxhash-rust = { version = "^0.8.15", features = ["const_xxh3", "xxh3"] }
rustc-hash = "^2.1.1"
tempfile = "^3.15.0"
assert_cmd = "^2.0.16"
criterion = "^0.7.0"
assert_approx_eq = "^1.1.0"
strum = { version = "^0.27.1", features = ["derive"] }
quote = "^1.0.38"
syn = { version = "^2.0.95" }
proc-macro2 = "1.0.93"
proc-macro-crate = "3.3.0"
delegate = "^0.13.3"
web-sys = "^0.3.77"
getrandom = "0.3.4"
fern = "^0.7.1"
wasm-bindgen = "^0.2.100"
progress_bar = "^1.2.1"
anyhow = "^1.0.28"
sysinfo = "^0.37.0"
humantime = "^2.2.0"
bytesize = "^2.0.1"
hashbrown = "^0.16.0"
ouroboros = "^0.18.5"
thiserror = "^2.0.11"
smallbox = "^0.8.8"
smallvec = "^1.15.1"

[package]
name = "ixa"
version = "2.0.0-beta2.1"
rust-version = "1.88.0"
description = "A framework for building agent-based models"
repository.workspace = true
license.workspace = true
edition.workspace = true
homepage.workspace = true
authors.workspace = true

[features]
default = ["logging", "progress_bar", "profiling"]

logging = ["log4rs", "fern", "wasm-bindgen", "web-sys"]
progress_bar = ["dep:progress_bar", "anyhow"]

profiling = ["dep:sysinfo", "dep:bytesize"]

# Only used to write `cli-usage.md` from clap-generated docs.
write_cli_usage = ["clap-markdown"]

[dependencies]
approx.workspace = true
bincode.workspace = true
clap.workspace = true
csv.workspace = true
ctor.workspace = true
ixa-derive.workspace = true
log.workspace = true
paste.workspace = true
rand.workspace = true
seq-macro.workspace = true
serde.workspace = true
serde_derive.workspace = true
serde_json.workspace = true
delegate.workspace = true
sysinfo = { workspace = true, optional = true }
humantime.workspace = true
bytesize = { workspace = true, optional = true }
hashbrown.workspace = true
xxhash-rust.workspace = true
rustc-hash.workspace = true
thiserror.workspace = true
smallvec.workspace = true
smallbox.workspace = true

# Building docs
clap-markdown = { workspace = true, optional = true }
ouroboros.workspace = true
indexmap = "2.13.0"

# Non-WASM targets
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
# Logging
log4rs = { workspace = true, optional = true }

# Progress Bar
progress_bar = { workspace = true, optional = true, features = ["logger"] }
anyhow = { workspace = true, optional = true }

[target.'cfg(target_arch = "wasm32")'.dependencies]
fern = { workspace = true, optional = true }
# Required here only to enable the js backend:
getrandom = { workspace = true, features = ["wasm_js"] }
wasm-bindgen = { workspace = true, optional = true }
web-sys = { workspace = true, optional = true, features = ["console", "Performance", "Window"] }

[dev-dependencies]
assert_approx_eq.workspace = true
assert_cmd.workspace = true
criterion.workspace = true
rand_distr.workspace = true
tempfile.workspace = true

# Example Libraries
ixa_example_basic_infection = { path = "examples/basic-infection" }
ixa_example_births_deaths = { path = "examples/births-deaths" }

[workspace.lints.rust]
mismatched_lifetime_syntaxes = "allow"

# https://rust-lang.github.io/rust-clippy/master/index.html
[workspace.lints.clippy]
module-name-repetitions = "allow"
module_inception = "allow"
result_unit_err = "allow"
uninlined_format_args = "allow"
upper-case-acronyms = "allow"

[lints]
workspace = true

[lib]
# Prevent Cargo from implicitly linking `libtest` for Criterion.rs compatibility.
# See https://github.com/CDCgov/ixa/issues/217
bench = false
