# Copyright (C) 2023 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

[package]
name = "download_server"
version = "1.0.0"
edition = "2021"
license = "Apache-2.0"

[features]
default = ["oh"]

oh = [
    "hilog_rust",
    "hisysevent",
    "hitrace_meter_rust",
    "ipc",
    "samgr",
    "system_ability_fwk",
]

[dependencies]
rdb = { path = "../common/database" }
ylong_runtime = { git = "https://gitcode.com/openharmony/commonlibrary_rust_ylong_runtime", features = ["full"] }
ylong_http_client = { git = "https://gitcode.com/openharmony/commonlibrary_rust_ylong_http", features = [
    "async",
    "c_openssl_3_0",
    "http1_1",
    "ylong_base",
] }

request_utils = { path = "../common/utils" }
hilog_rust = { git = "https://gitcode.com/openharmony/hiviewdfx_hilog", optional = true }
hisysevent = { git = "https://gitcode.com/openharmony/hiviewdfx_hisysevent", optional = true }
hitrace_meter_rust = { git = "https://gitcode.com/openharmony/hiviewdfx_hitrace", optional = true }
ipc = { git = "https://gitcode.com/openharmony/communication_ipc", optional = true }
samgr = { git = "https://gitcode.com/openharmony/systemabilitymgr_samgr", optional = true }
system_ability_fwk = { git = "https://gitcode.com/openharmony/systemabilitymgr_safwk", optional = true }

cxx = "1.0.115"
log = "0.4.22"
env_logger = "0.11.3"
mockall = { version = "0.12.1", features = ["nightly"] }
mockall_double = "0.3.1"
rusqlite = "0.32.0"
rand = "0.8.5"

[dev-dependencies]
test_common = { path = "../test/rustest", features = [] }
once_cell = "1.17.0"

[profile.release]
opt-level = "z"
codegen-units = 1