# Copyright 2021 The Chromium Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # Template to package an app extension into an app. # # Parameters # # extension_target: # name of the extension target to package; the extension # bundle name must be derived from the target name # # extension_name: # (optional) name of the extension appex file; derived from # the target name if omitted # template("extension_bundle_data") { assert(defined(invoker.extension_target), "extension_target must be defined for $target_name") _extension_name = get_label_info(invoker.extension_target, "name") + ".appex" if (defined(invoker.extension_name)) { _extension_name = invoker.extension_name } _extension_dir = "PlugIns" if (defined(invoker.extension_dir)) { _extension_dir = invoker.extension_dir } forward_variables_from(invoker, [ "testonly" ]) bundle_data(target_name) { public_deps = [ invoker.extension_target ] outputs = [ "{{bundle_contents_dir}}/$_extension_dir/{{source_file_part}}" ] sources = [ get_label_info(invoker.extension_target, "root_out_dir") + "/$_extension_name" ] } }