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

Unified 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, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/policy.gypi ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/policy/BUILD.gn
diff --git a/components/policy/BUILD.gn b/components/policy/BUILD.gn
index 24b424f577ea87f01a522828092a2a0da8341e79..a189ea3a3577e2443af467408373d88eeec088f1 100644
--- a/components/policy/BUILD.gn
+++ b/components/policy/BUILD.gn
@@ -2,7 +2,9 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+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.
import("//build/config/features.gni")
+import("resources/policy_templates.gni")
import("//third_party/protobuf/proto_library.gni")
import("//tools/grit/grit_rule.gni")
@@ -106,7 +108,6 @@ if (enable_configuration_policy) {
}
grit("policy_templates") {
- import("resources/policy_templates.gni")
source = "resources/policy_templates.grd"
use_qualified_include = true
depend_on_stamp = true
@@ -236,5 +237,52 @@ if (enable_configuration_policy) {
"//testing/gtest",
]
}
+
+ if (is_android) {
+ group("app_restrictions_resources") {
+ resources_zip = "res.java/$target_name.zip"
+ input_resources_dir = "$root_gen_dir/chrome/app/policy/android"
+ input_resources = [ "$input_resources_dir/xml-v21/app_restrictions.xml" ]
+ input_resources += policy_templates_android_outputs
+ build_config_path = "$target_gen_dir/$target_name.build_config"
+ copy("${target_name}__consolidate_resources") {
+ sources = [
+ "$root_gen_dir/policy/app_restrictions.xml",
+ ]
+ outputs = [
+ "$root_gen_dir/chrome/app/policy/android/xml-v21/app_restrictions.xml",
+ ]
+ }
+
+ # TODO(knn,cjhopman): The write_build_config template is in
+ # //build/config/android/internal_rules.gni and is not meant for external
+ # use. The public rules (in rules.gni) should be updated to support what
+ # we are doing here.
+ write_build_config("${target_name}__build_config") {
+ build_config = build_config_path
+ resources_zip = "$root_build_dir/$resources_zip"
+ type = "android_resources"
+ }
+ action("${target_name}__create_zip") {
+ script = "//build/android/gn/zip.py"
+ outputs = [
+ "$root_build_dir/$resources_zip",
+ ]
+ inputs = input_resources
+ rebased_inputs = rebase_path(input_resources, root_build_dir)
+ args = [
+ "--inputs=$rebased_inputs",
+ "--output=$resources_zip",
+ "--base-dir",
+ rebase_path(input_resources_dir, root_build_dir),
+ ]
+ }
+ deps = [
+ ":${target_name}__consolidate_resources",
+ ":${target_name}__build_config",
+ ":${target_name}__create_zip",
+ ]
+ }
+ }
}
#TODO(GYP) chrome_manifest_bundle
« 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