blob: 6ca70f1ccd79e01237c3875d8a724ea4f25fccf4 [file]
# 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("//src/chromium/build_args.gni")
import("//src/chromium/generate_pkg_and_config.gni")
# Helper template that generates prebuilt Cast packages.
#
# Parameters:
# archive_path_suffix: For a given package target, the archive_path_suffix
# is appended to the innermost folder of the base paths
# passed into the generate_package_flavors_and_config template.
declare_args() {
# Whether to use the most recent (canary) version of the CastRunner prebuilt.
# Otherwise, the qualified "release" version is used.
# Set [`use_chromium_canary`](#use_chromium_canary) to the same value.
use_cast_runner_canary = false
}
template("generate_cast_targets") {
assert(defined(invoker.archive_path_suffix))
prebuilt_archive_root_path = "//prebuilt/third_party"
build_output_gen_base_path = "/gen"
group(target_name) {
public_deps = [ ":cast_runner" ]
}
group("cast_runner") {
deps = [
":cast_runner_config",
":cast_runner_pkg",
]
}
# TODO(fxbug.dev/70573): Remove when use_cast_runner_canary is deprecated.
if (use_cast_runner_canary) {
package_flavor_selections += [
{
name = "cast_runner_pkg"
flavor = "canary"
},
]
}
if (chromium_build_dir != "") {
package_flavor_selections += [
{
name = "cast_runner_pkg"
flavor = "custom"
},
]
}
generate_fuchsia_web_package_flavors("cast_runner") {
prebuilt_archive_base_path = "${prebuilt_archive_root_path}/${target_name}${invoker.archive_path_suffix}"
custom_package_path = "${build_output_gen_base_path}/fuchsia_web/runners/${target_name}/${target_name}.far"
selections = package_flavor_selections
# TODO(crbug.com/1385930): Change this to "chromium.org".
# Also override or templatize `./config/cast_scheme_map.config`.
repository = "fuchsia.com"
# The chromium_cast_runner_tests need to depend on the config.
# TODO(crbug.com/1065707): Remove once the deps has been removed.
visibility = [ "//src/chromium:*" ]
}
generate_config("cast_runner") {
for_pkg = "appmgr"
sources = [ "//src/cast/config/cast_scheme_map.config" ]
outputs = [ "scheme_map/cast.config" ]
}
}