blob: 0061b8afc46f0a1c410a2aa8740b34fbc34e3a65 [file] [log] [blame]
# Copyright 2018 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.
# NOTE: The comments that have [START/END ...] in them are used to identify code snippets that
# appear in the documentation. Please be aware that changes in these blocks will affect the
# documentation on fuchsia.dev.
import("//build/components.gni")
import("//build/rust/rustc_binary.gni")
group("hermetic_tests") {
testonly = true
deps = [ ":hello-world-rust-tests" ]
}
# [START rustc_tests]
rustc_binary("bin") {
name = "hello_world_rust"
# Generates the "bin_test" build target
with_unit_tests = true
edition = "2021"
deps = []
test_deps = [ "//src/lib/fuchsia" ]
sources = [ "src/main.rs" ]
}
# [END rustc_tests]
# [START fuchsia_component]
fuchsia_component("hello-world-rust-component") {
deps = [ ":bin" ]
# Defines the name given to the manifest when included in a fuchsia package.
# In this case: "hello-world-rust.cm"
component_name = "hello-world-rust"
manifest = "meta/hello_world_rust.cml"
}
fuchsia_package("hello-world-rust") {
deps = [
# component-url: fuchsia-pkg://fuchsia.com/hello-world-rust#meta/hello-world-rust.cm
":hello-world-rust-component",
]
}
# [END fuchsia_component]
# [START fuchsia_test]
fuchsia_unittest_package("hello-world-rust-tests") {
deps = [ ":bin_test" ]
}
# [END fuchsia_test]