electron/shell/common/extensions/api/BUILD.gn
John Kleinschmidt d6701ff435
feat(extensions): add chrome.i18n API (#22455)
* feat(extensions): implement chrome.i18n API

* refactor(extensions): use forward declaration for ScriptExecutor

* fix(extensions): add message filter to handle i18n GetMessageBundle

* test(extensions): add chrome.i18n tests

* fix(extensions): message filter lint error

* fix: remove exclusive test

* fix(extensions): format api feature arrays

Co-Authored-By: Jeremy Apthorp <nornagon@nornagon.net>

* fix(extensions): uncomment chrome.i18n usage in old extensions test

Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
2020-03-05 09:56:21 -05:00

89 lines
2.4 KiB
Text

# Copyright 2015 The Chromium 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("//extensions/buildflags/buildflags.gni")
import("//tools/json_schema_compiler/json_features.gni")
import("//tools/json_schema_compiler/json_schema_api.gni")
assert(enable_extensions)
################################################################################
# Public Targets
group("api") {
public_deps = [
":generated_api_json_strings",
":generated_api_types",
]
}
group("extensions_features") {
public_deps = [
":api_features",
":manifest_features",
":permission_features",
# TODO(devlin): It would be nicer to have this dependency hoisted up to
# //extensions/common (since that's where it's consumed), but there's some
# cycles to be resolved first.
"//extensions/common/api:extensions_features",
]
}
################################################################################
# Private Targets
generated_json_strings("generated_api_json_strings") {
sources = [
"extension.json",
"i18n.json",
"resources_private.idl",
"tabs.json",
]
configs = [ "//build/config:precompiled_headers" ]
bundle_name = "Electron"
schema_include_rules = "extensions/common/api:extensions::api::%(namespace)s"
root_namespace = "extensions::api::%(namespace)s"
deps = [ "//extensions/common/api" ]
visibility = [ ":api" ]
}
generated_types("generated_api_types") {
sources = [
"i18n.json",
"resources_private.idl",
"tabs.json",
]
configs = [ "//build/config:precompiled_headers" ]
schema_include_rules = "extensions/common/api:extensions::api::%(namespace)s"
root_namespace = "extensions::api::%(namespace)s"
deps = [ "//extensions/common/api" ]
visibility = [ ":api" ]
}
json_features("manifest_features") {
feature_type = "ManifestFeature"
method_name = "AddElectronManifestFeatures"
sources = [ "_manifest_features.json" ]
visibility = [ ":extensions_features" ]
}
json_features("api_features") {
feature_type = "APIFeature"
method_name = "AddElectronAPIFeatures"
sources = [ "_api_features.json" ]
visibility = [ ":extensions_features" ]
}
json_features("permission_features") {
feature_type = "PermissionFeature"
method_name = "AddElectronPermissionFeatures"
sources = [ "_permission_features.json" ]
visibility = [ ":extensions_features" ]
}