summaryrefslogtreecommitdiff
path: root/chromium/extensions/shell/common/api/BUILD.gn
blob: d6952cac98d0a2f0a9ae42e5a2b974f0c0b57a34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Copyright 2014 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.")

# TODO(devlin): Enforce visibility restrictions on more of these targets?

schema_sources = [ "identity.idl" ]
root_namespace = "extensions::shell::api::%(namespace)s"

function_registration("generated_api_registration") {
  sources = schema_sources
  impl_dir = "//extensions/shell/browser/api"
  bundle_name = "Shell"

  deps = [ "//extensions/common" ]

  visibility = [ ":api" ]
}

generated_json_strings("generated_api_json_strings") {
  sources = schema_sources
  bundle_name = "Shell"
  visibility = [ ":api" ]
}

generated_types("generated_api_types") {
  sources = schema_sources

  visibility = [ ":api" ]
}

json_features("shell_api_features") {
  feature_type = "APIFeature"
  method_name = "AddShellAPIFeatures"
  sources = [ "_api_features.json" ]
}

# Public Targets

group("api") {
  public_deps = [
    ":generated_api_json_strings",
    ":generated_api_registration",
    ":generated_api_types",
  ]
}

group("extensions_features") {
  public_deps = [
    ":shell_api_features",
    "//extensions/common/api:extensions_features",
  ]
}