blob: 5aa1200835a6206c281518a88c2431cf822d5ebe [file] [log] [blame]
# Copyright 2019 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/config.gni")
import("//build/rust/rustc_binary.gni")
import("//src/sys/build/components.gni")
rustc_binary("bin") {
name = "network_manager"
edition = "2018"
with_unit_tests = true
deps = [
"core:lib",
"//garnet/lib/rust/io_util",
"//sdk/fidl/fuchsia.hardware.ethernet:fuchsia.hardware.ethernet-rustc",
"//sdk/fidl/fuchsia.net:fuchsia.net-rustc",
"//sdk/fidl/fuchsia.net.name:fuchsia.net.name-rustc",
"//sdk/fidl/fuchsia.net.stack:fuchsia.net.stack-rustc",
"//sdk/fidl/fuchsia.netstack:fuchsia.netstack-rustc",
"//sdk/fidl/fuchsia.overnet:fuchsia.overnet-rustc",
"//sdk/fidl/fuchsia.router.config:fuchsia.router.config-rustc",
"//src/connectivity/network/lib/dns_server_watcher",
"//src/lib/fdio/rust:fdio",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/network/fidl_fuchsia_hardware_ethernet_ext",
"//src/lib/storage/fuchsia-vfs-watcher",
"//src/lib/syslog/rust:syslog",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:argh",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:log",
"//third_party/rust_crates:thiserror",
]
sources = [
"src/eventloop.rs",
"src/fidl_worker.rs",
"src/main.rs",
"src/oir_worker.rs",
"src/overnet_worker.rs",
]
}
resource("device-schema") {
sources = [ "data/device_schema.json" ]
outputs = [ "data/device_schema.json" ]
}
fuchsia_component("component") {
component_name = "network-manager"
manifest = "meta/network-manager.cmx"
deps = [
":bin",
":device-schema",
]
}
fuchsia_component("component-netemul") {
testonly = true
component_name = "network-manager-netemul"
manifest = "meta/network-manager-netemul.cmx"
deps = [
":bin",
":device-schema",
]
}
fuchsia_package("network-manager") {
deps = [ ":component" ]
}
config_data("config-default") {
for_pkg = "network-manager"
sources = [ "config/default.json" ]
outputs = [ "factory_config.json" ]
}
config_data("config-no-ssh-over-wlan") {
for_pkg = "network-manager"
sources = [ "config/no_ssh_over_wlan.json" ]
outputs = [ "factory_config.json" ]
}
config_data("config-toulouse") {
for_pkg = "network-manager"
sources = [ "config/toulouse.json" ]
outputs = [ "factory_config.json" ]
}
fuchsia_component("bin-test") {
component_name = "network-manager-bin-test"
testonly = true
manifest = "meta/network-manager-bin-test.cmx"
deps = [ ":bin_test" ]
}
resource("valid-factory-configs") {
testonly = true
sources = [
"config/no_ssh_over_wlan.json",
"config/toulouse.json",
"testdata/valid_empty.json",
"testdata/valid_factory_config.json",
]
outputs = [ "data/valid_factory_configs/{{source_file_part}}" ]
}
resource("default-valid-factory-configs") {
testonly = true
sources = [ "config/default.json" ]
outputs = [ "data/valid_factory_configs/config.json" ]
}
resource("invalid-factory-configs") {
testonly = true
sources = [ "testdata/invalid_empty.json" ]
outputs = [ "data/invalid_factory_configs/{{source_file_part}}" ]
}
fuchsia_component("core-lib-test") {
component_name = "network-manager-core-lib-test"
testonly = true
manifest = "meta/network-manager-core-lib-test.cmx"
deps = [
":default-valid-factory-configs",
":device-schema",
":invalid-factory-configs",
":valid-factory-configs",
"core:lib_test",
]
}
fuchsia_component("core-interface-lib-test") {
component_name = "network-manager-core-interface-lib-test"
testonly = true
manifest = "meta/network-manager-core-interface-lib-test.cmx"
deps = [ "core/interface:lib_test" ]
}
fuchsia_test_package("network-manager-tests") {
test_components = [
":bin-test",
":core-lib-test",
":core-interface-lib-test",
]
}
group("tests") {
testonly = true
deps = [ ":network-manager-tests" ]
}