blob: 54c098ec7b6a2b91cf40ee081645e8d851087d3c [file] [log] [blame]
# Copyright 2018 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/json/validate_json.gni")
import("//build/toolchain/clang_toolchain.gni")
# A toolchain dedicated to processing FIDL libraries.
# The only targets in this toolchain are action() targets, so it
# has no real tools. But every toolchain needs stamp and copy.
toolchain("fidling") {
tool("stamp") {
command = stamp_command
description = stamp_description
}
tool("copy") {
command = copy_command
description = copy_description
}
toolchain_args = {
toolchain_variant = {
}
toolchain_variant = {
base = get_label_info(":fidling", "label_no_toolchain")
}
}
}
# A generated file that lists all of the .fidl.json files.
generated_file("all_fidl_json") {
testonly = true
deps = [ "//:default" ]
outputs = [ "$root_build_dir/all_fidl_json.txt" ]
data_keys = [ "fidl_json" ]
}
# Generates a fidl_project.json file.
# fidl_project.json is a declarative file that lists FIDL libraries and their
# constituent files, dependencies, and build artifacts. It is used by the FIDL
# LSP Language Server to compile FIDL libraries.
action("gen_fidl_project") {
testonly = true
script = "//scripts/generate-fidl-project.py"
deps = [ "//:generated_sources" ]
inputs = [ "$root_build_dir/generated_sources.json" ]
outputs = [ "$root_build_dir/fidl_project.json" ]
args = [
rebase_path("//"),
rebase_path("$root_build_dir/generated_sources.json"),
rebase_path("$root_build_dir/fidl_project.json"),
]
}
validate_json("validate_fidl_project_json") {
testonly = true
data = "$root_build_dir/fidl_project.json"
schema = "//scripts/fidl_project_schema.json"
deps = [ ":gen_fidl_project" ]
}
normalize_test_stamp = "$target_gen_dir/normalize_unittest.stamp"
action("normalize_unittest") {
testonly = true
script = "normalize_unittest.py"
inputs = [ "normalize.py" ]
outputs = [ normalize_test_stamp ]
args = [
"--stamp",
rebase_path(normalize_test_stamp),
]
}
group("tests") {
testonly = true
deps = [ ":normalize_unittest" ]
}