aboutsummaryrefslogtreecommitdiff
path: root/mojo/public/js/BUILD.gn
blob: 5ed57a13288b1c9d2bcc7cf3e3baf9ab6a392ee3 (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# 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.

interfaces_bindings_gen_dir = "$root_gen_dir/mojo/public/interfaces/bindings"

source_set("js") {
  sources = [
    "constants.cc",
    "constants.h",
  ]
}

group("bindings") {
  data = [
    "$interfaces_bindings_gen_dir/interface_control_messages.mojom.js",
    "$interfaces_bindings_gen_dir/pipe_control_messages.mojom.js",
    "bindings.js",
    "buffer.js",
    "codec.js",
    "connector.js",
    "core.js",
    "interface_types.js",
    "lib/control_message_handler.js",
    "lib/control_message_proxy.js",
    "lib/interface_endpoint_client.js",
    "lib/interface_endpoint_handle.js",
    "lib/pipe_control_message_handler.js",
    "lib/pipe_control_message_proxy.js",
    "router.js",
    "support.js",
    "threading.js",
    "unicode.js",
    "validator.js",
  ]

  deps = [
    ":new_bindings",
    "//mojo/public/interfaces/bindings:bindings__generator",
  ]
}

action("new_bindings") {
  new_bindings_js_files = [
    # This must be the first file in the list, because it initializes global
    # variable |mojoBindings| that the others need to refer to.
    "new_bindings/base.js",

    "$interfaces_bindings_gen_dir/new_bindings/interface_control_messages.mojom.js",
    "new_bindings/bindings.js",
    "new_bindings/buffer.js",
    "new_bindings/codec.js",
    "new_bindings/connector.js",
    "new_bindings/interface_types.js",
    "new_bindings/lib/control_message_handler.js",
    "new_bindings/lib/control_message_proxy.js",
    "new_bindings/router.js",
    "new_bindings/unicode.js",
    "new_bindings/validator.js",
  ]
  compiled_file = "$target_gen_dir/mojo_bindings.js"

  # TODO(yzshen): Eventually we would like to use Closure Compiler to minify the
  # bindings instead of simply concatenating the files.
  script = "//v8/tools/concatenate-files.py"

  sources = new_bindings_js_files
  outputs = [
    compiled_file,
  ]

  args = rebase_path(new_bindings_js_files)
  args += [ rebase_path(compiled_file) ]

  deps = [
    "//mojo/public/interfaces/bindings:new_bindings__generator",
  ]
}

group("tests") {
  testonly = true

  data = [
    "//mojo/public/interfaces/bindings/tests/data/validation/",
    "tests/core_unittest.js",
    "tests/validation_test_input_parser.js",
    "tests/validation_unittest.js",
  ]

  public_deps = [
    ":bindings",
  ]
}