[workspace]
resolver = "2"
members = [
    "ixa-*",
    "examples/basic-infection",
    "examples/births-deaths",
    "integration-tests/ixa-*"
]

[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.8.5", features = ["std", "small_rng"] }
csv = "^1.3.1"
serde = { version = "^1.0.217", features = ["derive"] }
serde_derive = "^1.0.217"
serde_json = "^1.0.135"
bincode = "^1.3.3"
reikna = "^0.12.3"
ixa-derive = { version = "0.0.2", path = "ixa-derive" }
seq-macro = "^0.3.5"
paste = "^1.0.15"
ctor = "^0.4.2"
clap = { version = "^4.5.26", features = ["derive"] }
shlex = "^1.3.0"
rustyline = "^15.0.0"
log = "^0.4.22"
log4rs = { version = "^1.3.0", default-features = false, features = [
    "console_appender",
] }
axum = "^0.8.1"
tokio = { version = "^1.45.1", features = ["full"] }
reqwest = { version = "^0.12.12", features = ["blocking", "json"] }
uuid = "^1.12.1"
tower-http = { version = "^0.6.2", features = ["full"] }
mime = "^0.3.17"
rustc-hash = "^2.1.1"
rand_distr = "^0.4.3"
tempfile = "^3.15.0"
assert_cmd = "^2.0.16"
criterion = "^0.5.1"
roots = "0.0.8"
assert_approx_eq = "^1.1.0"
strum = { version = "^0.27.1", features = ["derive"] }
quote = "^1.0.38"
syn = "^2.0.95"
delegate = "^0.13.3"
web-sys = "^0.3.77"
getrandom = "0.2"
fern = "^0.7.1"
wasm-bindgen = "^0.2.100"
progress_bar = "^1.2.1"
anyhow = "^1.0.28"
sysinfo = "^0.35.2"
humantime = "^2.2.0"
bytesize = "^2.0.1"
polonius-the-crab = "^0.4.2"

[package]
name = "ixa"
version = "0.3.2"
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", "debugger", "progress_bar"]

logging = ["log4rs", "fern", "wasm-bindgen",  "web-sys"]
debugger = ["shlex", "rustyline"]
web_api = ["debugger", "mime", "tower-http", "axum", "tokio", "uuid"]
progress_bar = ["dep:progress_bar", "anyhow"]

[dependencies]
approx.workspace = true # Macros
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
rustc-hash.workspace = true
seq-macro.workspace = true
serde.workspace = true
serde_derive.workspace = true
serde_json.workspace = true
delegate.workspace = true
sysinfo.workspace = true
humantime.workspace = true
bytesize.workspace = true
polonius-the-crab.workspace = true

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

# Debugger
rustyline = { workspace = true, optional = true }
shlex = { workspace = true, optional = true }

# Web API
axum = { workspace = true, optional = true }
mime = { workspace = true, optional = true }
tokio = { workspace = true, optional = true }
tower-http = { workspace = true, optional = true }
uuid = { 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 }
getrandom = { workspace = true,  features = ["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

# Only used in web API tests
reqwest = { workspace = true }

# Only used in time-varying-infection
reikna.workspace = true
roots.workspace = true

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

[workspace.lints.clippy]
pedantic = { level = "warn", priority = -1 }
module-name-repetitions = "allow"
implicit_hasher = "allow"
missing_panics_doc = "allow"
missing_errors_doc = "allow"
uninlined_format_args = "allow"
result_unit_err = "allow"
struct_field_names = "allow"
unnecessary_debug_formatting = "allow"
struct_excessive_bools = "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
