summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authormkosiba <mkosiba@chromium.org>2014-11-13 14:37:56 -0800
committerCommit bot <commit-bot@chromium.org>2014-11-13 22:38:15 +0000
commite5c9c76ba67333b430debcaaa5d4880e801114d5 (patch)
treec7dcc8f7e2cf72682f2e1c541cf0af5deee47aff /build
parentec1e64be203b2390029990eeca3596e0c10aed27 (diff)
downloadchromium_src-e5c9c76ba67333b430debcaaa5d4880e801114d5.zip
chromium_src-e5c9c76ba67333b430debcaaa5d4880e801114d5.tar.gz
chromium_src-e5c9c76ba67333b430debcaaa5d4880e801114d5.tar.bz2
Add support for shared library resources to java_apk build rules for real.
In https://crrev.com/f90b7151cb809d8ec9ab31f7be9e9f8f575fd4d0 I added support for the process_resources rule but support in package_resources is needed to generate a compatible .apk file. BUG=430997 Review URL: https://codereview.chromium.org/724933002 Cr-Commit-Position: refs/heads/master@{#304097}
Diffstat (limited to 'build')
-rwxr-xr-xbuild/android/gyp/package_resources.py7
-rw-r--r--build/config/android/internal_rules.gni5
-rw-r--r--build/java_apk.gypi8
3 files changed, 20 insertions, 0 deletions
diff --git a/build/android/gyp/package_resources.py b/build/android/gyp/package_resources.py
index 6444ed9..9b6ec68 100755
--- a/build/android/gyp/package_resources.py
+++ b/build/android/gyp/package_resources.py
@@ -37,6 +37,11 @@ def ParseArgs():
parser.add_option('--android-manifest', help='AndroidManifest.xml path')
parser.add_option('--version-code', help='Version code for apk.')
parser.add_option('--version-name', help='Version name for apk.')
+ 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-zips',
help='zip files containing resources to be packaged')
parser.add_option('--asset-dir',
@@ -132,6 +137,8 @@ def main():
if options.no_compress:
for ext in options.no_compress.split(','):
package_command += ['-0', ext]
+ if options.shared_resources:
+ package_command.append('--shared-lib')
if os.path.exists(options.asset_dir):
package_command += ['-A', options.asset_dir]
diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni
index 13027f4..d6711b8 100644
--- a/build/config/android/internal_rules.gni
+++ b/build/config/android/internal_rules.gni
@@ -260,6 +260,7 @@ template("create_apk") {
_resource_packaged_apk_path = _base_apk_path + ".ap_"
_packaged_apk_path = _base_apk_path + ".unfinished.apk"
+ _shared_resources = defined(invoker.shared_resources) && invoker.shared_resources
_configuration_name = "Release"
@@ -295,6 +296,10 @@ template("create_apk") {
"--apk-path", rebase_path(_resource_packaged_apk_path, root_build_dir),
]
+
+ if (_shared_resources) {
+ args += ["--shared-resources"]
+ }
}
action("${target_name}__package") {
diff --git a/build/java_apk.gypi b/build/java_apk.gypi
index 5184218..4243554 100644
--- a/build/java_apk.gypi
+++ b/build/java_apk.gypi
@@ -831,10 +831,16 @@
'action_name': 'package_resources',
'message': 'packaging resources for <(_target_name)',
'variables': {
+ 'package_resources_options': [],
'package_resource_zip_input_paths': [
'<(resource_zip_path)',
'>@(dependencies_res_zip_paths)',
],
+ 'conditions': [
+ ['shared_resources == 1', {
+ 'package_resources_options+': ['--shared-resources']
+ }],
+ ],
},
'conditions': [
['is_test_apk == 1', {
@@ -874,6 +880,8 @@
'--no-compress', '<(extensions_to_not_compress)',
'--apk-path', '<(resource_packaged_apk_path)',
+
+ '<@(package_resources_options)',
],
},
{