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

Unified Diff: build/android/gyp/main_dex_list.py

Issue 2845773004: DO NOT SUBMIT: add main dex list check to classloader. (Closed)
Patch Set: Created 3 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 | « base/android/java/templates/BuildConfig.template ('k') | build/android/incremental_install/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/gyp/main_dex_list.py
diff --git a/build/android/gyp/main_dex_list.py b/build/android/gyp/main_dex_list.py
index e18422e958aeff7b2d1ac2b3f04e9ea9e89ed46b..9a9448c3fc1fca893e70b9db1911dcbac69b8f89 100755
--- a/build/android/gyp/main_dex_list.py
+++ b/build/android/gyp/main_dex_list.py
@@ -29,6 +29,8 @@ def main(args):
'main dex.')
parser.add_argument('--main-dex-list-path', required=True,
help='The main dex list file to generate.')
+ parser.add_argument('--main-dex-list-path-java', required=True,
+ help='The main dex list file to generate.')
parser.add_argument('--enabled-configurations',
help='The build configurations for which a main dex list'
' should be generated.')
@@ -100,7 +102,7 @@ def main(args):
build_utils.CallAndWriteDepfileIfStale(
lambda: _OnStaleMd5(proguard_cmd, main_dex_list_cmd, args.paths,
- args.main_dex_list_path),
+ args.main_dex_list_path, args.main_dex_list_path_java),
args,
input_paths=input_paths,
input_strings=input_strings,
@@ -109,7 +111,7 @@ def main(args):
return 0
-def _OnStaleMd5(proguard_cmd, main_dex_list_cmd, paths, main_dex_list_path):
+def _OnStaleMd5(proguard_cmd, main_dex_list_cmd, paths, main_dex_list_path, main_dex_list_path_java):
paths_arg = ':'.join(paths)
main_dex_list = ''
try:
@@ -132,9 +134,20 @@ def _OnStaleMd5(proguard_cmd, main_dex_list_cmd, paths, main_dex_list_path):
else:
raise
+ tmp = []
+ for line in main_dex_list.split('\n'):
+ if 'FileDescriptorInfo' not in line:
+ tmp.append(line)
+ main_dex_list = '\n'.join(l for l in tmp)
+
with open(main_dex_list_path, 'w') as main_dex_list_file:
main_dex_list_file.write(main_dex_list)
+ if main_dex_list_path_java:
+ with open(main_dex_list_path_java, 'w') as main_dex_list_file:
+ main_dex_list_file.write(
+ ','.join([c.replace('/', '.').split('.class')[0]
+ for c in main_dex_list.split('\n')]))
if __name__ == '__main__':
sys.exit(main(sys.argv[1:]))
« no previous file with comments | « base/android/java/templates/BuildConfig.template ('k') | build/android/incremental_install/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698