Add support for shared library resources to java_apk build rules.
BUG=430997 Review URL: https://codereview.chromium.org/708883003 Cr-Original-Commit-Position: refs/heads/master@{#303351} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: f90b7151cb809d8ec9ab31f7be9e9f8f575fd4d0
This commit is contained in:
Родитель
c977a39efb
Коммит
477078ea61
|
@ -38,6 +38,11 @@ def ParseArgs(args):
|
|||
|
||||
parser.add_option('--android-manifest', help='AndroidManifest.xml path')
|
||||
parser.add_option('--custom-package', help='Java package for R.java')
|
||||
parser.add_option(
|
||||
'--shared-resources',
|
||||
action='store_true',
|
||||
help='Make a resource package that can be loaded by a different'
|
||||
'application at runtime to access the package\'s resources.')
|
||||
|
||||
parser.add_option('--resource-dirs',
|
||||
help='Directories containing resources of this target.')
|
||||
|
@ -236,6 +241,8 @@ def main():
|
|||
package_command += ['--custom-package', options.custom_package]
|
||||
if options.proguard_file:
|
||||
package_command += ['-G', options.proguard_file]
|
||||
if options.shared_resources:
|
||||
package_command.append('--shared-lib')
|
||||
build_utils.CheckOutput(package_command, print_stderr=False)
|
||||
|
||||
if options.extra_res_packages:
|
||||
|
|
|
@ -718,6 +718,11 @@ template("process_resources") {
|
|||
args += ["--v14-verify-only"]
|
||||
}
|
||||
|
||||
if (defined(invoker.shared_resources) &&
|
||||
invoker.shared_resources) {
|
||||
args += ["--shared-resources"]
|
||||
}
|
||||
|
||||
if (defined(invoker.all_resources_zip_path)) {
|
||||
all_resources_zip = invoker.all_resources_zip_path
|
||||
outputs += [ all_resources_zip ]
|
||||
|
|
|
@ -477,6 +477,8 @@ template("jinja_template_resources") {
|
|||
# that the resources are v14-compliant (see
|
||||
# build/android/gyp/generate_v14_compatible_resources.py). Defaults to
|
||||
# false.
|
||||
# shared_resources: If true make a resource package that can be loaded by a
|
||||
# different application at runtime to access the package's resources.
|
||||
#
|
||||
# Example
|
||||
# android_resources("foo_resources") {
|
||||
|
@ -518,6 +520,10 @@ template("android_resources") {
|
|||
if (defined(invoker.v14_verify_only)) {
|
||||
v14_verify_only = invoker.v14_verify_only
|
||||
}
|
||||
|
||||
if (defined(invoker.shared_resources)) {
|
||||
shared_resources = invoker.shared_resources
|
||||
}
|
||||
}
|
||||
|
||||
group(target_name) {
|
||||
|
|
|
@ -44,6 +44,8 @@
|
|||
# shared library to be included in this apk. A stripped copy of the
|
||||
# library will be included in the apk.
|
||||
# resource_dir - The directory for resources.
|
||||
# shared_resources - Make a resource package that can be loaded by a different
|
||||
# application at runtime to access the package's resources.
|
||||
# R_package - A custom Java package to generate the resource file R.java in.
|
||||
# By default, the package given in AndroidManifest.xml will be used.
|
||||
# use_chromium_linker - Enable the content dynamic linker that allows sharing the
|
||||
|
@ -126,6 +128,7 @@
|
|||
'resource_zip_path': '<(intermediate_dir)/<(_target_name).resources.zip',
|
||||
'resource_packaged_apk_name': '<(apk_name)-resources.ap_',
|
||||
'resource_packaged_apk_path': '<(intermediate_dir)/<(resource_packaged_apk_name)',
|
||||
'shared_resources%': 0,
|
||||
'unsigned_apk_path': '<(intermediate_dir)/<(apk_name)-unsigned.apk',
|
||||
'final_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name).apk',
|
||||
'incomplete_apk_path': '<(intermediate_dir)/<(apk_name)-incomplete.apk',
|
||||
|
@ -575,7 +578,10 @@
|
|||
'additional_res_packages=': [],
|
||||
}],
|
||||
['res_v14_verify_only == 1', {
|
||||
'process_resources_options': ['--v14-verify-only']
|
||||
'process_resources_options+': ['--v14-verify-only']
|
||||
}],
|
||||
['shared_resources == 1', {
|
||||
'process_resources_options+': ['--shared-resources']
|
||||
}],
|
||||
],
|
||||
},
|
||||
|
|
Загрузка…
Ссылка в новой задаче