BUILD.gn 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. # Copyright 2015 The Chromium Authors. All rights reserved.
  2. # Use of this source code is governed by a BSD-style license that can be
  3. # found in the LICENSE file.
  4. import("//extensions/buildflags/buildflags.gni")
  5. import("//tools/json_schema_compiler/json_features.gni")
  6. import("//tools/json_schema_compiler/json_schema_api.gni")
  7. assert(enable_extensions)
  8. ################################################################################
  9. # Public Targets
  10. group("api") {
  11. public_deps = [
  12. ":generated_api_json_strings",
  13. ":generated_api_types",
  14. ]
  15. }
  16. group("extensions_features") {
  17. public_deps = [
  18. ":api_features",
  19. ":manifest_features",
  20. ":permission_features",
  21. # TODO(devlin): It would be nicer to have this dependency hoisted up to
  22. # //extensions/common (since that's where it's consumed), but there's some
  23. # cycles to be resolved first.
  24. "//extensions/common/api:extensions_features",
  25. ]
  26. }
  27. ################################################################################
  28. # Private Targets
  29. generated_json_strings("generated_api_json_strings") {
  30. sources = [
  31. "extension.json",
  32. "i18n.json",
  33. "resources_private.idl",
  34. "tabs.json",
  35. ]
  36. configs = [ "//build/config:precompiled_headers" ]
  37. bundle_name = "Electron"
  38. schema_include_rules = "extensions/common/api:extensions::api::%(namespace)s"
  39. root_namespace = "extensions::api::%(namespace)s"
  40. deps = [ "//extensions/common/api" ]
  41. visibility = [ ":api" ]
  42. }
  43. generated_types("generated_api_types") {
  44. sources = [
  45. "i18n.json",
  46. "resources_private.idl",
  47. "tabs.json",
  48. ]
  49. configs = [ "//build/config:precompiled_headers" ]
  50. schema_include_rules = "extensions/common/api:extensions::api::%(namespace)s"
  51. root_namespace = "extensions::api::%(namespace)s"
  52. deps = [ "//extensions/common/api" ]
  53. visibility = [ ":api" ]
  54. }
  55. json_features("manifest_features") {
  56. feature_type = "ManifestFeature"
  57. method_name = "AddElectronManifestFeatures"
  58. sources = [ "_manifest_features.json" ]
  59. visibility = [ ":extensions_features" ]
  60. }
  61. json_features("api_features") {
  62. feature_type = "APIFeature"
  63. method_name = "AddElectronAPIFeatures"
  64. sources = [ "_api_features.json" ]
  65. visibility = [ ":extensions_features" ]
  66. }
  67. json_features("permission_features") {
  68. feature_type = "PermissionFeature"
  69. method_name = "AddElectronPermissionFeatures"
  70. sources = [ "_permission_features.json" ]
  71. visibility = [ ":extensions_features" ]
  72. }