blob: 71a6fa7b1a8fe7976106c1187fcb5eb62e7af471 [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/sdk/sdk_documentation.gni")
# Schemas that are required for the product_bundle_container.
product_bundle_container_required_schemas = [
"product_bundle_container-32z5e391.json",
"common.json",
"product_bundle-6320eef1.json",
"flash_manifest-835e8f26.json",
"emu_manifest.json",
"hardware-f6f47515.json",
"physical_device-0bd5d21f.json",
"virtual_device-93A41932.json",
]
# 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",
"dart_library.json",
"data.json",
"documentation.json",
"fidl_library.json",
"host_tool.json",
"loadable_module.json",
"manifest.json",
"product_bundle_container-76a5c104.json",
"sysroot.json",
"version_history-ef02ef45.json",
] + product_bundle_container_required_schemas
sdk_documentation("meta") {
name = "metadata_schemas"
category = "partner"
files = []
foreach(schema, schemas) {
files += [
{
source = "//build/sdk/meta/$schema"
dest = "meta/schemas/$schema"
},
]
}
}
go_library("go_meta") {
name = "go.fuchsia.dev/fuchsia/build/sdk/meta"
deps = [
"//third_party/golibs:github.com/xeipuuv/gojsonschema",
"//third_party/golibs:go.uber.org/multierr",
]
sources = [
"product_bundle_container.go",
"product_bundle_container_test.go",
] + product_bundle_container_required_schemas
}
go_test("go_meta_tests") {
gopackages = [ "go.fuchsia.dev/fuchsia/build/sdk/meta" ]
deps = [
":go_meta",
"//third_party/golibs:github.com/google/go-cmp",
"//third_party/golibs:go.uber.org/multierr",
]
}
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: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/product_bundle_container.rs",
"src/sysroot.rs",
"src/testing.rs",
"src/virtual_device.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",
"product_bundle_container-76a5c104.json",
"product_bundle_container-32z5e391.json",
"sysroot.json",
"virtual_device-93A41932.json",
]
}
}
group("tests") {
testonly = true
deps = [
":go_meta_tests($host_toolchain)",
":rust_test($host_toolchain)",
]
}