|  | # Copyright 2022 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. | 
|  |  | 
|  | load( | 
|  | "@rules_fuchsia//fuchsia:defs.bzl", | 
|  | "fuchsia_cc_binary", | 
|  | "fuchsia_cc_test", | 
|  | "fuchsia_component", | 
|  | "fuchsia_component_manifest", | 
|  | "fuchsia_package", | 
|  | "fuchsia_select", | 
|  | "fuchsia_unittest_package", | 
|  | ) | 
|  |  | 
|  | fuchsia_cc_binary( | 
|  | name = "hello_world", | 
|  | srcs = [ | 
|  | "hello_world.cc", | 
|  | ], | 
|  | deps = [ | 
|  | "@fuchsia_sdk//pkg/fdio", | 
|  | "@fuchsia_sdk//pkg/syslog", | 
|  | ], | 
|  | ) | 
|  |  | 
|  | fuchsia_component_manifest( | 
|  | name = "manifest", | 
|  | src = "meta/hello_world.cml", | 
|  | includes = ["@fuchsia_sdk//pkg/syslog:client"], | 
|  | ) | 
|  |  | 
|  | fuchsia_component( | 
|  | name = "component", | 
|  | manifest = ":manifest", | 
|  | deps = [":hello_world"], | 
|  | ) | 
|  |  | 
|  | fuchsia_package( | 
|  | name = "pkg", | 
|  | package_name = "hello_world", | 
|  | components = [ | 
|  | ":component", | 
|  | ], | 
|  | visibility = ["//visibility:public"], | 
|  | ) | 
|  |  | 
|  | fuchsia_cc_test( | 
|  | name = "hello_test", | 
|  | size = "small", | 
|  | srcs = ["hello_test.cc"], | 
|  | deps = [] + fuchsia_select({ | 
|  | "@platforms//os:fuchsia": [ | 
|  | "@fuchsia_sdk//pkg/fdio", | 
|  | "@fuchsia_sdk//pkg/syslog", | 
|  | ], | 
|  | }), | 
|  | ) | 
|  |  | 
|  | fuchsia_cc_test( | 
|  | name = "hello_gtest", | 
|  | size = "small", | 
|  | srcs = ["hello_gtest.cc"], | 
|  | deps = ["@com_google_googletest//:gtest_main"] + fuchsia_select({ | 
|  | "@platforms//os:fuchsia": [ | 
|  | "@fuchsia_sdk//pkg/fdio", | 
|  | "@fuchsia_sdk//pkg/syslog", | 
|  | ], | 
|  | }), | 
|  | ) | 
|  |  | 
|  | fuchsia_unittest_package( | 
|  | name = "test_pkg", | 
|  | package_name = "hello_test", | 
|  | unit_tests = [ | 
|  | ":hello_gtest", | 
|  | ":hello_test", | 
|  | ], | 
|  | visibility = ["//visibility:public"], | 
|  | ) |