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

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

Issue 2481183002: Generate ADMX template for Chrome OS policies (Closed)
Patch Set: Couple of fixes after testing Created 3 years, 3 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 | « no previous file | components/policy/resources/policy_templates.gni » ('j') | 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/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")
11 11
12 assert(!is_ios, "Policy should not be referenced on iOS") 12 assert(!is_ios, "Policy should not be referenced on iOS")
13 13
14 # To test policy generation for platforms different than your OS, override and 14 # To test policy generation for platforms different than your OS, override and
15 # enable these flags (but don't check that in!). 15 # enable these flags (but don't check that in!).
16 gen_policy_templates_common = true 16 gen_policy_templates_common = true
17 gen_policy_templates_win = is_win 17 gen_policy_templates_win = is_win
18 gen_policy_templates_linux = is_linux 18 gen_policy_templates_linux = is_linux
19 gen_policy_templates_android = is_android 19 gen_policy_templates_android = is_android
20 gen_policy_templates_mac = is_mac 20 gen_policy_templates_mac = is_mac
21 gen_policy_templates_chromeos = is_chromeos
22
23 # The zip file is grabbed from the Windows build right now.
24 gen_policy_templates_zip = is_win
25
26 # Make sure all dependencies of the zip are built.
27 if (gen_policy_templates_zip) {
28 gen_policy_templates_common = true
29 gen_policy_templates_win = true
30 gen_policy_templates_chromeos = true
31 }
21 32
22 if (is_mac) { 33 if (is_mac) {
23 import("//build/util/branding.gni") 34 import("//build/util/branding.gni")
24 } else if (gen_policy_templates_mac) { 35 } else if (gen_policy_templates_mac) {
25 chrome_mac_bundle_id = "DUMMY_MAC_BUNDLE_ID" 36 chrome_mac_bundle_id = "DUMMY_MAC_BUNDLE_ID"
26 } 37 }
27 38
28 if (is_component_build) { 39 if (is_component_build) {
29 # External code should depend on either //components/policy/core/browser or 40 # External code should depend on either //components/policy/core/browser or
30 # .../common depending on what code it needs. 41 # .../common depending on what code it needs.
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 # crbug.com/665400. 241 # crbug.com/665400.
231 outputs += policy_templates_win_google_outputs 242 outputs += policy_templates_win_google_outputs
232 args += [ 243 args += [
233 "--google_adml", 244 "--google_adml",
234 rebase_path(policy_templates_win_google_adml_path, root_build_dir), 245 rebase_path(policy_templates_win_google_adml_path, root_build_dir),
235 "--google_admx", 246 "--google_admx",
236 rebase_path(policy_templates_win_google_admx_path, root_build_dir), 247 rebase_path(policy_templates_win_google_admx_path, root_build_dir),
237 ] 248 ]
238 } 249 }
239 } 250 }
251 if (gen_policy_templates_chromeos) {
252 outputs += policy_templates_chromeos_outputs
253 args += [
254 "--chromeos_adml",
255 rebase_path(policy_templates_chromeos_adml_path, root_build_dir),
256 "--chromeos_admx",
257 rebase_path(policy_templates_chromeos_admx_path, root_build_dir),
258 ]
259 if (is_chrome_branded) {
260 # Create google.admx and google.adml files that define a common 'Google'
261 # category used for Chrome, Chrome OS and possibly external tools, see
262 # crbug.com/665400.
263 outputs += policy_templates_chromeos_google_outputs
264 args += [
265 "--google_adml",
266 rebase_path(policy_templates_chromeos_google_adml_path, root_build_dir),
267 "--google_admx",
268 rebase_path(policy_templates_chromeos_google_admx_path, root_build_dir),
269 ]
270 }
271 }
240 } 272 }
241 273
242 # Run the proto compiler over the generated file and make it a component. 274 # Run the proto compiler over the generated file and make it a component.
243 component("cloud_policy_proto_generated_compile") { 275 component("cloud_policy_proto_generated_compile") {
244 public_deps = [ 276 public_deps = [
245 ":cloud_policy_proto_generated_compile_proto", 277 ":cloud_policy_proto_generated_compile_proto",
246 ] 278 ]
247 } 279 }
248 proto_library("cloud_policy_proto_generated_compile_proto") { 280 proto_library("cloud_policy_proto_generated_compile_proto") {
249 visibility = [ 281 visibility = [
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 bundle_root_dir = "$root_out_dir/$chrome_mac_bundle_id.manifest/Contents" 437 bundle_root_dir = "$root_out_dir/$chrome_mac_bundle_id.manifest/Contents"
406 bundle_resources_dir = "$bundle_root_dir/Resources" 438 bundle_resources_dir = "$bundle_root_dir/Resources"
407 439
408 deps = [ 440 deps = [
409 ":manifest_bundle_data", 441 ":manifest_bundle_data",
410 ":manifest_strings_bundle_data", 442 ":manifest_strings_bundle_data",
411 ] 443 ]
412 } 444 }
413 } 445 }
414 446
415 if (gen_policy_templates_common && gen_policy_templates_win) { 447 if (gen_policy_templates_zip) {
416 version_path = "$policy_templates_base_dir/VERSION" 448 version_path = "$policy_templates_base_dir/VERSION"
417 449
418 copy("add_version") { 450 copy("add_version") {
419 sources = [ 451 sources = [
420 "//chrome/VERSION", 452 "//chrome/VERSION",
421 ] 453 ]
422 outputs = [ 454 outputs = [
423 version_path, 455 version_path,
424 ] 456 ]
425 } 457 }
426 458
427 action("pack_policy_templates") { 459 action("pack_policy_templates") {
428 output_zip_file = "$root_out_dir/policy_templates.zip" 460 output_zip_file = "$root_out_dir/policy_templates.zip"
429 script = "tools/make_policy_zip.py" 461 script = "tools/make_policy_zip.py"
430 inputs = [ version_path ] + policy_templates_win_outputs + 462 inputs = [ version_path ] + policy_templates_win_outputs +
431 policy_templates_common_outputs 463 policy_templates_chromeos_outputs + policy_templates_common_outputs
432 outputs = [ 464 outputs = [
433 output_zip_file, 465 output_zip_file,
434 ] 466 ]
435 args = [ 467 args = [
436 "--output", 468 "--output",
437 rebase_path(output_zip_file, root_build_dir), 469 rebase_path(output_zip_file, root_build_dir),
438 "--base_dir", 470 "--base_dir",
439 rebase_path(policy_templates_base_dir, root_build_dir), 471 rebase_path(policy_templates_base_dir, root_build_dir),
440 "--languages", 472 "--languages",
441 policy_templates_languages_str, 473 policy_templates_languages_str,
442 "--add", 474 "--add",
443 rebase_path(version_path, root_build_dir), 475 rebase_path(version_path, root_build_dir),
444 "--add", 476 "--add",
445 rebase_path(policy_templates_doc_path, root_build_dir), 477 rebase_path(policy_templates_doc_path, root_build_dir),
446 "--add", 478 "--add",
447 rebase_path(policy_templates_win_reg_path, root_build_dir), 479 rebase_path(policy_templates_win_reg_path, root_build_dir),
448 "--add", 480 "--add",
449 rebase_path(policy_templates_win_adm_path, root_build_dir), 481 rebase_path(policy_templates_win_adm_path, root_build_dir),
450 "--add", 482 "--add",
451 rebase_path(policy_templates_win_adml_path, root_build_dir), 483 rebase_path(policy_templates_win_adml_path, root_build_dir),
452 "--add", 484 "--add",
453 rebase_path(policy_templates_win_admx_path, root_build_dir), 485 rebase_path(policy_templates_win_admx_path, root_build_dir),
486 "--add",
487 rebase_path(policy_templates_chromeos_adml_path, root_build_dir),
488 "--add",
489 rebase_path(policy_templates_chromeos_admx_path, root_build_dir),
454 ] 490 ]
455 if (is_chrome_branded) { 491 if (is_chrome_branded) {
456 inputs += policy_templates_win_google_outputs 492 inputs += policy_templates_win_google_outputs
493 inputs += policy_templates_chromeos_google_outputs
457 args += [ 494 args += [
458 "--add", 495 "--add",
459 rebase_path(policy_templates_win_google_adml_path, root_build_dir), 496 rebase_path(policy_templates_win_google_adml_path, root_build_dir),
460 "--add", 497 "--add",
461 rebase_path(policy_templates_win_google_admx_path, root_build_dir), 498 rebase_path(policy_templates_win_google_admx_path, root_build_dir),
499 "--add",
500 rebase_path(policy_templates_chromeos_google_adml_path, root_build_dir),
501 "--add",
502 rebase_path(policy_templates_chromeos_google_admx_path, root_build_dir),
462 ] 503 ]
463 } 504 }
464 deps = [ 505 deps = [
465 ":add_version", 506 ":add_version",
466 ":policy_templates", 507 ":policy_templates",
467 ] 508 ]
468 } 509 }
469 } 510 }
OLDNEW
« no previous file with comments | « no previous file | components/policy/resources/policy_templates.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698