[package]
name = "gcop-rs"
version = "0.6.0"
edition = "2024"
rust-version = "1.92.0"
license = "MIT"
description = "AI-powered Git commit message generator and code reviewer"
authors = [
    "AptS-1547 <apts-1547@esaps.net>",
    "AptS-1738 <apts-1738@esaps.net>",
    "uaih3k9x <uaih3k9x@gmail.com>"
]
repository = "https://github.com/AptS-1547/gcop-rs"
homepage = "https://github.com/AptS-1547/gcop-rs"
keywords = ["git", "commit", "ai", "code-review", "cli"]
categories = ["command-line-utilities", "development-tools"]
readme = "README.md"

# 优化配置
[profile.dev]
opt-level = 1
lto = false
codegen-units = 16
panic = "unwind"
strip = false
incremental = true

[profile.release]
opt-level = "s"
lto = true
codegen-units = 1
panic = "abort"
strip = false

[profile.release-debug]
inherits = "release"
codegen-units = 1
debug = true
strip = false
lto = false

[dependencies]
anyhow = "1.0"
async-trait = "0.1"
bytes = "1.10"
chrono = { version = "0.4", features = ["serde"] }
clap = { version = "4.5", features = ["derive", "color"] }
colored = "3"
config = "0.15"
dialoguer = { version = "0.12", features = ["editor"] }
directories = "6.0"
edit = "0.1"
futures = "0.3"
git2 = {version = "0.20", default-features = false }
httpdate = "1.0"
indicatif = "0.18.3"
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls", "socks", "stream"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
thiserror = "2.0"
tokio = { version = "1.42", features = ["full"] }
toml = "0.9"
tracing = "0.1"
tracing-subscriber = { version = "0.3.22", features = ["env-filter"] }
mockall = { version = "0.13", optional = true }  # 测试工具
which = "8.0.0"

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

[features]
test-utils = ["mockall"]  # 测试工具 feature

[dev-dependencies]
tempfile = "3.14"           # 临时文件/目录
mockito = "1.6"             # HTTP API mock
pretty_assertions = "1.4"   # 更好的 assert 输出
serial_test = "3.1"         # 环境变量测试串行化
gcop-rs = { path = ".", features = ["test-utils"] }  # 启用测试工具 feature

# cargo-binstall 配置
[package.metadata.binstall]
pkg-url = "{ repo }/releases/download/v{ version }/gcop-rs-v{ version }-{ target }{ archive-suffix }"
bin-dir = "gcop-rs-v{ version }-{ target }{ binary-ext }"
pkg-fmt = "bin"

[package.metadata.binstall.overrides.x86_64-apple-darwin]
pkg-url = "{ repo }/releases/download/v{ version }/gcop-rs-v{ version }-macos-amd64"

[package.metadata.binstall.overrides.aarch64-apple-darwin]
pkg-url = "{ repo }/releases/download/v{ version }/gcop-rs-v{ version }-macos-arm64"

[package.metadata.binstall.overrides.x86_64-unknown-linux-gnu]
pkg-url = "{ repo }/releases/download/v{ version }/gcop-rs-v{ version }-linux-amd64"

[package.metadata.binstall.overrides.aarch64-unknown-linux-gnu]
pkg-url = "{ repo }/releases/download/v{ version }/gcop-rs-v{ version }-linux-arm64"

[package.metadata.binstall.overrides.x86_64-pc-windows-msvc]
pkg-url = "{ repo }/releases/download/v{ version }/gcop-rs-v{ version }-windows-amd64.exe"

[package.metadata.binstall.overrides.aarch64-pc-windows-msvc]
pkg-url = "{ repo }/releases/download/v{ version }/gcop-rs-v{ version }-windows-aarch64.exe"
