| # Copyright 2021 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/rust/rustc_library.gni") |
| import("//src/developer/ffx/build/ffx_plugin.gni") |
| |
| rustc_library("playground") { |
| version = "0.1.0" |
| edition = "2021" |
| with_unit_tests = true |
| sources = [ |
| "src/builtins.rs", |
| "src/compiler.rs", |
| "src/error.rs", |
| "src/frame.rs", |
| "src/interpreter.rs", |
| "src/lib.rs", |
| "src/parser.rs", |
| "src/test.rs", |
| "src/value.rs", |
| "src/value/in_use_handle.rs", |
| "src/value/iterator.rs", |
| ] |
| deps = [ |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fidl_codec/rust:fidl_codec", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-fs", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:async-lock", |
| "//third_party/rust_crates:fancy-regex", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:nom", |
| "//third_party/rust_crates:nom_locate", |
| "//third_party/rust_crates:num", |
| ] |
| test_deps = [ |
| ":test_fidl", |
| "//src/lib/fidl_codec:fidl_rust", |
| "//src/lib/fuchsia", |
| "//src/storage/lib/vfs/rust:vfs", |
| ] |
| } |
| |
| _test_fidl = get_label_info("//src/lib/fidl_codec:fidl($fidl_toolchain)", |
| "target_gen_dir") |
| _io_fidl = |
| get_label_info("//sdk/fidl/fuchsia.io($fidl_toolchain)", "target_gen_dir") |
| _test_fidl_gen_dir = get_label_info(":test_fidl", "target_gen_dir") |
| |
| copy("test_fidl_json") { |
| testonly = true |
| sources = [ "${_test_fidl}/fidl.fidl.json" ] |
| outputs = [ "${_test_fidl_gen_dir}/fidl.fidl.json" ] |
| deps = [ "//src/lib/fidl_codec:fidl($fidl_toolchain)" ] |
| } |
| |
| copy("io_fidl_json") { |
| sources = [ "${_io_fidl}/fuchsia.io.fidl.json" ] |
| outputs = [ "${_test_fidl_gen_dir}/fuchsia.io.fidl.json" ] |
| deps = [ "//sdk/fidl/fuchsia.io($fidl_toolchain)" ] |
| } |
| |
| copy("test_fidl_src") { |
| testonly = true |
| sources = [ "src/test_fidl_lib.rs" ] |
| outputs = [ "${_test_fidl_gen_dir}/test_fidl_lib.rs" ] |
| } |
| |
| rustc_library("test_fidl") { |
| testonly = true |
| version = "0.1.0" |
| edition = "2021" |
| source_root = "${_test_fidl_gen_dir}/test_fidl_lib.rs" |
| |
| sources = [ "${_test_fidl_gen_dir}/test_fidl_lib.rs" ] |
| inputs = [ |
| "${_test_fidl_gen_dir}/fidl.fidl.json", |
| "${_test_fidl_gen_dir}/fuchsia.io.fidl.json", |
| ] |
| deps = [ |
| ":io_fidl_json", |
| ":test_fidl_json", |
| ":test_fidl_src", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| |
| deps = [ ":playground_test" ] |
| } |