blob: b26dc85e3d1ce7e7467b2205aaa4237e4ab271e8 [file]
# Copyright 2020 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/python/python_action.gni")
# An empty SDK atom.
#
# Should be used in very specific situations where SDK elements are injected in
# SDKs in a way that's not reflected in the build graph. This allows SDK-related
# templates to handle such a target as any other SDK target.
#
# Parameters
# category (required)
# Describes the availability of the element.
# See //build/sdk/sdk_atom.gni for information regarding category.
# Type: string
#
# id (optional)
# Identifier of this element within SDKs. Used for API verification.
# See //build/sdk/sdk_atom.gni for information regarding id.
# Type: string
#
# sdk_area (optional)
# The API area responsible for maintaining this SDK atom. See
# docs/contribute/governance/areas/_areas.yaml for the list of areas.
# "Unknown" is also a valid option. By default, the area will be `null` in
# the build manifest.
# Type: string
#
# testonly (optional)
# Usual GN meaning.
#
template("sdk_noop_atom") {
assert(defined(invoker.category), "Must define an SDK category")
if (defined(invoker.id)) {
_atom_id = invoker.id
} else {
_atom_id = target_name
}
_idk_atom_prebuild_info = {
atom_id = _atom_id
atom_label = get_label_info(":${target_name}", "label_no_toolchain")
atom_type = "none"
meta_dest = ""
atom_files = []
is_stable = true # Atoms are stable except for types supporting unstable.
category = invoker.category
if (defined(invoker.sdk_area)) {
api_area = invoker.sdk_area
}
}
group(target_name) {
forward_variables_from(invoker, [ "testonly" ])
metadata = {
# Used by idk_prebuild_manifest() template.
idk_atom_prebuild_info = [ _idk_atom_prebuild_info ]
}
}
}