[package]
name = "suppaftp"
version = { workspace = true }
authors = { workspace = true }
categories = { workspace = true }
documentation = "https://docs.rs/suppaftp/"
edition = { workspace = true }
include = [
  "examples/**/*",
  "src/**/*",
  "../../LICENSE-APACHE",
  "../../LICENSE-MIT",
  "../../README.md",
  "../../CHANGELOG.md",
]
keywords = { workspace = true }
license = { workspace = true }
readme = "../../README.md"
repository = { workspace = true }
rust-version = { workspace = true }
description = "A super FTP/FTPS client library for Rust"

[lib]
name = "suppaftp"
path = "src/lib.rs"

[dependencies]
# async
async-native-tls-crate = { package = "async-native-tls", version = "0.6", default-features = false, optional = true }
async-std = { version = "1", optional = true }
async-trait = { version = "0.1", optional = true }
chrono = { version = "0.4", default-features = false, features = ["clock"] }
futures-lite = "2"
futures-rustls = { version = "0.26", optional = true, default-features = false, features = ["tls12", "logging"] }
lazy-regex = "3"
log = "0.4"
# secure
native-tls-crate = { package = "native-tls", version = "0.2", optional = true }
pin-project = { version = "1", optional = true }
rustls-crate = { package = "rustls", version = "0.23", default-features = false, features = ["logging", "std", "tls12"], optional = true }
rustls-pki-types = { version = "1", optional = true, features = ["alloc"] }
thiserror = "2"
tokio = { version = "1", features = ["io-util", "net", "rt", "time"], optional = true }
tokio-rustls-crate = { package = "tokio-rustls", version = "0.26", optional = true, default-features = false, features = ["logging", "tls12"] }

[dev-dependencies]
async-attributes = "1"
env_logger = "^0.11"
pretty_assertions = "1"
rand = "0.10"
testcontainers = { version = "0.27", features = ["blocking"] }
webpki-roots = "1"

[features]
default = []

# Sync features
native-tls = ["native-tls-crate", "secure"]
native-tls-vendored = ["native-tls", "native-tls-crate/vendored"]
rustls-aws-lc-rs = ["rustls-crate", "rustls-crate/aws-lc-rs", "secure"]
rustls-ring = ["rustls-crate", "rustls-crate/ring", "secure"]
secure = []

# Async features
async-secure = []

# Async-std features
async-std = ["dep:async-std", "dep:async-trait", "dep:pin-project"]
async-std-rustls-aws-lc-rs = [
  "dep:futures-rustls",
  "futures-rustls/aws-lc-rs",
  "dep:rustls-pki-types",
  "async-secure",
  "async-std",
]
async-std-rustls-ring = [
  "dep:futures-rustls",
  "futures-rustls/ring",
  "dep:rustls-pki-types",
  "async-secure",
  "async-std",
]
async-std-async-native-tls = [
  "async-std",
  "dep:async-native-tls-crate",
  "async-native-tls-crate/runtime-smol",
  "async-native-tls-crate/futures-util",
  "async-secure",
]
async-std-async-native-tls-vendored = [
  "async-std-async-native-tls",
  "async-native-tls-crate/vendored",
]

# Tokio
tokio = ["dep:tokio", "dep:async-trait", "dep:pin-project"]
tokio-rustls-aws-lc-rs = [
  "dep:tokio-rustls-crate",
  "dep:rustls-pki-types",
  "async-secure",
  "tokio",
  "tokio-rustls-crate/aws-lc-rs",
]
tokio-rustls-ring = [
  "dep:tokio-rustls-crate",
  "dep:rustls-pki-types",
  "async-secure",
  "tokio",
  "tokio-rustls-crate/ring",
]
tokio-async-native-tls = [
  "tokio",
  "dep:async-native-tls-crate",
  "async-native-tls-crate/runtime-tokio",
  "async-secure",
]
tokio-async-native-tls-vendored = [
  "tokio-async-native-tls",
  "async-native-tls-crate/vendored",
]

# Misc features

# Enable deprecated FTP/FTPS methods
deprecated = []
# Disable logging
no-log = ["log/max_level_off"]

[package.metadata.docs.rs]
features = [
  "native-tls",
  "rustls-aws-lc-rs",
  "async-std",
  "tokio",
  "tokio-async-native-tls",
  "async-std-rustls-aws-lc-rs",
  "tokio-rustls-aws-lc-rs",
]
rustdoc-args = ["--cfg", "docsrs"]

[[example]]
name = "rustls"
required-features = ["rustls-aws-lc-rs"]
