blob: 144ba43b8bd7a77846c404c0353f25f6c7273ed0 [file] [log] [blame]
# 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/go/go_library.gni")
import("//build/go/go_test.gni")
import("//build/python/python_host_test.gni")
import("//build/sdk/sdk_documentation.gni")
# This list should only contain schemas that are currently exported outside of
# the Fuchsia source tree. Unless otherwise indicated, each file corresponds
# to a supported IDK atom type.
schemas = [
# LINT.IfChange(schema_in_idk)
"bind_library.json",
"cc_prebuilt_library.json",
"cc_source_library.json",
"companion_host_tool.json",
"common.json", # No associated atom type.
"dart_library.json",
"data.json",
"documentation.json",
"experimental_python_e2e_test.json",
"ffx_tool.json",
"fidl_library.json",
"host_tool.json",
"loadable_module.json",
"manifest.json", # IDK manifest - no associated atom type.
"package.json",
"sysroot.json",
"version_history.json",
# LINT.ThenChange(BUILD.bazel:schema_in_idk, //build/sdk/sdk_common/__init__.py:idk_atom_types)
]
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 = "2021"
deps = [
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:camino",
"//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",
]
test_deps = [
"//src/developer/ffx/lib/pkg:empty-repo-keys",
"//src/developer/ffx/lib/pkg:empty-repo-metadata",
"//third_party/rust_crates:tempfile",
]
non_rust_deps = [ ":schemas" ]
sources = [
"src/common.rs",
"src/ffx_tool.rs",
"src/host_tool.rs",
"src/json.rs",
"src/lib.rs",
"src/manifest.rs",
"src/testing.rs",
"src/virtual_device.rs",
"src/virtual_device/manifest.rs",
"src/virtual_device/v1.rs",
]
inputs = [
"common.json",
"ffx_tool.json",
"hardware.json",
"host_tool.json",
"manifest.json",
"test_data/virtual_device.json",
"test_data/virtual_device2.json",
"test_data/virtual_device3.json",
"test_data/empty_vd_manifest.json",
"test_data/single_vd_manifest.json",
"test_data/multi_vd_manifest.json",
"virtual_device.json",
]
}
}
group("tests") {
testonly = true
deps = [ ":rust_test($host_toolchain)" ]
}