| # 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/packages/package_metadata.gni") |
| |
| # Collect from the transitive closure of package dependencies all blobs into a |
| # single de-duplicated manfiest file. The paths in the manifest file will be |
| # adjusted to be relative to the directory in which the output manifest lives, |
| # as is required for input to blobfs. |
| # |
| # Paramters |
| # |
| # One of deps, data_deps, or public_deps are required to be non-empty for any |
| # meaningful operation. |
| # |
| # outputs (required) |
| # [list containing one string] The output location for the manifest. |
| # |
| # data_deps (optional) |
| # deps (optional) |
| # metadata (optional) |
| # output_conversion (optional) |
| # public_deps (optional) |
| # testonly (optional) |
| # visibility (optional) |
| # Same as for any GN `generated_file()` target. |
| template("collect_blob_manifest") { |
| list_name = target_name + ".list" |
| list_path = target_gen_dir + "/" + list_name |
| generate_package_metadata(list_name) { |
| forward_variables_from(invoker, |
| [ |
| "data_deps", |
| "deps", |
| "public_deps", |
| "testonly", |
| "data_keys", |
| ]) |
| |
| data_keys = [ "blob_manifests" ] |
| |
| outputs = [ list_path ] |
| } |
| |
| action(target_name) { |
| forward_variables_from(invoker, |
| [ |
| "inputs", |
| "outputs", |
| "testonly", |
| "visibility", |
| ]) |
| |
| assert([ outputs[0] ] == outputs, |
| "collect_blob_manifest requires exactly one output") |
| |
| inputs = [ list_path ] |
| deps = [ ":$list_name" ] |
| |
| script = "//build/images/manifest_list_collect_unique_blobs.py" |
| depfile = "$target_gen_dir/$target_name.d" |
| args = [ |
| rebase_path(inputs[0], root_build_dir), |
| rebase_path(outputs[0], root_build_dir), |
| rebase_path(depfile, root_build_dir), |
| ] |
| } |
| } |