| # 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/python/python_action.gni") |
| |
| # Generates a list of the files included in a product that must be uploaded by |
| # infrastructure. |
| # |
| # Arguments |
| # |
| # product_config (required) |
| # [path] The path to the product config. |
| # |
| # images_config (required) |
| # [path] The path to the images config. |
| # |
| # partitions_config (required) |
| # [path] The path to the partitions config. |
| # |
| # output_path (required) |
| # [path] Where to write the output list. |
| # |
| # sources (optional) |
| # [list of str] Additional files or directories to list as inputs. |
| # |
| template("generated_assembly_inputs") { |
| assert(defined(invoker.product_config), "Need to define product_config") |
| assert(defined(invoker.images_config), "Need to define images_config") |
| assert(defined(invoker.partitions_config), "Need to define partitions_config") |
| assert(defined(invoker.output_path), "Need to define output_path") |
| |
| python_action(target_name) { |
| forward_variables_from(invoker, |
| [ |
| "deps", |
| "testonly", |
| "visibility", |
| ]) |
| binary_label = "//build/assembly/scripts:generated_assembly_inputs" |
| |
| depfile_path = "$target_out_dir/$target_name.depfile" |
| depfile = depfile_path |
| |
| outputs = [ invoker.output_path ] |
| inputs = [ |
| invoker.images_config, |
| invoker.partitions_config, |
| invoker.product_config, |
| ] |
| |
| args = [ |
| "--product-config", |
| rebase_path(invoker.product_config, root_build_dir), |
| "--images-config", |
| rebase_path(invoker.images_config, root_build_dir), |
| "--partitions-config", |
| rebase_path(invoker.partitions_config, root_build_dir), |
| "--output", |
| rebase_path(invoker.output_path, root_build_dir), |
| "--depfile", |
| rebase_path(depfile_path, root_build_dir), |
| ] |
| |
| if (defined(invoker.sources)) { |
| args += [ "--sources" ] |
| foreach(source, invoker.sources) { |
| args += [ rebase_path(source, root_build_dir) ] |
| } |
| } |
| } |
| } |