| # 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/sdk/sdk_documentation.gni") | 
 |  | 
 | # This list should only contain schemas that are currently exported outside of | 
 | # the Fuchsia source tree. | 
 | schemas = [ | 
 |   # "banjo_library.json", | 
 |   "cc_prebuilt_library.json", | 
 |   "cc_source_library.json", | 
 |   "common.json", | 
 |   "dart_library.json", | 
 |   "data.json", | 
 |   "documentation.json", | 
 |   "emu_manifest.json", | 
 |   "fidl_library.json", | 
 |   "flash_manifest-835e8f26.json", | 
 |   "hardware-f6f47515.json", | 
 |   "host_tool.json", | 
 |   "loadable_module.json", | 
 |   "manifest.json", | 
 |   "physical_device-0bd5d21f.json", | 
 |   "product_bundle-6320eef1.json", | 
 |   "sysroot.json", | 
 |   "version_history.json", | 
 | ] | 
 |  | 
 | sdk_documentation("meta") { | 
 |   name = "metadata_schemas" | 
 |   category = "partner" | 
 |  | 
 |   files = [] | 
 |   foreach(schema, schemas) { | 
 |     files += [ | 
 |       { | 
 |         source = "//build/sdk/meta/$schema" | 
 |         dest = "meta/schemas/$schema" | 
 |       }, | 
 |     ] | 
 |   } | 
 | } | 
 |  | 
 | source_set("schemas") { | 
 |   inputs = schemas | 
 | } | 
 |  | 
 | if (is_host) { | 
 |   import("//build/rust/rustc_library.gni") | 
 |  | 
 |   rustc_library("rust") { | 
 |     name = "sdk_metadata" | 
 |  | 
 |     with_unit_tests = true | 
 |  | 
 |     edition = "2018" | 
 |  | 
 |     deps = [ | 
 |       "//third_party/rust_crates:anyhow", | 
 |       "//third_party/rust_crates:lazy_static", | 
 |       "//third_party/rust_crates:serde", | 
 |       "//third_party/rust_crates:serde_json", | 
 |       "//third_party/rust_crates:thiserror", | 
 |       "//third_party/rust_crates:url-v1_7_2", | 
 |       "//third_party/rust_crates:valico", | 
 |     ] | 
 |  | 
 |     non_rust_deps = [ ":schemas" ] | 
 |  | 
 |     sources = [ | 
 |       "src/banjo_library.rs", | 
 |       "src/cc_prebuilt_library.rs", | 
 |       "src/cc_source_library.rs", | 
 |       "src/common.rs", | 
 |       "src/dart_library.rs", | 
 |       "src/data.rs", | 
 |       "src/documentation.rs", | 
 |       "src/fidl_library.rs", | 
 |       "src/host_tool.rs", | 
 |       "src/json.rs", | 
 |       "src/lib.rs", | 
 |       "src/loadable_module.rs", | 
 |       "src/manifest.rs", | 
 |       "src/metadata.rs", | 
 |       "src/physical_device.rs", | 
 |       "src/product_bundle.rs", | 
 |       "src/sysroot.rs", | 
 |       "src/testing.rs", | 
 |     ] | 
 |  | 
 |     inputs = [ | 
 |       "banjo_library.json", | 
 |       "cc_prebuilt_library.json", | 
 |       "cc_source_library.json", | 
 |       "common.json", | 
 |       "dart_library.json", | 
 |       "data.json", | 
 |       "documentation.json", | 
 |       "emu_manifest.json", | 
 |       "fidl_library.json", | 
 |       "flash_manifest-835e8f26.json", | 
 |       "hardware-f6f47515.json", | 
 |       "host_tool.json", | 
 |       "loadable_module.json", | 
 |       "manifest.json", | 
 |       "physical_device-0bd5d21f.json", | 
 |       "product_bundle-6320eef1.json", | 
 |       "sysroot.json", | 
 |     ] | 
 |   } | 
 |  | 
 |   group("tests") { | 
 |     testonly = true | 
 |     deps = [ ":rust_test" ] | 
 |   } | 
 | } |