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

Unified Diff: gclient.py

Issue 11363036: Allow specificying that only target_os should be used in a gclient file (Closed) Base URL: https://git.chromium.org/chromium/tools/depot_tools.git@master
Patch Set: Make invalid combinations fatal Created 8 years, 1 month 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
« no previous file with comments | « no previous file | tests/gclient_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gclient.py
diff --git a/gclient.py b/gclient.py
index a91c61b32bf45253a9bedf9a8f39b909ec317bdb..40a5e0d76b69b1848e0fc15ee83db90e40c9260d 100644
--- a/gclient.py
+++ b/gclient.py
@@ -55,6 +55,13 @@ Specifying a target OS
Example:
target_os = [ "android" ]
+
+ If the "target_os_only" key is also present and true, then *only* the
+ operating systems listed in "target_os" will be used.
+
+ Example:
+ target_os = [ "ios" ]
+ target_os_only = True
"""
__version__ = "0.6.4"
@@ -886,7 +893,14 @@ solutions = [
# Append any target OS that is not already being enforced to the tuple.
target_os = config_dict.get('target_os', [])
- self._enforced_os = tuple(set(self._enforced_os).union(target_os))
+ if config_dict.get('target_os_only', False):
+ self._enforced_os = tuple(set(target_os))
+ else:
+ self._enforced_os = tuple(set(self._enforced_os).union(target_os))
+
+ if not target_os and config_dict.get('target_os_only', False):
+ raise gclient_utils.Error('Can\'t use target_os_only if target_os is '
+ 'not specified')
deps_to_add = []
for s in config_dict.get('solutions', []):
« no previous file with comments | « no previous file | tests/gclient_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698