| # Copyright 2020 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//build/components.gni") |
| import("//build/rust/rustc_binary.gni") |
| import("//build/rust/rustc_library.gni") |
| |
| rustc_library("mock-omaha-server") { |
| edition = "2021" |
| with_unit_tests = true |
| |
| deps = [ |
| "//src/lib/fuchsia-sync", |
| "//src/sys/pkg/lib/fuchsia-merkle", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:derive_builder", |
| "//third_party/rust_crates:hex", |
| "//third_party/rust_crates:hyper", |
| "//third_party/rust_crates:omaha_client", |
| "//third_party/rust_crates:p256", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:sha2", |
| "//third_party/rust_crates:tracing", |
| "//third_party/rust_crates:url", |
| ] |
| if (is_fuchsia) { |
| deps += [ |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-hyper", |
| "//third_party/rust_crates:futures", |
| ] |
| } |
| |
| sources = [ "src/lib.rs" ] |
| configs += [ "//build/config/rust/lints:clippy_warn_all" ] |
| } |
| |
| fuchsia_unittest_package("mock-omaha-server-lib-tests") { |
| manifest = "meta/mock-omaha-server-lib-test.cml" |
| deps = [ |
| ":mock-omaha-server_test", |
| "//src/connectivity/network:netstack-for-tests", |
| "//src/connectivity/network/dns:component", |
| ] |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| } |
| |
| if (is_host) { |
| rustc_binary("bin") { |
| output_name = "mock-omaha-server" |
| edition = "2021" |
| |
| deps = [ |
| ":mock-omaha-server", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-hyper", |
| "//src/lib/fuchsia-sync", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:argh", |
| "//third_party/rust_crates:async-net", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:hyper", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:tokio", |
| ] |
| |
| inputs = [ "src/testing_keys/test_private_key.pem" ] |
| |
| sources = [ "src/main.rs" ] |
| configs += [ "//build/config/rust/lints:clippy_warn_all" ] |
| } |
| } |
| |
| group("bin-host") { |
| public_deps = [ ":bin($host_toolchain)" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| public_deps = [ ":mock-omaha-server-lib-tests" ] |
| } |