blob: 0f208c99d3c264508afa11a15108fb97af291f9d [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/package.gni")
import("//build/rust/rustc_binary.gni")
import("//build/test/test_package.gni")
import("//build/testing/environments.gni")
rustc_binary("bin") {
name = "component_manager"
with_unit_tests = true
edition = "2018"
deps = [
"//garnet/examples/fidl/services:echo-rustc",
"//garnet/lib/rust/cm_fidl_translator",
"//garnet/lib/rust/fuchsia_uri",
"//garnet/public/lib/fidl/rust/fidl",
"//garnet/public/rust/fdio",
"//garnet/public/rust/fuchsia-app",
"//garnet/public/rust/fuchsia-async",
"//garnet/public/rust/fuchsia-runtime",
"//garnet/public/rust/fuchsia-syslog",
"//garnet/public/rust/fuchsia-vfs/fuchsia-vfs-pseudo-fs",
"//garnet/public/rust/fuchsia-zircon",
"//sdk/fidl/fuchsia.data:fuchsia.data-rustc",
"//sdk/fidl/fuchsia.data:fuchsia.data-rustc",
"//sdk/fidl/fuchsia.pkg:fuchsia.pkg-rustc",
"//sdk/fidl/fuchsia.sys2:fuchsia.sys2-rustc",
"//sdk/fidl/fuchsia.sys2:fuchsia.sys2-rustc",
"//third_party/rust_crates:failure",
"//third_party/rust_crates:futures-preview",
"//third_party/rust_crates:lazy_static",
"//third_party/rust_crates:regex",
"//third_party/rust_crates:tempfile",
"//third_party/rust_crates:url",
"//third_party/rust_crates:void",
"//zircon/public/fidl/fuchsia-io:fuchsia-io-rustc",
"//zircon/public/fidl/fuchsia-ldsvc:fuchsia-ldsvc-rustc",
"//zircon/public/fidl/fuchsia-process:fuchsia-process-rustc",
]
}
# This manifest is consumed by the ZBI rule in //build/images to add component_manager to bootfs.
generate_manifest("component_manager.bootfs") {
deps = [
":bin",
]
args = [ "--entry=bin/component_manager=" +
rebase_path("$root_build_dir/component_manager", root_build_dir) ]
}
package("component_manager") {
deps = [
":bin",
]
binaries = [
{
name = "rust_crates/component_manager"
dest = "component_manager"
},
]
meta = [
{
path = rebase_path("meta/component_manager.cmx")
dest = "component_manager.cmx"
},
]
}
test_package("component_manager_tests") {
deps = [
":bin",
"//garnet/examples/components/v2:hello_world_bin",
]
tests = [
{
name = "component_manager_bin_test"
dest = "component_manager_tests"
environments = basic_envs
},
]
resources = [
{
path = rebase_path("meta/component_manager_tests_invalid.cm")
dest = "component_manager_tests_invalid.cm"
},
]
meta = [
{
path = rebase_path("meta/component_manager_tests_hello_world.cml")
dest = "component_manager_tests_hello_world.cm"
},
]
binaries = [
{
name = "hello_world"
},
]
}