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..2de04c656106e7d7e09419c90e0f067253fdc404 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,13 @@ 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: |
+ rebased_res_path = os.path.join(tmp_paths['imported_clients'], res_path) |
+ if not os.path.exists(os.path.dirname(rebased_res_path)): |
+ os.makedirs(os.path.dirname(rebased_res_path)) |
+ shutil.copy(os.path.join(repo, res_path), rebased_res_path) |
+ |
def _BuildOutput(config, tmp_paths, out_dir): |
generation_date = datetime.utcnow() |