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

Unified 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, 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 side-by-side diff with in-line comments
Download patch
« build/util/branding.gni ('K') | « chrome/app_shim/BUILD.gn ('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 c13fb6f92085b7105ca9db25888b993c72379943..2ca6027e6f03715f5a6130eb6571d7d58136946f 100644
--- a/components/policy/BUILD.gn
+++ b/components/policy/BUILD.gn
@@ -8,6 +8,10 @@ import("//components/policy/resources/policy_templates.gni")
import("//third_party/protobuf/proto_library.gni")
import("//tools/grit/grit_rule.gni")
+if (is_mac) {
+ import("//build/util/branding.gni")
+}
+
# About the policy component:
#
# There should really be two components. One called "policy" that includes all
@@ -142,13 +146,7 @@ if (enable_configuration_policy) {
if (is_mac) {
outputs += policy_templates_mac_outputs
- # TODO(knn) : Move this out once more targets use this.
- if (is_chrome_branded) {
- mac_bundle_id = "com.google.Chrome"
- } else {
- mac_bundle_id = "org.chromium.Chromium"
- }
- defines = [ "mac_bundle_id=$mac_bundle_id" ]
+ defines = [ "mac_bundle_id=$chrome_mac_bundle_id" ]
}
if (is_win) {
outputs += policy_templates_windows_outputs
@@ -334,6 +332,65 @@ if (enable_configuration_policy) {
":$zip_target_name",
]
}
+ } else if (is_mac) {
+ action("convert_mcx_plist") {
+ script = "//build/config/mac/xcrun.py"
+ sources = [
+ "$policy_templates_base_dir/mac/app-Manifest.plist",
+ ]
+ inputs = [
+ script,
+ ]
+ outputs = [
+ "$target_gen_dir/$chrome_mac_bundle_id.plist",
+ ]
+
+ args = [
+ "xcrun",
+ "plutil",
+ "-convert",
+ "xml1",
+ ] + rebase_path(sources, root_out_dir) + [ "-o" ] +
+ rebase_path(outputs, root_out_dir)
+
+ deps = [
+ ":policy_templates",
+ ]
+ }
+
+ bundle_data("manifest_bundle_data") {
+ sources = get_target_outputs(":convert_mcx_plist")
+ outputs = [
+ "{{bundle_resources_dir}}/{{source_file_part}}",
+ ]
+ public_deps = [
+ ":convert_mcx_plist",
+ ]
+ }
+
+ # The reason we are not enumerating all the locales is that
+ # the translations would eat up 3.5MB disk space in the
+ # application bundle.
+ bundle_data("manifest_strings_bundle_data") {
+ sources = [
+ "$policy_templates_base_dir/mac/strings/en.lproj/Localizable.strings",
+ ]
+ outputs = [
+ "{{bundle_resources_dir}}/en.lproj/{{source_file_part}}",
+ ]
+ public_deps = [
+ ":policy_templates",
+ ]
+ }
+
+ create_bundle("chrome_manifest_bundle") {
+ bundle_root_dir = "$root_out_dir/$chrome_mac_bundle_id.manifest/Contents"
+ bundle_resources_dir = "$bundle_root_dir/Resources"
+
+ deps = [
+ ":manifest_bundle_data",
+ ":manifest_strings_bundle_data",
+ ]
+ }
}
}
-#TODO(GYP) chrome_manifest_bundle
« 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