Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / ui / resources / BUILD.gn
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.
4
5 import("//tools/grit/grit_rule.gni")
6 import("//tools/grit/repack.gni")
7
8 # GYP version: ui/resources/ui_resources.gyp:ui_resources
9 group("resources") {
10   deps = [
11     ":ui_resources_grd",
12     ":ui_unscaled_resources_grd",
13     ":webui_resources_grd",
14   ]
15 }
16
17 grit("ui_resources_grd") {
18   source = "ui_resources.grd"
19   outputs = [
20     "grit/ui_resources.h",
21     "grit/ui_resources_map.cc",
22     "grit/ui_resources_map.h",
23     "ui_resources_100_percent.pak",
24     "ui_resources_200_percent.pak",
25     "ui_resources_300_percent.pak",
26   ]
27 }
28
29 grit("ui_unscaled_resources_grd") {
30   source = "ui_unscaled_resources.grd"
31   use_qualified_include = true
32   outputs = [
33     "grit/ui_unscaled_resources.h",
34     "ui_unscaled_resources.rc",
35   ]
36 }
37
38 grit("webui_resources_grd") {
39   source = "../webui/resources/webui_resources.grd"
40   outputs = [
41     "grit/webui_resources.h",
42     "grit/webui_resources_map.cc",
43     "grit/webui_resources_map.h",
44     "webui_resources.pak",
45   ]
46 }
47
48 if (!is_mac) {
49   copy("copy_ui_resources_100_percent") {
50     sources = [ "$root_gen_dir/ui/resources/ui_resources_100_percent.pak" ]
51     outputs = [ "$root_out_dir/ui_resources_100_percent.pak" ]
52     deps = [ "//ui/resources" ]
53   }
54 }
55
56 # On iOS and Mac the string resources need to go into a locale subfolder, which
57 # introduces an extra dependency.
58 #
59 # GYP version: ui/resources/ui_resources.gyp:ui_test_pak
60 #              (copy_ui_test_pak action)
61 if (is_ios || is_mac) {
62   group("ui_test_pak") {
63     deps = [ ":repack_ui_test_pak", ":repack_ui_test_mac_locale_pack" ]
64   }
65 } else {
66   group("ui_test_pak") {
67     deps = [ ":repack_ui_test_pak" ]
68   }
69 }
70
71 # GYP version: ui/resources/ui_resources.gyp:ui_test_pak
72 repack("repack_ui_test_pak") {
73   # Depend on ui_test_pak instead of this one.
74   visibility = [ ":ui_test_pak" ]
75
76   sources = [
77     "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
78     "$root_gen_dir/ui/resources/webui_resources.pak",
79     "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak",
80     "$root_gen_dir/ui/strings/ui_strings_en-US.pak",
81   ]
82
83   if (is_chromeos) {
84     sources += [
85       "$root_gen_dir/ui/chromeos/resources/ui_chromeos_resources_100_percent.pak",
86       "$root_gen_dir/ui/chromeos/strings/ui_chromeos_strings_en-US.pak",
87     ]
88   }
89
90   output = "$root_out_dir/ui_test.pak"
91
92   deps = [
93     "//ui/resources",
94     "//ui/strings",
95   ]
96
97   if (!is_mac) {
98     deps += [ ":copy_ui_resources_100_percent" ]
99   }
100
101   if (is_chromeos) {
102     deps += [
103       "//ui/chromeos/resources",
104       "//ui/chromeos/strings",
105     ]
106   }
107 }
108
109 # Repack just the strings for the framework locales on Mac and iOS. This
110 # emulates repack_locales.py, but just for en-US. Note ui_test.pak is not simply
111 # copied, because it causes leaks from allocations within system libraries when
112 # trying to load non-string resources. http://crbug.com/413034.
113 repack("repack_ui_test_mac_locale_pack") {
114   visibility = [ ":ui_test_pak" ]
115
116   sources = [
117     "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak",
118     "$root_gen_dir/ui/strings/ui_strings_en-US.pak",
119   ]
120
121   output = "$root_out_dir/ui/en.lproj/locale.pak"
122
123   deps = [
124     "//ui/strings",
125   ]
126 }