| OLD | NEW |
| 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/chrome_build.gni") | 5 import("//build/config/chrome_build.gni") |
| 6 import("//build/config/features.gni") | 6 import("//build/config/features.gni") |
| 7 import("//build/toolchain/toolchain.gni") | 7 import("//build/toolchain/toolchain.gni") |
| 8 import("//components/policy/resources/policy_templates.gni") | 8 import("//components/policy/resources/policy_templates.gni") |
| 9 import("//third_party/protobuf/proto_library.gni") | 9 import("//third_party/protobuf/proto_library.gni") |
| 10 import("//tools/grit/grit_rule.gni") | 10 import("//tools/grit/grit_rule.gni") |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 rebase_path(app_restrictions_path, root_build_dir), | 104 rebase_path(app_restrictions_path, root_build_dir), |
| 105 "--risk-tag-header=" + rebase_path(risk_tag_header_path, root_build_dir), | 105 "--risk-tag-header=" + rebase_path(risk_tag_header_path, root_build_dir), |
| 106 chrome_version_path, | 106 chrome_version_path, |
| 107 target_os, | 107 target_os, |
| 108 chromeos_flag, | 108 chromeos_flag, |
| 109 rebase_path("resources/policy_templates.json", root_build_dir), | 109 rebase_path("resources/policy_templates.json", root_build_dir), |
| 110 ] | 110 ] |
| 111 } | 111 } |
| 112 | 112 |
| 113 policy_templates_grd_file = "resources/policy_templates.grd" | 113 policy_templates_grd_file = "resources/policy_templates.grd" |
| 114 grit("policy_templates") { | 114 |
| 115 grit("grit_policy_templates") { |
| 115 source = policy_templates_grd_file | 116 source = policy_templates_grd_file |
| 116 use_qualified_include = true | 117 use_qualified_include = true |
| 117 output_dir = "$root_gen_dir/chrome" | 118 output_dir = "$root_gen_dir/chrome" |
| 118 outputs = [] | 119 outputs = [] |
| 119 defines = [] | 120 defines = [] |
| 120 | 121 |
| 121 if (gen_policy_templates_common) { | 122 if (gen_policy_templates_common) { |
| 122 outputs += policy_templates_doc_outputs | 123 outputs += policy_templates_doc_outputs |
| 123 defines += [ "gen_policy_templates_common" ] | 124 defines += [ "gen_policy_templates_common" ] |
| 124 } | 125 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 136 "mac_bundle_id=$chrome_mac_bundle_id", | 137 "mac_bundle_id=$chrome_mac_bundle_id", |
| 137 "gen_policy_templates_mac", | 138 "gen_policy_templates_mac", |
| 138 ] | 139 ] |
| 139 } | 140 } |
| 140 if (gen_policy_templates_win) { | 141 if (gen_policy_templates_win) { |
| 141 outputs += policy_templates_windows_outputs | 142 outputs += policy_templates_windows_outputs |
| 142 defines += [ "gen_policy_templates_win" ] | 143 defines += [ "gen_policy_templates_win" ] |
| 143 } | 144 } |
| 144 } | 145 } |
| 145 | 146 |
| 147 if (gen_policy_templates_win && is_chrome_branded) { |
| 148 # Creates google.admx and google.adml files that define a common 'Google' |
| 149 # category used for Chrome, Chrome OS and possibly external tools, see |
| 150 # crbug.com/665400. |
| 151 action("create_google_admx") { |
| 152 script = "tools/create_google_admx.py" |
| 153 inputs = [ |
| 154 policy_templates_grd_file, |
| 155 grit_info_script, |
| 156 ] + policy_templates_windows_outputs |
| 157 outputs = policy_templates_windows_google_outputs |
| 158 deps = [ |
| 159 ":grit_policy_templates", |
| 160 ] |
| 161 |
| 162 # Don't pass in outputs directly, it would exceed a limit on Windows! |
| 163 args = [ |
| 164 "--basedir", |
| 165 rebase_path(policy_templates_base_dir, root_build_dir), |
| 166 "--grd_strip_path_prefix", |
| 167 "app/policy/", |
| 168 "--grd_input", |
| 169 rebase_path(policy_templates_grd_file, root_build_dir), |
| 170 "--grit_info", |
| 171 rebase_path(grit_info_script, root_build_dir), |
| 172 "-D", |
| 173 "gen_policy_templates_win", |
| 174 ] + grit_defines |
| 175 } |
| 176 } |
| 177 |
| 178 group("policy_templates") { |
| 179 public_deps = [ |
| 180 ":grit_policy_templates", |
| 181 ] |
| 182 if (gen_policy_templates_win && is_chrome_branded) { |
| 183 public_deps += [ ":create_google_admx" ] |
| 184 } |
| 185 } |
| 186 |
| 146 # Run the proto compiler over the generated file and make it a component. | 187 # Run the proto compiler over the generated file and make it a component. |
| 147 component("cloud_policy_proto_generated_compile") { | 188 component("cloud_policy_proto_generated_compile") { |
| 148 public_deps = [ | 189 public_deps = [ |
| 149 ":cloud_policy_proto_generated_compile_proto", | 190 ":cloud_policy_proto_generated_compile_proto", |
| 150 ] | 191 ] |
| 151 } | 192 } |
| 152 proto_library("cloud_policy_proto_generated_compile_proto") { | 193 proto_library("cloud_policy_proto_generated_compile_proto") { |
| 153 visibility = [ ":cloud_policy_proto_generated_compile" ] | 194 visibility = [ ":cloud_policy_proto_generated_compile" ] |
| 154 sources = [ | 195 sources = [ |
| 155 cloud_policy_proto_path, | 196 cloud_policy_proto_path, |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 resource_dirs = [] | 260 resource_dirs = [] |
| 220 generated_resource_dirs = [ | 261 generated_resource_dirs = [ |
| 221 "$policy_templates_base_dir/android", | 262 "$policy_templates_base_dir/android", |
| 222 _generated_resources_dir, | 263 _generated_resources_dir, |
| 223 ] | 264 ] |
| 224 generated_resource_files = | 265 generated_resource_files = |
| 225 policy_templates_android_outputs + | 266 policy_templates_android_outputs + |
| 226 [ "$_generated_resources_dir/xml-v21/app_restrictions.xml" ] | 267 [ "$_generated_resources_dir/xml-v21/app_restrictions.xml" ] |
| 227 deps = [ | 268 deps = [ |
| 228 ":app_restrictions_resources_copy", | 269 ":app_restrictions_resources_copy", |
| 229 ":policy_templates_grit", | 270 ":grit_policy_templates", |
| 230 ] | 271 ] |
| 231 } | 272 } |
| 232 } else if (gen_policy_templates_mac && is_mac) { | 273 } else if (gen_policy_templates_mac && is_mac) { |
| 233 action("convert_mcx_plist") { | 274 action("convert_mcx_plist") { |
| 234 script = "//build/config/mac/xcrun.py" | 275 script = "//build/config/mac/xcrun.py" |
| 235 sources = [ | 276 sources = [ |
| 236 "$policy_templates_base_dir/mac/app-Manifest.plist", | 277 "$policy_templates_base_dir/mac/app-Manifest.plist", |
| 237 ] | 278 ] |
| 238 inputs = [ | 279 inputs = [ |
| 239 script, | 280 script, |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 "app/policy", | 375 "app/policy", |
| 335 "--extra_input", | 376 "--extra_input", |
| 336 version_file, | 377 version_file, |
| 337 "--grit_info", | 378 "--grit_info", |
| 338 rebase_path(grit_info_script, root_build_dir), | 379 rebase_path(grit_info_script, root_build_dir), |
| 339 "-D", | 380 "-D", |
| 340 "gen_policy_templates_common", | 381 "gen_policy_templates_common", |
| 341 "-D", | 382 "-D", |
| 342 "gen_policy_templates_win", | 383 "gen_policy_templates_win", |
| 343 ] + grit_defines | 384 ] + grit_defines |
| 385 if (is_chrome_branded) { |
| 386 args += [ "--include_google_admx" ] |
| 387 } |
| 344 deps = [ | 388 deps = [ |
| 345 ":add_version", | 389 ":add_version", |
| 346 ":policy_templates", | 390 ":policy_templates", |
| 347 ] | 391 ] |
| 348 } | 392 } |
| 349 } | 393 } |
| 350 } | 394 } |
| OLD | NEW |