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

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

Issue 1950493002: [Mac/GN] Move the bundle ID and creator code into the BRANDING file, and use it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
« build/util/branding.gni ('K') | « chrome/app_shim/BUILD.gn ('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/chrome_build.gni") 5 import("//build/config/chrome_build.gni")
6 import("//build/config/features.gni") 6 import("//build/config/features.gni")
7 import("//components/policy/resources/policy_templates.gni") 7 import("//components/policy/resources/policy_templates.gni")
8 import("//third_party/protobuf/proto_library.gni") 8 import("//third_party/protobuf/proto_library.gni")
9 import("//tools/grit/grit_rule.gni") 9 import("//tools/grit/grit_rule.gni")
10 10
11 if (is_mac) {
12 import("//build/util/branding.gni")
13 }
14
11 # About the policy component: 15 # About the policy component:
12 # 16 #
13 # There should really be two components. One called "policy" that includes all 17 # There should really be two components. One called "policy" that includes all
14 # generated code, and one "policy/proto" like we have now. The proto needs to 18 # generated code, and one "policy/proto" like we have now. The proto needs to
15 # be separate for cases like SesssionManagerClient which uses the protos to 19 # be separate for cases like SesssionManagerClient which uses the protos to
16 # communicate with the Chrome OS system layer, but doesn't need the rest of the 20 # communicate with the Chrome OS system layer, but doesn't need the rest of the
17 # policy stuff). 21 # policy stuff).
18 # 22 #
19 # The reason the rest of the targets exist are artifacts of the way the GYP 23 # The reason the rest of the targets exist are artifacts of the way the GYP
20 # build works. The current "policy" target which is really just some generated 24 # build works. The current "policy" target which is really just some generated
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 outputs = policy_templates_doc_outputs 139 outputs = policy_templates_doc_outputs
136 if (is_android) { 140 if (is_android) {
137 outputs += policy_templates_android_outputs 141 outputs += policy_templates_android_outputs
138 } 142 }
139 if (is_linux) { 143 if (is_linux) {
140 outputs += policy_templates_linux_outputs 144 outputs += policy_templates_linux_outputs
141 } 145 }
142 if (is_mac) { 146 if (is_mac) {
143 outputs += policy_templates_mac_outputs 147 outputs += policy_templates_mac_outputs
144 148
145 # TODO(knn) : Move this out once more targets use this. 149 defines = [ "mac_bundle_id=$chrome_mac_bundle_id" ]
146 if (is_chrome_branded) {
147 mac_bundle_id = "com.google.Chrome"
148 } else {
149 mac_bundle_id = "org.chromium.Chromium"
150 }
151 defines = [ "mac_bundle_id=$mac_bundle_id" ]
152 } 150 }
153 if (is_win) { 151 if (is_win) {
154 outputs += policy_templates_windows_outputs 152 outputs += policy_templates_windows_outputs
155 } 153 }
156 } 154 }
157 155
158 # Run the proto compiler over the generated file and make it a component. 156 # Run the proto compiler over the generated file and make it a component.
159 component("cloud_policy_proto_generated_compile") { 157 component("cloud_policy_proto_generated_compile") {
160 public_deps = [ 158 public_deps = [
161 ":cloud_policy_proto_generated_compile_proto", 159 ":cloud_policy_proto_generated_compile_proto",
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 ":policy_templates_grit", # For policy_templates_android_outputs. 325 ":policy_templates_grit", # For policy_templates_android_outputs.
328 ] 326 ]
329 } 327 }
330 328
331 group("app_restrictions_resources") { 329 group("app_restrictions_resources") {
332 deps = [ 330 deps = [
333 ":$build_config_target_name", 331 ":$build_config_target_name",
334 ":$zip_target_name", 332 ":$zip_target_name",
335 ] 333 ]
336 } 334 }
335 } else if (is_mac) {
336 action("convert_mcx_plist") {
337 script = "//build/config/mac/xcrun.py"
338 sources = [
339 "$policy_templates_base_dir/mac/app-Manifest.plist",
340 ]
341 inputs = [
342 script,
343 ]
344 outputs = [
345 "$target_gen_dir/$chrome_mac_bundle_id.plist",
346 ]
347
348 args = [
349 "xcrun",
350 "plutil",
351 "-convert",
352 "xml1",
353 ] + rebase_path(sources, root_out_dir) + [ "-o" ] +
354 rebase_path(outputs, root_out_dir)
355
356 deps = [
357 ":policy_templates",
358 ]
359 }
360
361 bundle_data("manifest_bundle_data") {
362 sources = get_target_outputs(":convert_mcx_plist")
363 outputs = [
364 "{{bundle_resources_dir}}/{{source_file_part}}",
365 ]
366 public_deps = [
367 ":convert_mcx_plist",
368 ]
369 }
370
371 # The reason we are not enumerating all the locales is that
372 # the translations would eat up 3.5MB disk space in the
373 # application bundle.
374 bundle_data("manifest_strings_bundle_data") {
375 sources = [
376 "$policy_templates_base_dir/mac/strings/en.lproj/Localizable.strings",
377 ]
378 outputs = [
379 "{{bundle_resources_dir}}/en.lproj/{{source_file_part}}",
380 ]
381 public_deps = [
382 ":policy_templates",
383 ]
384 }
385
386 create_bundle("chrome_manifest_bundle") {
387 bundle_root_dir = "$root_out_dir/$chrome_mac_bundle_id.manifest/Contents"
388 bundle_resources_dir = "$bundle_root_dir/Resources"
389
390 deps = [
391 ":manifest_bundle_data",
392 ":manifest_strings_bundle_data",
393 ]
394 }
337 } 395 }
338 } 396 }
339 #TODO(GYP) chrome_manifest_bundle
OLDNEW
« build/util/branding.gni ('K') | « chrome/app_shim/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698