[package]
name = "custom-utils"
version = "0.10.17"
edition = "2021"
description = "Provide customized tools based on features"
repository = "https://github.com/jm-observer/custom-utils.git"

license-file = "LICENSE"
readme = "README.md"

include = [
    "Makefile.toml", "LICENSE", "Cargo.toml", "README.md", "src/**/*.rs"
]

[dependencies]
anyhow = "1.0"
log = { version = "0.4" }
tokio = { version = "1.18", features = ["signal", "rt-multi-thread", "macros", "time"], optional = true }
# ------------- logger start----------------------
flexi_logger = { version = "=0.29.8", optional = true, features = ["specfile_without_notification", "specfile", "colors"], default-features = false }
lazy_static = { version = "1.4", optional = true }
ansi_term = { version = "0.12", optional = true }
# ------------- tls_util start----------------------
picky = { version = "6.3", features = ["chrono_conversion"], optional = true }
rsa = { version = "0.6", optional = true }
chrono = { version = "0.4", optional = true }
rand = { version = "0.8.5", optional = true }
der-parser = { version = "8", optional = true }
x509-parser = { version = "0.13", features = ["validate", "verify"], optional = true }
# ------------- tls start----------------------
rustls-pemfile = { version = "1", optional = true }
rustls-native-certs = { version = "0.6", optional = true }
rustls = { version = "0.20", optional = true }
# -----------------------------
timer-util = { version = "0.3.2", optional = true }

syn = { version = "2.0", features = ["extra-traits", "full"], optional = true }

home = "=0.5.9"

# ------------- daemon start----------------------
[target.'cfg(target_os="linux")'.dependencies]
libsystemd = { version = "0.5.0", optional = true }


[dev-dependencies]
picky = { version = "6.3", features = ["chrono_conversion"] }
tokio = { version = "1.18", features = ["rt-multi-thread", "macros", "sync", "time"] }
time = "0.3.36"

[features]
default = ["logger"]
dev = []
prod = []
tls = ["rustls-pemfile", "rustls-native-certs", "rustls"]
tls-util = ["picky", "rsa", "chrono", "rand", "der-parser", "x509-parser"]
logger = ["flexi_logger", "lazy_static", "ansi_term"]
daemon-async = ["libsystemd", "tokio"]
daemon-sync = ["libsystemd"]
timer = ["timer-util"]
derive = ["syn"]

[[example]]
name = "parse_derive"
required-features = ["derive"]
path = "examples/parse_derive.rs"

[[example]]
name = "self_sign_cert"
required-features = ["tls-util"]
path = "examples/self_sign_cert.rs"
[[example]]
name = "timer"
required-features = ["timer"]
path = "examples/timer.rs"
[[test]]
name = "util_tls_util"
required-features = ["tls_util"]
path = "tests/util_tls_util.rs"
[[test]]
name = "util_tls_util_print"
required-features = ["tls_util"]
path = "tests/util_tls_util_print.rs"