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

Unified Diff: build/android/play_services/preprocess.py

Issue 1849403003: [gmscore] Allow specifying resource files to whitelist for preprocess (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add pathname pattern support 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
« no previous file with comments | « no previous file | build/android/play_services/utils.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/play_services/preprocess.py
diff --git a/build/android/play_services/preprocess.py b/build/android/play_services/preprocess.py
index 07057296e1eb36c23abedface2d3f5efe7311db8..99c000e223115b60451db16d033d8148d70b4e9e 100755
--- a/build/android/play_services/preprocess.py
+++ b/build/android/play_services/preprocess.py
@@ -125,7 +125,7 @@ def ProcessGooglePlayServices(repo, out_dir, config_path, is_extracted_repo):
_ImportFromAars(config, tmp_paths, repo)
_GenerateCombinedJar(tmp_paths)
- _ProcessResources(config, tmp_paths)
+ _ProcessResources(config, tmp_paths, repo)
_BuildOutput(config, tmp_paths, out_dir)
finally:
shutil.rmtree(tmp_root)
@@ -199,7 +199,7 @@ def _GenerateCombinedJar(tmp_paths):
cmd_helper.Call(['jar', '-cf', out_file_name, '-C', working_dir, '.'])
-def _ProcessResources(config, tmp_paths):
+def _ProcessResources(config, tmp_paths, repo):
LOCALIZED_VALUES_BASE_NAME = 'values-'
locale_whitelist = set(config.locale_whitelist)
@@ -216,6 +216,17 @@ def _ProcessResources(config, tmp_paths):
if dir_locale not in locale_whitelist:
shutil.rmtree(res_dir)
+ # Reimport files from the whitelist.
+ for res_path in config.resource_whitelist:
+ for whitelisted_file in glob.glob(os.path.join(repo, res_path)):
+ resolved_file = os.path.relpath(whitelisted_file, repo)
+ rebased_res = os.path.join(tmp_paths['imported_clients'], resolved_file)
+
+ if not os.path.exists(os.path.dirname(rebased_res)):
+ os.makedirs(os.path.dirname(rebased_res))
+
+ shutil.copy(os.path.join(repo, whitelisted_file), rebased_res)
+
def _BuildOutput(config, tmp_paths, out_dir):
generation_date = datetime.utcnow()
« no previous file with comments | « no previous file | build/android/play_services/utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698