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

Side by Side Diff: build/android/gyp/pack_relocations.py

Issue 1483683002: GN(android): Use list of libraries rather than native_lib_dir in all places (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review coments Created 5 years 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 unified diff | Download patch
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright 2014 The Chromium Authors. All rights reserved. 3 # Copyright 2014 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """Pack relocations in a library (or copy unchanged). 7 """Pack relocations in a library (or copy unchanged).
8 8
9 If --enable-packing and --configuration-name=='Release', invoke the 9 If --enable-packing and --configuration-name=='Release', invoke the
10 relocation_packer tool to pack the .rel.dyn or .rela.dyn section in the given 10 relocation_packer tool to pack the .rel.dyn or .rela.dyn section in the given
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 help='Names of any libraries explicitly not packed') 57 help='Names of any libraries explicitly not packed')
58 parser.add_option('--android-pack-relocations', 58 parser.add_option('--android-pack-relocations',
59 help='Path to the relocations packer binary') 59 help='Path to the relocations packer binary')
60 parser.add_option('--stripped-libraries-dir', 60 parser.add_option('--stripped-libraries-dir',
61 help='Directory for stripped libraries') 61 help='Directory for stripped libraries')
62 parser.add_option('--packed-libraries-dir', 62 parser.add_option('--packed-libraries-dir',
63 help='Directory for packed libraries') 63 help='Directory for packed libraries')
64 parser.add_option('--libraries', action='append', 64 parser.add_option('--libraries', action='append',
65 help='List of libraries') 65 help='List of libraries')
66 parser.add_option('--stamp', help='Path to touch on success') 66 parser.add_option('--stamp', help='Path to touch on success')
67 parser.add_option('--filelistjson',
68 help='Output path of filelist.json to write')
67 69
68 options, _ = parser.parse_args(args) 70 options, _ = parser.parse_args(args)
69 enable_packing = (options.enable_packing == '1' and 71 enable_packing = (options.enable_packing == '1' and
70 options.configuration_name == 'Release') 72 options.configuration_name == 'Release')
71 exclude_packing_set = set(build_utils.ParseGypList( 73 exclude_packing_set = set(build_utils.ParseGypList(
72 options.exclude_packing_list)) 74 options.exclude_packing_list))
73 75
74 libraries = [] 76 libraries = []
75 for libs_arg in options.libraries: 77 for libs_arg in options.libraries:
76 libraries += build_utils.ParseGypList(libs_arg) 78 libraries += build_utils.ParseGypList(libs_arg)
77 79
78 if options.clear_dir: 80 if options.clear_dir:
79 build_utils.DeleteDirectory(options.packed_libraries_dir) 81 build_utils.DeleteDirectory(options.packed_libraries_dir)
80 82
81 build_utils.MakeDirectory(options.packed_libraries_dir) 83 build_utils.MakeDirectory(options.packed_libraries_dir)
82 84
85 output_paths = []
83 for library in libraries: 86 for library in libraries:
84 library_path = os.path.join(options.stripped_libraries_dir, library) 87 library_path = os.path.join(options.stripped_libraries_dir, library)
85 output_path = os.path.join( 88 output_path = os.path.join(
86 options.packed_libraries_dir, os.path.basename(library)) 89 options.packed_libraries_dir, os.path.basename(library))
90 output_paths.append(output_path)
87 91
88 if enable_packing and library not in exclude_packing_set: 92 if enable_packing and library not in exclude_packing_set:
89 PackLibraryRelocations(options.android_pack_relocations, 93 PackLibraryRelocations(options.android_pack_relocations,
90 library_path, 94 library_path,
91 output_path) 95 output_path)
92 else: 96 else:
93 CopyLibraryUnchanged(library_path, output_path) 97 CopyLibraryUnchanged(library_path, output_path)
94 98
99 if options.filelistjson:
100 build_utils.WriteJson({ 'files': output_paths }, options.filelistjson)
101
95 if options.depfile: 102 if options.depfile:
96 build_utils.WriteDepfile( 103 build_utils.WriteDepfile(
97 options.depfile, 104 options.depfile,
98 libraries + build_utils.GetPythonDependencies()) 105 libraries + build_utils.GetPythonDependencies())
99 106
100 if options.stamp: 107 if options.stamp:
101 build_utils.Touch(options.stamp) 108 build_utils.Touch(options.stamp)
102 109
103 return 0 110 return 0
104 111
105 112
106 if __name__ == '__main__': 113 if __name__ == '__main__':
107 sys.exit(main(sys.argv[1:])) 114 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « build/android/gyp/apkbuilder.py ('k') | build/android/incremental_install/create_install_script.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698