| # 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/host.gni") |
| import("//build/python/python_binary.gni") |
| import("//build/python/python_host_test.gni") |
| |
| assert(is_host, "Only include assembly build scripts via the host toolchain") |
| |
| python_binary("packages_from_product_assembler") { |
| main_source = "packages_from_product_assembler.py" |
| } |
| |
| python_binary("generate_scrutiny_configs") { |
| main_source = "generate_scrutiny_configs.py" |
| deps = [ |
| "//build/python/modules/assembly", |
| "//build/python/modules/serialization", |
| ] |
| } |
| |
| python_binary("generated_assembly_inputs") { |
| main_source = "generated_assembly_inputs.py" |
| deps = [ "//build/python/modules/assembly" ] |
| } |
| |
| python_binary("check_size_hermetic_inputs") { |
| main_source = "check_size_hermetic_inputs.py" |
| deps = [ "//build/python/modules/assembly" ] |
| } |
| |
| python_host_test("compare_json_list_test") { |
| main_source = "compare_json_list_test.py" |
| sources = [ "compare_json_list.py" ] |
| libraries = [ "//third_party/parameterized" ] |
| } |
| |
| python_host_test("convert_size_limits_test") { |
| main_source = "convert_size_limits_test.py" |
| sources = [ "//build/bazel_sdk/bazel_rules_fuchsia/fuchsia/tools/convert_size_limits.py" ] |
| libraries = [ "//third_party/parameterized" ] |
| } |
| |
| python_host_test("check_size_hermetic_inputs_test") { |
| main_source = "check_size_hermetic_inputs_test.py" |
| sources = [ "check_size_hermetic_inputs.py" ] |
| libraries = [ |
| "//build/python/modules/assembly", |
| "//third_party/parameterized", |
| ] |
| } |
| |
| python_binary("hermetic_inputs_for_image_assembly") { |
| main_source = "hermetic_inputs_for_image_assembly.py" |
| deps = [ |
| "//build/python/modules/assembly", |
| "//build/python/modules/depfile", |
| ] |
| } |
| |
| python_binary("hermetic_inputs_from_assembly_outputs") { |
| main_source = "hermetic_inputs_from_assembly_outputs.py" |
| deps = [ |
| "//build/python/modules/assembly", |
| "//build/python/modules/depfile", |
| ] |
| } |
| |
| python_binary("make_legacy_config") { |
| main_source = "make_legacy_config.py" |
| deps = [ |
| "//build/python/modules/assembly", |
| "//build/python/modules/depfile", |
| "//build/python/modules/serialization", |
| ] |
| } |
| |
| python_binary("package_list") { |
| main_source = "package_list.py" |
| } |
| |
| python_host_test("test_make_legacy_config") { |
| main_source = "test_make_legacy_config.py" |
| sources = [ "make_legacy_config.py" ] |
| libraries = [ |
| "//build/python/modules/assembly", |
| "//build/python/modules/serialization", |
| "//build/python/tests/fast_copy_mock", |
| ] |
| } |
| |
| python_binary("assembly_input_bundle_tool") { |
| main_source = "assembly_input_bundle_tool.py" |
| deps = [ |
| "//build/python/modules/assembly", |
| "//build/python/modules/depfile", |
| ] |
| } |
| |
| python_binary("kernel_aib_tool") { |
| main_source = "kernel_aib.py" |
| deps = [ "//build/python/modules/assembly" ] |
| } |
| |
| # The standard `install_host_tools()` template doesn't work for this, because it |
| # assumes that all binaries are at `${root_build_dir}/<tool>`, and the |
| # `python_binary()` uses `$target_out_dir/<tool>`. But the import is still |
| # needed to have `${host_tools_dir}` defined. |
| # |
| copy("assembly_input_bundle_tool_install") { |
| deps = [ ":assembly_input_bundle_tool" ] |
| outputs = [ "${host_tools_dir}/assembly_input_bundle_tool" ] |
| sources = [ "${target_out_dir}/assembly_input_bundle_tool.pyz" ] |
| } |
| |
| python_binary("product_def_gn_arg_validator") { |
| main_source = "validate_product_defs.py" |
| deps = [ "//build/python/modules/depfile" ] |
| } |
| |
| python_binary("validate_config_data_is_empty") { |
| main_source = "validate_config_data_entries_is_empty.py" |
| deps = [ "//build/python/modules/serialization" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":check_size_hermetic_inputs_test", |
| ":compare_json_list_test", |
| ":convert_size_limits_test", |
| ":test_make_legacy_config", |
| ] |
| } |