| # 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/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.sh" | |
| generated_output = "$target_gen_dir/sdk_fidl_json.manifest" | |
| outputs = [ "$generated_output" ] | |
| testonly = true | |
| deps = [ | |
| "//garnet/examples/fidl/services:echo", | |
| "//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 = [ | |
| "--qjs=" + rebase_path("$root_build_dir/host_$host_cpu/qjs"), | |
| "--fidl-json-file=" + | |
| rebase_path("$root_gen_dir/sdk/core.fidl_json.txt", root_build_dir), | |
| "--out-file=" + rebase_path("$generated_output", root_build_dir), | |
| rebase_path( | |
| "$root_build_dir/fidling/gen/garnet/examples/fidl/services/echo.fidl.json", | |
| 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), | |
| ] | |
| } | |
| test_package("josh-tests") { | |
| deps = [ | |
| ":generate_fidl_json", | |
| "//src/developer/shell/josh:bin", | |
| "//src/developer/shell/josh:josh_tests_bin", | |
| "//src/developer/shell/josh/lib:js_libs", | |
| "//src/developer/shell/josh/lib:spawn_child_test_util", | |
| ] | |
| binaries = [ | |
| { | |
| name = "spawn_child_test_util" | |
| }, | |
| { | |
| name = "josh" | |
| }, | |
| ] | |
| tests = [ | |
| { | |
| name = "josh_tests_bin" | |
| environments = basic_envs | |
| }, | |
| ] | |
| extra = get_target_outputs(":generate_fidl_json") + | |
| [ "$target_gen_dir/josh/lib/libs.manifest" ] | |
| } | |
| 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:generate_fidl_json", | |
| "//src/developer/shell/josh:bin", | |
| "//src/developer/shell/josh/lib:js_libs", | |
| ] | |
| binaries = [ | |
| { | |
| name = "josh" | |
| shell = true | |
| }, | |
| ] | |
| extra = get_target_outputs(":generate_fidl_json") + | |
| [ "$target_gen_dir/josh/lib/libs.manifest" ] | |
| } | |
| # "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:generate_fidl_json", | |
| "//src/developer/shell/console:bin", | |
| ] | |
| binaries = [ | |
| { | |
| name = "cliff" | |
| shell = true | |
| }, | |
| ] | |
| extra = get_target_outputs(":generate_fidl_json") | |
| } |