| # 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/images/manifest.gni") |
| |
| # This contains templates and implementation details for package rules. |
| |
| template("generate_system_index") { |
| generate_response_file(target_name) { |
| forward_variables_from(invoker, [ "testonly" ]) |
| |
| if (invoker.deprecated_system_image) { |
| # A system_image package will be included directly in the system package. |
| response_file_contents = [] |
| not_needed(invoker, "*") |
| } else { |
| forward_variables_from(invoker, |
| [ |
| "blobs_json", |
| "meta_target", |
| "package_name", |
| "package_set", |
| "package_version", |
| ]) |
| |
| deps = [ |
| "${meta_target}", |
| ] |
| if (package_set == "") { |
| package_tags = "" |
| } else { |
| package_tags = "#${package_set}" |
| } |
| response_file_contents = |
| [ "--entry=${package_name}/${package_version}${package_tags}=" + |
| rebase_path(blobs_json, root_build_dir, target_out_dir) ] |
| } |
| } |
| } |
| |
| template("generate_index") { |
| generate_response_file(target_name) { |
| forward_variables_from(invoker, |
| [ |
| "deps", |
| "testonly", |
| ]) |
| if (invoker.deprecated_system_image) { |
| # A system_image package has no index entry. |
| response_file_contents = [] |
| not_needed(invoker, "*") |
| } else { |
| forward_variables_from(invoker, |
| [ |
| "index_file", |
| "package_name", |
| "package_version", |
| "pkg_label", |
| ]) |
| response_file_contents = [ |
| "--entry-manifest=${pkg_label}", |
| "--entry=${package_name}/${package_version}=" + |
| rebase_path(index_file, root_build_dir, target_out_dir), |
| ] |
| } |
| } |
| } |