|  | # 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/dist/distribution_manifest.gni") | 
|  | import("//build/package.gni") | 
|  | import("//build/test.gni") | 
|  | import("//build/test/test_package.gni") | 
|  |  | 
|  | # Generate a manifest providing all of the .fidl.json files exported by the | 
|  | # core SDK (and any other FIDL files we might want). | 
|  | action("generate_fidl_json") { | 
|  | script = "generate_fidl_json.py" | 
|  | generated_output = "$target_gen_dir/sdk_fidl_json.manifest" | 
|  | inputs = [ "$root_gen_dir/sdk/core.fidl_json.txt" ] | 
|  | outputs = [ "$generated_output" ] | 
|  | depfile = "$target_gen_dir/$target_name.d" | 
|  | testonly = true | 
|  | deps = [ | 
|  | "//sdk:core", | 
|  | "//sdk:core_fidl_json", | 
|  | "//sdk/fidl/fuchsia.boot", | 
|  | "//sdk/fidl/fuchsia.device.manager", | 
|  | "//sdk/fidl/fuchsia.kernel", | 
|  | "//sdk/fidl/fuchsia.power", | 
|  | "//third_party/quickjs:qjs($host_toolchain)", | 
|  | ] | 
|  | args = [ | 
|  | "--out-file", | 
|  | rebase_path("$generated_output", root_build_dir), | 
|  | "--dep-file", | 
|  | rebase_path(depfile, root_build_dir), | 
|  | "@" + rebase_path("$root_gen_dir/sdk/core.fidl_json.txt", root_build_dir), | 
|  | rebase_path( | 
|  | "$root_build_dir/fidling/gen/sdk/fidl/fuchsia.device.manager/fuchsia.device.manager.fidl.json", | 
|  | root_build_dir), | 
|  | rebase_path( | 
|  | "$root_build_dir/fidling/gen/sdk/fidl/fuchsia.power/fuchsia.power.fidl.json", | 
|  | root_build_dir), | 
|  | rebase_path( | 
|  | "$root_build_dir/fidling/gen/sdk/fidl/fuchsia.kernel/fuchsia.kernel.fidl.json", | 
|  | root_build_dir), | 
|  | rebase_path( | 
|  | "$root_build_dir/fidling/gen/sdk/fidl/fuchsia.boot/fuchsia.boot.fidl.json", | 
|  | root_build_dir), | 
|  | ] | 
|  | metadata = { | 
|  | # Don't pick up resources from SDK deps | 
|  | distribution_entries_barrier = [] | 
|  | } | 
|  | } | 
|  |  | 
|  | distribution_entries_file("fidl_json") { | 
|  | testonly = true | 
|  | deps = [ ":generate_fidl_json" ] | 
|  | file = get_target_outputs(deps[0]) | 
|  | file = file[0] | 
|  | } | 
|  |  | 
|  | test_package("josh-tests") { | 
|  | deps = [ | 
|  | "//src/developer/shell/josh:bin", | 
|  | "//src/developer/shell/josh:josh_tests_bin", | 
|  | "//src/developer/shell/josh/lib:spawn_child_test_util", | 
|  | ] | 
|  | resource_deps = [ | 
|  | ":fidl_json", | 
|  | "josh/lib:js_libs", | 
|  | ] | 
|  |  | 
|  | binaries = [ | 
|  | { | 
|  | name = "spawn_child_test_util" | 
|  | }, | 
|  | { | 
|  | name = "josh" | 
|  | }, | 
|  | ] | 
|  |  | 
|  | tests = [ | 
|  | { | 
|  | name = "josh_tests_bin" | 
|  | environments = basic_envs | 
|  | }, | 
|  | ] | 
|  | } | 
|  |  | 
|  | group("tests") { | 
|  | testonly = true | 
|  |  | 
|  | deps = [ | 
|  | ":josh-tests", | 
|  | "console:shell-console-unittests", | 
|  | "interpreter:shell_server", | 
|  | "interpreter:tests", | 
|  | "mirror:shell-mirror-tests", | 
|  | "parser:shell-parser-unittests", | 
|  | ] | 
|  | } | 
|  |  | 
|  | # "josh" is Javascript Object SHell. | 
|  | package("josh") { | 
|  | # TODO(jeremymanson): This is only testonly because sdk:core is.  We should undo that. | 
|  | testonly = true | 
|  | deps = [ "//src/developer/shell/josh:bin" ] | 
|  | resource_deps = [ | 
|  | ":fidl_json", | 
|  | "josh/lib:js_libs", | 
|  | ] | 
|  | binaries = [ | 
|  | { | 
|  | name = "josh" | 
|  | shell = true | 
|  | }, | 
|  | ] | 
|  | } | 
|  |  | 
|  | # "cliff" is the CLI For Fuchsia.  Need a better name. | 
|  | package("cliff") { | 
|  | # TODO(jeremymanson): This is only testonly because sdk:core is.  We should undo that. | 
|  | testonly = true | 
|  | deps = [ "//src/developer/shell/console:bin" ] | 
|  | binaries = [ | 
|  | { | 
|  | name = "cliff" | 
|  | shell = true | 
|  | }, | 
|  | ] | 
|  | resource_deps = [ ":fidl_json" ] | 
|  | } |