blob: 0066bfa8553e5e8b7813dd3da3c6f7961f091dd8 [file] [log] [blame]
# 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("//sdk/cts/build/cts_copy_to_sdk.gni")
import("//sdk/cts/build/write_cts_file.gni")
import("//src/session/build/session_config.gni")
# A session config that can be used in the CTS.
#
# An equivalent to the in-tree `session_config`, but adds an SDK atom so that
# this target can be used in the CTS SDK.
#
# Parameters
# config (required)
# The JSON configuration file for the Session Framework.
template("cts_session_config") {
assert(defined(invoker.config), "config must be defined.")
session_config(target_name) {
forward_variables_from(invoker, "*")
}
current_dir = get_label_info(":${target_name}", "dir")
is_prebuilt_cts =
string_replace(current_dir, "//prebuilt/cts", "") != current_dir
if (!is_prebuilt_cts) {
cts_copy_to_sdk(target_name) {
forward_variables_from(invoker, [ "testonly" ])
sources = [ invoker.config ]
}
}
}