Add MetricsService::WasLastShutdownClean()
[chromium-blink-merge.git] / remoting / resources / BUILD.gn
blobd28753be6d2f5cc3e9af27717cb2ffb228117873
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
3 # found in the LICENSE file.
5 import("//remoting/remoting_locales.gni")
6 import("//tools/grit/grit_rule.gni")
8 group("resources") {
9   deps = [
10     ":copy_locales",
11     ":strings",
13     #":verify_resources",  TODO(GYP) enable this.
14   ]
17 # TODO(GYP) enable verify_resources. The bots are complaining about
18 # gen/main.html not being found but this doesn't seems to reproduce locally.
19 if (false) {
20   action("verify_resources") {
21     script = "//remoting/tools/verify_resources.py"
23     sources_to_verify = [
24       "$root_gen_dir/main.html",
25       "../base/resources_unittest.cc",
26       "../host/continue_window_mac.mm",
27       "../host/disconnect_window_mac.mm",
28       "../host/installer/mac/uninstaller/remoting_uninstaller-InfoPlist.strings.jinja2",
29       "../host/mac/me2me_preference_pane-InfoPlist.strings.jinja2",
30       "../host/win/core.rc.jinja2",
31       "../host/win/host_messages.mc.jinja2",
32       "../host/win/version.rc.jinja2",
33       "../resources/play_store_resources.cc",
34       "../webapp/background/background.js",
35       "../webapp/butter_bar.js",
36       "../webapp/client_screen.js",
37       "../webapp/error.js",
38       "../webapp/host_list.js",
39       "../webapp/host_setup_dialog.js",
40       "../webapp/host_table_entry.js",
41       "../webapp/manifest.json.jinja2",
42       "../webapp/paired_client_manager.js",
43       "../webapp/remoting.js",
44       "../webapp/window_frame.js",
45     ]
47     inputs = [ "remoting_strings.grd" ] + sources_to_verify
49     stampfile = "$root_build_dir/remoting_resources_verified_stamp"
50     outputs = [
51       stampfile,
52     ]
54     args = [
55              "-t",
56              rebase_path(stampfile, root_build_dir),
57              "-r",
58              rebase_path("remoting_strings.grd", root_build_dir),
59            ] + rebase_path(sources_to_verify, root_build_dir)
61     deps = [
62       "//remoting/webapp:main_html",
63     ]  # Generates main.html.
64   }
65 }  # if false
67 grit("strings") {
68   source = "remoting_strings.grd"
69   output_name = "remoting_strings"
71   # The grd file encodes "remoting/..." in the name, so root everything in the
72   # generated file root.
73   output_dir = root_gen_dir
75   outputs = [
76     "remoting/base/string_resources.h",
77   ]
79   # The grd produces a *.pak file and a messages.json file (this one uses
80   # underscores instead of hyphens) for each locale.
81   outputs +=
82       process_file_template(remoting_locales,
83                             [ "remoting/resources/{{source_name_part}}.pak" ])
85   outputs += remoting_webapp_locale_files
88 action("copy_locales") {
89   script = "../tools/build/remoting_copy_locales.py"
91   # The gyp build calls out to Python, but the Python just computes a simple
92   # replacement over the locales. Here, we can do this in GN script by
93   # pretending the locale list is a list of files. The {{source_name_part}}
94   # will just expand to the locale name.
95   inputs = process_file_template(remoting_locales,
96                                  [ "$target_gen_dir/{{source_name_part}}.pak" ])
98   # Likewise, process the outputs in the same way as the inputs.
99   if (is_mac || is_ios) {
100     # On mac, use underscores instead of hyphens and put the files in a
101     # different place.
102     outputs = process_file_template(
103             remoting_locales_with_underscores,
104             [ "$root_build_dir/remoting/resources/{{source_name_part}}.lproj/locale.pak" ])
105   } else {
106     outputs = process_file_template(
107             remoting_locales,
108             [ "$root_build_dir/remoting_locales/{{source_name_part}}.pak" ])
109   }
111   args = [
112            "-p",
113            current_os,
114            "-g",
115            rebase_path(root_gen_dir, root_build_dir),
116            "-x",
117            rebase_path(root_out_dir, root_build_dir),
118          ] + remoting_locales
120   deps = [
121     ":strings",
122   ]