OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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("//third_party/closure_compiler/closure_args.gni") |
| 6 import("//third_party/document_image_extractor/document_image_extractor.gni") |
5 import("//tools/grit/grit_rule.gni") | 7 import("//tools/grit/grit_rule.gni") |
6 | 8 |
7 closure_out_dir = "$root_gen_dir/closure/components/resources/enhanced_bookmarks
" | 9 closure_out_dir = |
| 10 "$root_gen_dir/closure/components/resources/enhanced_bookmarks" |
8 | 11 |
9 # GYP version: components/resources/enhanced_bookmarks/enhanced_bookmarks_resour
ces.gyp | 12 # GYP version: components/resources/enhanced_bookmarks/enhanced_bookmarks_resour
ces.gyp |
10 # (generate_enhanced_bookmarks_resources action) | |
11 grit("enhanced_bookmarks_resources") { | 13 grit("enhanced_bookmarks_resources") { |
12 source = "enhanced_bookmarks_resources.grd" | 14 source = "enhanced_bookmarks_resources.grd" |
13 | 15 |
14 outputs = [ | 16 outputs = [ |
15 "grit/enhanced_bookmarks_resources.h", | 17 "grit/enhanced_bookmarks_resources.h", |
16 "enhanced_bookmarks_resources.pak", | 18 "enhanced_bookmarks_resources.pak", |
17 ] | 19 ] |
18 output_dir = "$root_gen_dir/components/resources/enhanced_bookmarks" | 20 output_dir = "$root_gen_dir/components/resources/enhanced_bookmarks" |
19 deps = [ | 21 deps = [ |
20 "//components/resources/enhanced_bookmarks:document_image_extractor", | 22 "//components/resources/enhanced_bookmarks:document_image_extractor", |
21 "//components/resources/enhanced_bookmarks:dom_initializer", | 23 "//components/resources/enhanced_bookmarks:dom_initializer", |
22 ] | 24 ] |
23 | 25 |
24 get_salient_image_url_gen_js = "${closure_out_dir}/get_salient_image_url.js" | 26 get_salient_image_url_gen_js = "${closure_out_dir}/get_salient_image_url.js" |
25 dom_initializer_gen_js = "${closure_out_dir}/dom_initializer.js" | 27 dom_initializer_gen_js = "${closure_out_dir}/dom_initializer.js" |
26 | 28 |
27 grit_flags = [ | 29 grit_flags = [ |
28 "-E", | 30 "-E", |
29 "get_salient_image_url_gen_js=" + | 31 "get_salient_image_url_gen_js=" + |
30 rebase_path(get_salient_image_url_gen_js, root_build_dir), | 32 rebase_path(get_salient_image_url_gen_js, root_build_dir), |
31 "-E", | 33 "-E", |
32 "dom_initializer_gen_js=" + | 34 "dom_initializer_gen_js=" + |
33 rebase_path(dom_initializer_gen_js, root_build_dir), | 35 rebase_path(dom_initializer_gen_js, root_build_dir), |
34 ] | 36 ] |
35 } | 37 } |
36 | 38 |
37 # GYP version: components/resources/enhanced_bookmarks/enhanced_bookmarks.gypi | 39 # GYP version: components/resources/enhanced_bookmarks/enhanced_bookmarks.gypi |
38 import("//third_party/document_image_extractor/document_image_extractor.gni") | |
39 | |
40 rebased_closure_out_dir = rebase_path(root_gen_dir, "../") + | 40 rebased_closure_out_dir = rebase_path(root_gen_dir, "../") + |
41 "/closure/components/resources/enhanced_bookmarks/" | 41 "/closure/components/resources/enhanced_bookmarks/" |
42 | 42 |
43 action("document_image_extractor") { | 43 action("document_image_extractor") { |
44 script = "//third_party/closure_compiler/compile.py" | 44 script = "//third_party/closure_compiler/compile.py" |
45 sources = [ | 45 sources = [ |
46 "get_salient_image_url.js", | 46 "get_salient_image_url.js", |
47 ] | 47 ] |
48 outputs = [ | 48 outputs = [ |
49 "${closure_out_dir}/get_salient_image_url.js", | 49 "${closure_out_dir}/get_salient_image_url.js", |
50 ] | 50 ] |
51 | 51 |
52 document_image_extractor_sources = | 52 document_image_extractor_sources = |
53 rebase_path(document_image_extractor_js_files, "third_party/", "../") | 53 rebase_path(document_image_extractor_js_files, "third_party/", "../") |
54 | 54 |
55 args = | 55 args = [ "../../components/resources/enhanced_bookmarks/get_salient_image_url.
js" ] + document_image_extractor_sources + [ |
56 [ "../../components/resources/enhanced_bookmarks/get_salient_image_url.
js" ] + | 56 "--out-file=${rebased_closure_out_dir}/get_salient_image_url.js", |
57 document_image_extractor_sources + | |
58 [ | |
59 "--out_file=${rebased_closure_out_dir}/get_salient_image_url.js", | |
60 "--no-single-file", | 57 "--no-single-file", |
61 "--output_wrapper", | 58 "--closure-args", |
62 "(function(){%output% return GetSalientImageUrl();})();", | 59 ] + closure_args + default_disabled_closure_args + [ "output_wrapper='(
function(){%output% return GetSalientImageUrl();})();'" ] |
63 ] | |
64 } | 60 } |
65 | 61 |
66 action("dom_initializer") { | 62 action("dom_initializer") { |
67 script = "//third_party/closure_compiler/compile.py" | 63 script = "//third_party/closure_compiler/compile.py" |
68 sources = [ | 64 sources = [ |
69 "dom_initializer.js", | 65 "dom_initializer.js", |
70 ] | 66 ] |
71 outputs = [ | 67 outputs = [ |
72 "${closure_out_dir}/dom_initializer.js", | 68 "${closure_out_dir}/dom_initializer.js", |
73 ] | 69 ] |
74 | 70 |
75 dom_controller_sources = | 71 dom_controller_sources = |
76 rebase_path(dom_controller_js_files, "third_party/", "../") | 72 rebase_path(dom_controller_js_files, "third_party/", "../") |
77 | 73 |
78 args = | 74 args = |
79 [ "../../components/resources/enhanced_bookmarks/dom_initializer.js" ] + | 75 [ "../../components/resources/enhanced_bookmarks/dom_initializer.js" ] + |
80 dom_controller_sources + | 76 dom_controller_sources + |
81 [ | 77 [ |
82 "--out_file=${rebased_closure_out_dir}/dom_initializer.js", | 78 "--out-file=${rebased_closure_out_dir}/dom_initializer.js", |
83 "--no-single-file", | 79 "--no-single-file", |
84 "--output_wrapper", | 80 "--closure-args", |
85 "(function(){%output%})();", | 81 ] + closure_args + default_disabled_closure_args + |
86 ] | 82 [ "output_wrapper='(function(){%output%})();'" ] |
87 } | 83 } |
OLD | NEW |