blob: 7559c661fc29be96c384a621220eb6a57750ad12 [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")
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" ]
}
rustc_binary("ls_root_pkg_bin") {
source_root = "src/ls_root_pkg.rs"
name = "ls_root_pkg"
edition = "2018"
}
rustc_binary("echo_args_bin") {
source_root = "src/echo_args.rs"
name = "echo_args"
edition = "2018"
deps = [ "//src/lib/syslog/rust:syslog" ]
}
rustc_binary("lifecycle") {
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",
]
}
rustc_binary("lifecycle_full") {
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",
]
}
package("components_basic_example") {
deps = [
":echo_args_bin",
":hello_world_bin",
":lifecycle",
":lifecycle_full",
":ls_root_pkg_bin",
]
binaries = [
{
name = "hello_world"
},
{
name = "ls_root_pkg"
},
{
name = "echo_args"
},
{
name = "lifecycle"
},
{
name = "lifecycle_full"
},
]
meta = [
{
path = rebase_path("meta/hello_world.cml")
dest = "hello_world.cm"
},
{
path = rebase_path("meta/ls_root_pkg.cml")
dest = "ls_root_pkg.cm"
},
{
path = rebase_path("meta/echo_args.cml")
dest = "echo_args.cm"
},
{
path = rebase_path("meta/lifecycle.cml")
dest = "lifecycle.cm"
},
{
path = rebase_path("meta/lifecycle_full.cml")
dest = "lifecycle_full.cm"
},
]
}
test_package("hello-world-tests") {
deps = [ ":hello_world_bin_test" ]
v2_tests = [
{
name = "hello_world_bin_test"
environments = basic_envs
},
]
}