OLD | NEW |
| (Empty) |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | |
2 # Use of this source code is governed by a BSD-style license that can be | |
3 # found in the LICENSE file. | |
4 | |
5 # This file is a helper to java_apk.gypi. It should be used to create an | |
6 # action that runs ApkBuilder via ANT. | |
7 # | |
8 # Required variables: | |
9 # apk_name - File name (minus path & extension) of the output apk. | |
10 # android_manifest_path - Path to AndroidManifest.xml. | |
11 # app_manifest_version_name - set the apps 'human readable' version number. | |
12 # app_manifest_version_code - set the apps version number. | |
13 # Optional variables: | |
14 # asset_location - The directory where assets are located (if any). | |
15 # create_density_splits - Whether to create density-based apk splits. Splits | |
16 # are supported only for minSdkVersion >= 21. | |
17 # language_splits - List of languages to create apk splits for. | |
18 # resource_zips - List of paths to resource zip files. | |
19 # shared_resources - Make a resource package that can be loaded by a different | |
20 # application at runtime to access the package's resources. | |
21 # extensions_to_not_compress - E.g.: 'pak,dat,bin' | |
22 # extra_inputs - List of extra action inputs. | |
23 { | |
24 'variables': { | |
25 'asset_location%': '', | |
26 'create_density_splits%': 0, | |
27 'resource_zips%': [], | |
28 'shared_resources%': 0, | |
29 'extensions_to_not_compress%': '', | |
30 'extra_inputs%': [], | |
31 'resource_packaged_apk_name': '<(apk_name)-resources.ap_', | |
32 'resource_packaged_apk_path': '<(intermediate_dir)/<(resource_packaged_apk_n
ame)', | |
33 }, | |
34 'action_name': 'package_resources_<(apk_name)', | |
35 'message': 'packaging resources for <(apk_name)', | |
36 'inputs': [ | |
37 # TODO: This isn't always rerun correctly, http://crbug.com/351928 | |
38 '<(DEPTH)/build/android/gyp/util/build_utils.py', | |
39 '<(DEPTH)/build/android/gyp/package_resources.py', | |
40 '<(android_manifest_path)', | |
41 '<@(extra_inputs)', | |
42 ], | |
43 'outputs': [ | |
44 '<(resource_packaged_apk_path)', | |
45 ], | |
46 'action': [ | |
47 'python', '<(DEPTH)/build/android/gyp/package_resources.py', | |
48 '--android-sdk', '<(android_sdk)', | |
49 '--aapt-path', '<(android_aapt_path)', | |
50 '--configuration-name', '<(CONFIGURATION_NAME)', | |
51 '--android-manifest', '<(android_manifest_path)', | |
52 '--version-code', '<(app_manifest_version_code)', | |
53 '--version-name', '<(app_manifest_version_name)', | |
54 '--no-compress', '<(extensions_to_not_compress)', | |
55 '--apk-path', '<(resource_packaged_apk_path)', | |
56 ], | |
57 'conditions': [ | |
58 ['shared_resources == 1', { | |
59 'action': [ | |
60 '--shared-resources', | |
61 ], | |
62 }], | |
63 ['asset_location != ""', { | |
64 'action': [ | |
65 '--asset-dir', '<(asset_location)', | |
66 ], | |
67 }], | |
68 ['create_density_splits == 1', { | |
69 'action': [ | |
70 '--create-density-splits', | |
71 ], | |
72 'outputs': [ | |
73 '<(resource_packaged_apk_path)_hdpi', | |
74 '<(resource_packaged_apk_path)_xhdpi', | |
75 '<(resource_packaged_apk_path)_xxhdpi', | |
76 '<(resource_packaged_apk_path)_xxxhdpi', | |
77 '<(resource_packaged_apk_path)_tvdpi', | |
78 ], | |
79 }], | |
80 ['language_splits != []', { | |
81 'action': [ | |
82 '--language-splits=<(language_splits)', | |
83 ], | |
84 'outputs': [ | |
85 "<!@(python <(DEPTH)/build/apply_locales.py '<(resource_packaged_apk_pat
h)_ZZLOCALE' <(language_splits))", | |
86 ], | |
87 }], | |
88 ['resource_zips != []', { | |
89 'action': [ | |
90 '--resource-zips', '>(resource_zips)', | |
91 ], | |
92 'inputs': [ | |
93 '>@(resource_zips)', | |
94 ], | |
95 }], | |
96 ], | |
97 } | |
OLD | NEW |