blob: 2e4d1b708e168a58477ce9ec0cf7077e148193fe [file] [log] [blame]
# 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.
# This file was generated by the `fx create` command. The template
# is located at `//tools/create/templates/component-v1/BUILD.gn.tmpl-rust`.
# If you find something broken, we are eager to review fixes.
import("//build/components.gni")
import("//build/rust/rustc_binary.gni")
group("my-component-v1-rust") {
testonly = true
deps = [
":package",
":tests",
]
}
group("tests") {
testonly = true
deps = [ ":my-component-v1-rust-unittests" ]
}
rustc_binary("bin") {
output_name = "my-component-v1-rust"
# Generates a GN target for unit-tests with the label `bin_test`, and
# a binary named `my_component_v1_rust_bin_test`.
with_unit_tests = true
deps = [
"//src/lib/diagnostics/inspect/rust",
"//src/lib/fuchsia",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:tracing",
]
sources = [ "src/main.rs" ]
}
fuchsia_component("component") {
component_name = "my-component-v1-rust"
manifest = "meta/my-component-v1-rust.cmx"
deps = [ ":bin" ]
}
fuchsia_package("package") {
package_name = "my-component-v1-rust"
deps = [ ":component" ]
}
# Run with `fx test my-component-v1-rust-unittests`.
fuchsia_unittest_package("my-component-v1-rust-unittests") {
deps = [ ":bin_test" ]
}