| # Copyright 2021 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-default/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("tests") { | |
| testonly = true | |
| deps = [ ":hello-world-session-unittests" ] | |
| } | |
| # [START session_binary] | |
| rustc_binary("bin") { | |
| edition = "2021" | |
| output_name = "hello-world-session" | |
| # Generates a GN target for unit-tests with the label `bin_test`, and | |
| # a binary named `hello_world_session_bin_test`. | |
| with_unit_tests = true | |
| deps = [ | |
| "//src/lib/fuchsia", | |
| "//third_party/rust_crates:anyhow", | |
| "//third_party/rust_crates:tracing", | |
| ] | |
| sources = [ "src/main.rs" ] | |
| } | |
| # [END session_binary] | |
| # [START component_package] | |
| fuchsia_component("component") { | |
| component_name = "hello-world-session" | |
| manifest = "meta/hello-world-session.cml" | |
| deps = [ ":bin" ] | |
| } | |
| fuchsia_package("hello-world-session") { | |
| deps = [ ":component" ] | |
| } | |
| # [END component_package] | |
| # Run with `fx test hello-world-session-unittests`. | |
| fuchsia_unittest_package("hello-world-session-unittests") { | |
| deps = [ ":bin_test" ] | |
| } |