-
Notifications
You must be signed in to change notification settings - Fork 896
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
List group policies in GN explicitly (#27246)
List group policies in GN explicitly.
- Loading branch information
Showing
4 changed files
with
71 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
components/policy/resources/templates/policy_definitions/brave_policies.gni
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Copyright (c) 2024 The Brave Authors. All rights reserved. | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
# You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
||
_brave_policies = [ | ||
"BraveSoftware/.group.details.yaml", | ||
"BraveSoftware/BraveAIChatEnabled.yaml", | ||
"BraveSoftware/BraveRewardsDisabled.yaml", | ||
"BraveSoftware/BraveShieldsDisabledForUrls.yaml", | ||
"BraveSoftware/BraveShieldsEnabledForUrls.yaml", | ||
"BraveSoftware/BraveSyncUrl.yaml", | ||
"BraveSoftware/BraveVPNDisabled.yaml", | ||
"BraveSoftware/BraveWalletDisabled.yaml", | ||
"BraveSoftware/IPFSEnabled.yaml", | ||
"BraveSoftware/TorDisabled.yaml", | ||
] | ||
|
||
_brave_policies_sync_config_path = | ||
"$root_build_dir/gen/brave_policies_sync_config.json" | ||
|
||
# List Brave's policy files as inputs for policy_templates.py to trigger a | ||
# rebuild if changes are detected. | ||
brave_generate_policy_templates_inputs = | ||
get_path_info(_brave_policies, "abspath") + | ||
[ _brave_policies_sync_config_path ] | ||
|
||
# Generate a policy list to copy into Chromium policy_definitions directory. | ||
# This is to be used by policy_templates.py override. Make sure to only generate | ||
# the file for the default toolchain as this gni can be used by multiple | ||
# toolchains. | ||
if (current_toolchain == default_toolchain) { | ||
write_file( | ||
_brave_policies_sync_config_path, | ||
{ | ||
policies = _brave_policies | ||
copy_from = rebase_path( | ||
"//brave/components/policy/resources/templates/policy_definitions", | ||
root_build_dir) | ||
copy_to = rebase_path( | ||
"//components/policy/resources/templates/policy_definitions", | ||
root_build_dir) | ||
}, | ||
"json") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff --git a/components/policy/BUILD.gn b/components/policy/BUILD.gn | ||
index ac21cc7238a1a4a9e819dc4dbefc13639597accf..5fd00e0e6b91584d0a7635d53794acd40d79b30a 100644 | ||
--- a/components/policy/BUILD.gn | ||
+++ b/components/policy/BUILD.gn | ||
@@ -103,6 +103,7 @@ action("generate_policy_templates") { | ||
"--depfile", | ||
rebase_path(policy_templates_deps_file, root_build_dir), | ||
] | ||
+ import("//brave/components/policy/resources/templates/policy_definitions/brave_policies.gni") inputs = brave_generate_policy_templates_inputs | ||
} | ||
|
||
# Translates policy_templates.json into various languages. |