blob: c95cb97709656e2182f832add897ac46e6289a4d [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/components.gni")
import("//src/connectivity/network/unified_binary/network_unified_binary.gni")
import("//src/sys/core/build/core_shard.gni")
declare_args() {
enable_netstack2_tracing = false
}
_netstack2_component = "netstack:component"
if (enable_netstack2_tracing) {
_netstack2_component = "netstack:component-with-tracing-dropin"
}
fuchsia_component("component") {
component_name = "network"
manifest = "meta/network-default.cml"
}
# TODO(https://fxbug.dev/42166351): use subassembly-based product assembly to
# assemble the network realm from shards depending on the product, rather than
# creating two separate component manifests and relying on include shards to
# reduce duplication.
fuchsia_component("component-basic") {
component_name = "network"
manifest = "meta/network-basic.cml"
}
# Enabling a soft-transition, remove when complete
# TODO(122864) Remove transitional labels
group("for_transition") {
}
# Some tests depend on Netstack, but don't exercise its functionality and
# don't care between Netstack 2 and 3. These tests currently use NS2,
# which is unavailable on RISC-V. Instead, use NS3 there. Once NS3 is
# widely deployed, this group can be deleted.
# TODO(https://fxbug.dev/42083163): Define a package here instead of a group, then
# use it as a subpackage within the tests that need it.
group("netstack-for-tests") {
deps = [ "netstack:component" ]
if (current_cpu == "riscv64") {
deps -= [ "netstack:component" ]
deps += [ "netstack3:component-dropin" ]
}
}
group("netstack-debug-for-tests") {
testonly = true
deps = [ "netstack:component-debug" ]
if (current_cpu == "riscv64") {
deps -= [ "netstack:component-debug" ]
deps += [ "netstack3:component-debug-dropin" ]
}
}
fuchsia_package("netstack2") {
package_name = "netstack"
deps = [ _netstack2_component ]
visibility = [
":*",
"//bundles/assembly:*",
"//src/connectivity/network/tests/benchmarks/socket-loopback:*",
]
}
network_unified_binary_regular_and_gub_packages("netstack3") {
package_name = "netstack3"
gub_deps = [
# TODO(https://fxbug.dev/42076541): Move this component out of this package
# and into the network package once both Netstack2 and Netstack3 are using
# the component for all DHCPv4 functionality.
"dhcpv4/client/bindings:component",
"netstack3:component",
]
visibility = [
":*",
"//bundles/assembly:*",
]
}
network_unified_binary_regular_and_gub_packages("netstack-migration") {
gub_deps = [
"netstack-proxy:component",
"stack-migration:component",
]
visibility = [
":*",
"//bundles/assembly:*",
]
}
# TODO(https://fxbug.dev/42073789) Remove transitional labels
group("virtualization-core-shard") {
}
core_shard("persistence-core-shard") {
shard_file = "meta/persistence.core_shard.cml"
}
group("drivers") {
deps = [ "drivers/network-device" ]
}
group("tests") {
testonly = true
deps = [
"dhcpv4:tests",
"dhcpv6:tests",
"dns:tests",
"drivers:tests",
"lib:tests",
"mdns:tests",
"net-cli:tests",
"netlink:tests",
"stack-migration:tests",
# Ensure this target doesn't rot. This dependency can be removed if the
# target becomes load bearing elsewhere.
"netstack:component-with-tracing-dropin",
"netstack:tests",
"netstack-proxy:tests",
"netstack3:tests",
"testing:tests",
"tests",
"tools:tests",
"tun:tests",
]
}