| # 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. |
| |
| assert(is_fuchsia, "These targets are only compiled in the fuchsia toolchain.") |
| |
| import("//build/components.gni") |
| import("//build/test.gni") |
| |
| source_set("lib") { |
| sources = [ |
| "file_utils.cc", |
| "file_utils.h", |
| "profile.cc", |
| "profile.h", |
| "profile_store.cc", |
| "profile_store.h", |
| ] |
| |
| public_deps = [ |
| "fidl:fuchsia.examples.diagnostics_hlcpp", |
| "//src/lib/files", |
| "//src/lib/json_parser", |
| "//zircon/system/ulib/async:async-cpp", |
| ] |
| } |
| |
| executable("example_profile_store_bin") { |
| sources = [ "main.cc" ] |
| |
| deps = [ |
| ":lib", |
| "//sdk/lib/fidl/cpp", |
| "//sdk/lib/sys/cpp", |
| "//src/lib/fxl:fxl_cli", |
| "//zircon/system/ulib/async:async-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| ] |
| } |
| |
| executable("example_profile_writer") { |
| sources = [ "profile_writer.cc" ] |
| |
| deps = [ |
| "fidl:fuchsia.examples.diagnostics_hlcpp", |
| "//sdk/lib/fidl/cpp", |
| "//sdk/lib/sys/cpp", |
| "//sdk/lib/syslog/cpp", |
| "//src/lib/fxl:fxl_cli", |
| "//zircon/system/ulib/async:async-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| ] |
| } |
| |
| executable("example_profile_reader") { |
| sources = [ "profile_reader.cc" ] |
| |
| deps = [ |
| "fidl:fuchsia.examples.diagnostics_hlcpp", |
| "//sdk/lib/fidl/cpp", |
| "//sdk/lib/sys/cpp", |
| "//sdk/lib/syslog/cpp", |
| "//src/lib/fxl:fxl_cli", |
| "//zircon/system/ulib/async:async-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| ] |
| } |
| |
| fuchsia_component("add_olive") { |
| deps = [ ":example_profile_writer" ] |
| manifest = "meta/add_olive.cml" |
| } |
| |
| fuchsia_component("add_jane") { |
| deps = [ ":example_profile_writer" ] |
| manifest = "meta/add_jane.cml" |
| } |
| |
| fuchsia_component("add_balance_olive") { |
| deps = [ ":example_profile_writer" ] |
| manifest = "meta/add_balance_olive.cml" |
| } |
| |
| fuchsia_component("withdraw_balance_olive") { |
| deps = [ ":example_profile_writer" ] |
| manifest = "meta/withdraw_balance_olive.cml" |
| } |
| |
| fuchsia_component("delete_olive") { |
| deps = [ ":example_profile_writer" ] |
| manifest = "meta/delete_olive.cml" |
| } |
| |
| fuchsia_component("profile_reader") { |
| deps = [ ":example_profile_reader" ] |
| manifest = "meta/profile_reader.cml" |
| } |
| |
| fuchsia_component("profile_store") { |
| deps = [ ":example_profile_store_bin" ] |
| manifest = "meta/profile_store.cml" |
| } |
| |
| fuchsia_component("laboratory_server") { |
| manifest = "meta/laboratory_server.cml" |
| } |
| |
| fuchsia_package("profile_store_example") { |
| deps = [ |
| ":add_balance_olive", |
| ":add_jane", |
| ":add_olive", |
| ":delete_olive", |
| ":laboratory_server", |
| ":profile_reader", |
| ":profile_store", |
| ":withdraw_balance_olive", |
| ] |
| } |
| |
| executable("example_test_bin") { |
| testonly = true |
| output_name = "profile_store_example_unittests" |
| |
| sources = [ |
| "profile_store_unittest_example.cc", |
| "profile_unittest_example.cc", |
| ] |
| |
| deps = [ |
| ":lib", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/lib/testing/loop_fixture", |
| ] |
| } |
| |
| fuchsia_unittest_package("profile_store_example_unittests") { |
| deps = [ ":example_test_bin" ] |
| manifest = "meta/profile_store_example_unittests.cml" |
| } |
| |
| group("workshop") { |
| deps = [ |
| ":profile_store_example", |
| "fidl:fuchsia.examples.diagnostics_hlcpp", |
| ] |
| } |
| |
| group("hermetic_tests") { |
| testonly = true |
| deps = [ |
| ":profile_store_example_unittests", |
| "example-integration:hermetic_tests", |
| ] |
| } |