Make moderate binding testable by command line switches
[chromium-blink-merge.git] / build / android / finalize_splits_action.gypi
blob4472d5a8a968b80f2c0f0f30391ce199144518e9
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.
5 # This file is meant to be included into an action to provide an action that
6 # signs and zipaligns split APKs.
8 # Required variables:
9 #  apk_name - Base name of the apk.
10 # Optional variables:
11 #  density_splits - Whether to process density splits
12 #  language_splits - Whether to language splits
15   'variables': {
16     'keystore_path%': '<(DEPTH)/build/android/ant/chromium-debug.keystore',
17     'keystore_name%': 'chromiumdebugkey',
18     'keystore_password%': 'chromium',
19     'zipalign_path%': '<(android_sdk_tools)/zipalign',
20     'density_splits%': 0,
21     'language_splits%': 0,
22     'resource_packaged_apk_name': '<(apk_name)-resources.ap_',
23     'resource_packaged_apk_path': '<(intermediate_dir)/<(resource_packaged_apk_name)',
24     'base_output_path': '<(PRODUCT_DIR)/apks/<(apk_name)',
25   },
26   'inputs': [
27     '<(DEPTH)/build/android/gyp/finalize_splits.py',
28     '<(DEPTH)/build/android/gyp/finalize_apk.py',
29     '<(DEPTH)/build/android/gyp/util/build_utils.py',
30     '<(keystore_path)',
31   ],
32   'action': [
33     'python', '<(DEPTH)/build/android/gyp/finalize_splits.py',
34     '--resource-packaged-apk-path=<(resource_packaged_apk_path)',
35     '--base-output-path=<(base_output_path)',
36     '--zipalign-path=<(zipalign_path)',
37     '--key-path=<(keystore_path)',
38     '--key-name=<(keystore_name)',
39     '--key-passwd=<(keystore_password)',
40   ],
41   'conditions': [
42     ['density_splits == 1', {
43       'message': 'Signing/aligning <(_target_name) density splits',
44       'inputs': [
45         '<(resource_packaged_apk_path)-hdpi',
46         '<(resource_packaged_apk_path)-xhdpi',
47         '<(resource_packaged_apk_path)-xxhdpi',
48         '<(resource_packaged_apk_path)-xxxhdpi',
49         '<(resource_packaged_apk_path)-tvdpi',
50       ],
51       'outputs': [
52         '<(base_output_path)-density-hdpi.apk',
53         '<(base_output_path)-density-xhdpi.apk',
54         '<(base_output_path)-density-xxhdpi.apk',
55         '<(base_output_path)-density-xxxhdpi.apk',
56         '<(base_output_path)-density-tvdpi.apk',
57       ],
58       'action': [
59         '--densities=hdpi,xhdpi,xxhdpi,xxxhdpi,tvdpi',
60       ],
61     }],
62     # TODO(agrieve): Implement language splits
63     ['language_splits == 1', {
64       'message': 'Signing/aligning <(_target_name) language splits',
65       'inputs': [
66       ],
67       'outputs': [
68       ],
69     }],
70   ],