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

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

Issue 708883003: Add support for shared library resources to java_apk build rules. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 (c) 2012 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2012 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 """Process Android resources to generate R.java, and prepare for packaging. 7 """Process Android resources to generate R.java, and prepare for packaging.
8 8
9 This will crunch images and generate v14 compatible resources 9 This will crunch images and generate v14 compatible resources
10 (see generate_v14_compatible_resources.py). 10 (see generate_v14_compatible_resources.py).
(...skipping 20 matching lines...) Expand all
31 parser = optparse.OptionParser() 31 parser = optparse.OptionParser()
32 build_utils.AddDepfileOption(parser) 32 build_utils.AddDepfileOption(parser)
33 33
34 parser.add_option('--android-sdk', help='path to the Android SDK folder') 34 parser.add_option('--android-sdk', help='path to the Android SDK folder')
35 parser.add_option('--android-sdk-tools', 35 parser.add_option('--android-sdk-tools',
36 help='path to the Android SDK build tools folder') 36 help='path to the Android SDK build tools folder')
37 parser.add_option('--non-constant-id', action='store_true') 37 parser.add_option('--non-constant-id', action='store_true')
38 38
39 parser.add_option('--android-manifest', help='AndroidManifest.xml path') 39 parser.add_option('--android-manifest', help='AndroidManifest.xml path')
40 parser.add_option('--custom-package', help='Java package for R.java') 40 parser.add_option('--custom-package', help='Java package for R.java')
41 parser.add_option(
42 '--shared_resources',
43 action='store_true',
44 help='Generate shared library resources compatible R.java files.')
cjhopman 2014/11/06 21:45:56 I would try to word the places where you say "shar
mkosiba (inactive) 2014/11/06 22:11:37 I can take the docs from aapt: Make a resource pa
41 45
42 parser.add_option('--resource-dirs', 46 parser.add_option('--resource-dirs',
43 help='Directories containing resources of this target.') 47 help='Directories containing resources of this target.')
44 parser.add_option('--dependencies-res-zips', 48 parser.add_option('--dependencies-res-zips',
45 help='Resources from dependents.') 49 help='Resources from dependents.')
46 50
47 parser.add_option('--resource-zip-out', 51 parser.add_option('--resource-zip-out',
48 help='Path for output zipped resources.') 52 help='Path for output zipped resources.')
49 53
50 parser.add_option('--R-dir', 54 parser.add_option('--R-dir',
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 233
230 for d in dep_subdirs: 234 for d in dep_subdirs:
231 package_command += ['-S', d] 235 package_command += ['-S', d]
232 236
233 if options.non_constant_id: 237 if options.non_constant_id:
234 package_command.append('--non-constant-id') 238 package_command.append('--non-constant-id')
235 if options.custom_package: 239 if options.custom_package:
236 package_command += ['--custom-package', options.custom_package] 240 package_command += ['--custom-package', options.custom_package]
237 if options.proguard_file: 241 if options.proguard_file:
238 package_command += ['-G', options.proguard_file] 242 package_command += ['-G', options.proguard_file]
243 if options.shared_resources:
244 package_command.append('--shared-lib')
cjhopman 2014/11/06 21:45:56 s/shared-lib/shared-resources
mkosiba (inactive) 2014/11/06 22:11:37 sorry, that's the name of the argument that aapt t
239 build_utils.CheckOutput(package_command, print_stderr=False) 245 build_utils.CheckOutput(package_command, print_stderr=False)
240 246
241 if options.extra_res_packages: 247 if options.extra_res_packages:
242 CreateExtraRJavaFiles( 248 CreateExtraRJavaFiles(
243 gen_dir, 249 gen_dir,
244 build_utils.ParseGypList(options.extra_res_packages)) 250 build_utils.ParseGypList(options.extra_res_packages))
245 251
246 # This is the list of directories with resources to put in the final .zip 252 # This is the list of directories with resources to put in the final .zip
247 # file. The order of these is important so that crunched/v14 resources 253 # file. The order of these is important so that crunched/v14 resources
248 # override the normal ones. 254 # override the normal ones.
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 if options.depfile: 286 if options.depfile:
281 input_files += build_utils.GetPythonDependencies() 287 input_files += build_utils.GetPythonDependencies()
282 build_utils.WriteDepfile(options.depfile, input_files) 288 build_utils.WriteDepfile(options.depfile, input_files)
283 289
284 if options.stamp: 290 if options.stamp:
285 build_utils.Touch(options.stamp) 291 build_utils.Touch(options.stamp)
286 292
287 293
288 if __name__ == '__main__': 294 if __name__ == '__main__':
289 main() 295 main()
OLDNEW
« no previous file with comments | « no previous file | build/config/android/internal_rules.gni » ('j') | build/config/android/internal_rules.gni » ('J')

Powered by Google App Engine
This is Rietveld 408576698