Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(409)

Side by Side Diff: components/policy/BUILD.gn

Issue 1038903002: Upstream Android App Restrictions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/policy.gypi ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/config/android/rules.gni")
cjhopman 2015/03/26 22:05:08 This should only be imported for android builds (i
knn 2015/03/27 00:52:11 Done.
5 import("//build/config/features.gni") 6 import("//build/config/features.gni")
7 import("resources/policy_templates.gni")
6 import("//third_party/protobuf/proto_library.gni") 8 import("//third_party/protobuf/proto_library.gni")
7 import("//tools/grit/grit_rule.gni") 9 import("//tools/grit/grit_rule.gni")
8 10
9 if (is_component_build) { 11 if (is_component_build) {
10 component("policy_component") { 12 component("policy_component") {
11 deps = [ 13 deps = [
12 "//components/policy/core/browser", 14 "//components/policy/core/browser",
13 "//components/policy/core/common", 15 "//components/policy/core/common",
14 ] 16 ]
15 } 17 }
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 rebase_path(protobuf_decoder_path, root_build_dir), 101 rebase_path(protobuf_decoder_path, root_build_dir),
100 "--app-restrictions-definition=" + 102 "--app-restrictions-definition=" +
101 rebase_path(app_restrictions_path, root_build_dir), 103 rebase_path(app_restrictions_path, root_build_dir),
102 target_os, 104 target_os,
103 chromeos_flag, 105 chromeos_flag,
104 rebase_path("resources/policy_templates.json", root_build_dir), 106 rebase_path("resources/policy_templates.json", root_build_dir),
105 ] 107 ]
106 } 108 }
107 109
108 grit("policy_templates") { 110 grit("policy_templates") {
109 import("resources/policy_templates.gni")
110 source = "resources/policy_templates.grd" 111 source = "resources/policy_templates.grd"
111 use_qualified_include = true 112 use_qualified_include = true
112 depend_on_stamp = true 113 depend_on_stamp = true
113 output_dir = "$root_gen_dir/chrome" 114 output_dir = "$root_gen_dir/chrome"
114 outputs = policy_templates_doc_outputs 115 outputs = policy_templates_doc_outputs
115 if (is_android) { 116 if (is_android) {
116 outputs += policy_templates_android_outputs 117 outputs += policy_templates_android_outputs
117 } 118 }
118 if (is_linux) { 119 if (is_linux) {
119 outputs += policy_templates_linux_outputs 120 outputs += policy_templates_linux_outputs
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 } 230 }
230 231
231 deps = [ 232 deps = [
232 ":policy_component", 233 ":policy_component",
233 ":test_support", 234 ":test_support",
234 "//components/policy/proto", 235 "//components/policy/proto",
235 "//testing/gmock", 236 "//testing/gmock",
236 "//testing/gtest", 237 "//testing/gtest",
237 ] 238 ]
238 } 239 }
240
241 if (is_android) {
242 group("app_restrictions_resources") {
243 resources_zip = "res.java/$target_name.zip"
244 input_resources_dir = "$root_gen_dir/chrome/app/policy/android"
245 input_resources = [ "$input_resources_dir/xml-v21/app_restrictions.xml" ]
246 input_resources += policy_templates_android_outputs
247 build_config_path = "$target_gen_dir/$target_name.build_config"
248 copy("${target_name}__consolidate_resources") {
249 sources = [
250 "$root_gen_dir/policy/app_restrictions.xml",
251 ]
252 outputs = [
253 "$root_gen_dir/chrome/app/policy/android/xml-v21/app_restrictions.xml" ,
254 ]
255 }
256
257 # TODO(knn,cjhopman): The write_build_config template is in
258 # //build/config/android/internal_rules.gni and is not meant for external
259 # use. The public rules (in rules.gni) should be updated to support what
260 # we are doing here.
261 write_build_config("${target_name}__build_config") {
262 build_config = build_config_path
263 resources_zip = "$root_build_dir/$resources_zip"
264 type = "android_resources"
265 }
266 action("${target_name}__create_zip") {
267 script = "//build/android/gn/zip.py"
268 outputs = [
269 "$root_build_dir/$resources_zip",
270 ]
271 inputs = input_resources
272 rebased_inputs = rebase_path(input_resources, root_build_dir)
273 args = [
274 "--inputs=$rebased_inputs",
275 "--output=$resources_zip",
276 "--base-dir",
277 rebase_path(input_resources_dir, root_build_dir),
278 ]
279 }
280 deps = [
281 ":${target_name}__consolidate_resources",
282 ":${target_name}__build_config",
283 ":${target_name}__create_zip",
284 ]
285 }
286 }
239 } 287 }
240 #TODO(GYP) chrome_manifest_bundle 288 #TODO(GYP) chrome_manifest_bundle
OLDNEW
« no previous file with comments | « components/policy.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698