From b4a8efbe1d9cbc5dd66e4844ffd36a216cf959bd Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Wed, 13 Jul 2022 20:43:41 +0000 Subject: [PATCH] Teach "fetch pdfium" about the checkout_configuration property. Allow someone interested in checking out a subset of the PDFium source to do so via: fetch pdfium --checkout_configuration=small Along the way, also add support for the target_os and target_os_only properties, which are carried over from the Chromium fetch config. Change-Id: I11153fe7cb828c748055328ab2b60224b665ae84 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3758798 Commit-Queue: Lei Zhang Reviewed-by: Aravind Vasudevan --- fetch_configs/pdfium.py | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/fetch_configs/pdfium.py b/fetch_configs/pdfium.py index 2be624a1e..0b4bb2868 100644 --- a/fetch_configs/pdfium.py +++ b/fetch_configs/pdfium.py @@ -14,17 +14,27 @@ class PdfiumConfig(config_util.Config): @staticmethod def fetch_spec(props): + url = 'https://pdfium.googlesource.com/pdfium.git', + solution = { + 'name': 'src', + 'url': url, + 'managed': False, + 'custom_vars': {}, + } + if props.get('checkout_configuration'): + solution['custom_vars']['checkout_configuration'] = props[ + 'checkout_configuration'] + spec = { + 'solutions': [solution], + } + if props.get('target_os'): + spec['target_os'] = props['target_os'].split(',') + if props.get('target_os_only'): + spec['target_os_only'] = props['target_os_only'] + return { - 'type': 'gclient_git', - 'gclient_git_spec': { - 'solutions': [ - { - 'name': 'pdfium', - 'url': 'https://pdfium.googlesource.com/pdfium.git', - 'managed': False, - }, - ], - }, + 'type': 'gclient_git', + 'gclient_git_spec': spec, } @staticmethod