• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 meant to be included into an action to provide an action that
6# signs and zipaligns split APKs.
7#
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
13
14{
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%': [],
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    ['language_splits != []', {
63      'message': 'Signing/aligning <(_target_name) language splits',
64      'inputs': [
65        "<!@(python <(DEPTH)/build/apply_locales.py '<(resource_packaged_apk_path)_ZZLOCALE' <(language_splits))",
66      ],
67      'outputs': [
68        "<!@(python <(DEPTH)/build/apply_locales.py '<(base_output_path)-lang-ZZLOCALE.apk' <(language_splits))",
69      ],
70      'action': [
71        '--languages=<(language_splits)',
72      ],
73    }],
74  ],
75}
76
77