naiveproxy/chromecast/common/extensions_api/BUILD.gn
2018-08-14 22:19:20 +00:00

113 lines
2.6 KiB
Plaintext

# Copyright 2018 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,
"Cannot depend on extensions because enable_extensions=false.")
extensions_api_schema_include_rules =
"extensions/common/api:extensions::api::%(namespace)s"
schema_sources = [
# TODO(crbug/837773) De-dupe Automation later.
"accessibility_private.json",
"automation.idl",
"automation_internal.idl",
"bookmarks.json",
"braille_display_private.idl",
"history.json",
"identity.idl",
"i18n.json",
"notifications.idl",
"tabs.json",
"windows.json",
]
root_namespace = "extensions::cast::api::%(namespace)s"
extensions_api_uncompiled_sources = [ "extension.json" ]
json_schema_api("generated_api_strings_bundle") {
sources = schema_sources
uncompiled_sources = extensions_api_uncompiled_sources
bundle = true
bundle_name = "Cast"
uncompiled_bundle_schema_sources = [ "tts.json" ]
schema_include_rules = extensions_api_schema_include_rules
deps = [
"//extensions/common/api",
]
visibility = [ ":api" ]
}
json_schema_api("generated_api_registration_bundle") {
sources = schema_sources
impl_dir = "//chromecast/browser/extensions/api"
bundle_registration = true
bundle_name = "Cast"
deps = [
"//extensions/common",
"//extensions/common/api",
]
visibility = [ ":api" ]
}
generated_types("generated_api_types") {
sources = schema_sources
schema_include_rules = extensions_api_schema_include_rules
deps = [
"//extensions/common/api",
]
visibility = [ ":api" ]
}
json_features("cast_api_features") {
feature_type = "APIFeature"
method_name = "AddCastAPIFeatures"
sources = [
"_api_features.json",
]
}
json_features("cast_permission_features") {
feature_type = "PermissionFeature"
method_name = "AddCastPermissionFeatures"
sources = [
"_permission_features.json",
]
}
json_features("cast_manifest_features") {
feature_type = "ManifestFeature"
method_name = "AddCastManifestFeatures"
sources = [
"_manifest_features.json",
]
}
# Public Targets
group("api") {
public_deps = [
":generated_api_registration_bundle",
":generated_api_strings_bundle",
":generated_api_types",
]
}
group("extensions_features") {
public_deps = [
":cast_api_features",
":cast_manifest_features",
":cast_permission_features",
"//extensions/common/api:extensions_features",
]
}