| # 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("//src/sys/build/components.gni") |
| |
| rustc_binary("hello_world_bin") { |
| source_root = "src/hello_world.rs" |
| name = "hello_world" |
| edition = "2018" |
| with_unit_tests = true |
| deps = [ "//src/lib/syslog/rust:syslog" ] |
| |
| sources = [ "src/hello_world.rs" ] |
| } |
| |
| rustc_binary("ls_root_pkg_bin") { |
| source_root = "src/ls_root_pkg.rs" |
| name = "ls_root_pkg" |
| edition = "2018" |
| |
| sources = [ "src/ls_root_pkg.rs" ] |
| } |
| |
| rustc_binary("echo_args_bin") { |
| source_root = "src/echo_args.rs" |
| name = "echo_args" |
| edition = "2018" |
| deps = [ "//src/lib/syslog/rust:syslog" ] |
| |
| sources = [ "src/echo_args.rs" ] |
| } |
| |
| rustc_binary("lifecycle_bin") { |
| source_root = "src/lifecycle.rs" |
| name = "lifecycle" |
| edition = "2018" |
| |
| deps = [ |
| "//src/lib/fuchsia-runtime", |
| "//src/lib/syslog/rust:syslog", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| ] |
| |
| sources = [ "src/lifecycle.rs" ] |
| } |
| |
| rustc_binary("lifecycle_full_bin") { |
| source_root = "src/lifecycle_full.rs" |
| name = "lifecycle_full" |
| edition = "2018" |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.process.lifecycle:fuchsia.process.lifecycle-rustc", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-runtime", |
| "//src/lib/syslog/rust:syslog", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:futures-util", |
| ] |
| |
| sources = [ "src/lifecycle_full.rs" ] |
| } |
| |
| fuchsia_component("hello-world") { |
| deps = [ ":hello_world_bin" ] |
| manifest = "meta/hello-world.cml" |
| } |
| |
| fuchsia_component("ls-root-pkg") { |
| deps = [ ":ls_root_pkg_bin" ] |
| manifest = "meta/ls-root-pkg.cml" |
| } |
| |
| fuchsia_component("echo-args") { |
| deps = [ ":echo_args_bin" ] |
| manifest = "meta/echo-args.cml" |
| } |
| |
| fuchsia_component("lifecycle") { |
| deps = [ ":lifecycle_bin" ] |
| manifest = "meta/lifecycle.cml" |
| } |
| |
| fuchsia_component("lifecycle-full") { |
| deps = [ ":lifecycle_full_bin" ] |
| manifest = "meta/lifecycle-full.cml" |
| } |
| |
| fuchsia_package("components-basic-example") { |
| deps = [ |
| ":echo-args", |
| ":hello-world", |
| ":lifecycle", |
| ":lifecycle-full", |
| ":ls-root-pkg", |
| "//src/sys/component_manager:component-manager-for-examples-cmp", |
| ] |
| } |
| |
| fuchsia_component("hello-world-test") { |
| testonly = true |
| deps = [ ":hello_world_bin_test" ] |
| manifest = "meta/hello-world-bin-test.cml" |
| } |
| |
| fuchsia_test_package("hello-world-tests") { |
| test_components = [ ":hello-world-test" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":hello-world-tests", |
| "integration_tests:hello-world-integration-test", |
| ] |
| } |