OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
| 5 import("//build/util/java_action.gni") |
| 6 |
5 source_set("js") { | 7 source_set("js") { |
6 sources = [ | 8 sources = [ |
7 "constants.cc", | 9 "constants.cc", |
8 "constants.h", | 10 "constants.h", |
9 ] | 11 ] |
10 } | 12 } |
11 | 13 |
12 group("bindings") { | 14 group("bindings") { |
13 data = [ | 15 data = [ |
14 "bindings.js", | 16 "bindings.js", |
15 "buffer.js", | 17 "buffer.js", |
16 "codec.js", | 18 "codec.js", |
17 "connection.js", | 19 "connection.js", |
18 "connector.js", | 20 "connector.js", |
19 "constants.cc", | 21 "constants.cc", |
20 "constants.h", | 22 "constants.h", |
21 "core.js", | 23 "core.js", |
22 "router.js", | 24 "router.js", |
23 "support.js", | 25 "support.js", |
24 "threading.js", | 26 "threading.js", |
25 "unicode.js", | 27 "unicode.js", |
26 "validator.js", | 28 "validator.js", |
27 ] | 29 ] |
28 } | 30 } |
29 | 31 |
| 32 template("js_binary") { |
| 33 closure_compiler_path = "//third_party/closure_compiler/compiler/compiler.jar" |
| 34 output_file_path = "$target_gen_dir/$target_name.js" |
| 35 |
| 36 java_action(target_name) { |
| 37 script = closure_compiler_path |
| 38 sources = invoker.sources |
| 39 outputs = [ |
| 40 "$output_file_path", |
| 41 ] |
| 42 args = [ |
| 43 "--compilation_level", |
| 44 "WHITESPACE_ONLY", |
| 45 "--dependency_mode", |
| 46 "STRICT", |
| 47 "--transform_amd_modules", |
| 48 "--process_common_js_modules", |
| 49 "--language_out", |
| 50 "ECMASCRIPT5", |
| 51 "--formatting", |
| 52 "PRETTY_PRINT", |
| 53 "--js_output_file", |
| 54 rebase_path("$output_file_path", root_build_dir), |
| 55 "--entry_point", |
| 56 rebase_path("main.js", root_build_dir), |
| 57 "--js", |
| 58 ] + rebase_path(sources, root_build_dir) |
| 59 } |
| 60 } |
| 61 |
| 62 js_binary("lib") { |
| 63 sources = [ |
| 64 "bindings.js", |
| 65 "buffer.js", |
| 66 "codec.js", |
| 67 "connection.js", |
| 68 "connector.js", |
| 69 "main.js", |
| 70 "router.js", |
| 71 "unicode.js", |
| 72 "validator.js", |
| 73 ] |
| 74 } |
| 75 |
30 group("tests") { | 76 group("tests") { |
31 testonly = true | 77 testonly = true |
32 | 78 |
33 data = [ | 79 data = [ |
34 "codec_unittests.js", | 80 "codec_unittests.js", |
35 "core_unittests.js", | 81 "core_unittests.js", |
36 "struct_unittests.js", | 82 "struct_unittests.js", |
37 "test/validation_test_input_parser.js", | 83 "test/validation_test_input_parser.js", |
38 "union_unittests.js", | 84 "union_unittests.js", |
39 "validation_unittests.js", | 85 "validation_unittests.js", |
40 "//mojo/public/interfaces/bindings/tests/data/validation/", | 86 "//mojo/public/interfaces/bindings/tests/data/validation/", |
41 ] | 87 ] |
42 public_deps = [ | 88 public_deps = [ |
43 ":bindings", | 89 ":bindings", |
44 ] | 90 ] |
45 } | 91 } |
OLD | NEW |