Index: build/android/gyp/main_dex_list.py |
diff --git a/build/android/gyp/main_dex_list.py b/build/android/gyp/main_dex_list.py |
index 64420019eb905f6e5318837e32ad95ca908ddd83..be6e5c216e22311bf27d30ed9debcdd05b528914 100755 |
--- a/build/android/gyp/main_dex_list.py |
+++ b/build/android/gyp/main_dex_list.py |
@@ -5,6 +5,7 @@ |
# found in the LICENSE file. |
import argparse |
+import json |
import os |
import sys |
import tempfile |
@@ -27,12 +28,28 @@ def main(): |
'main dex.') |
parser.add_argument('--main-dex-list-path', required=True, |
help='The main dex list file to generate.') |
+ parser.add_argument('--enabled-configurations', |
+ help='The build configurations for which a main dex list' |
+ ' should be generated.') |
+ parser.add_argument('--configuration-name', |
+ help='The current build configuration.') |
+ parser.add_argument('--multidex-configuration-path', |
+ help='A JSON file containing multidex build ' |
+ 'configuration.') |
parser.add_argument('paths', nargs='+', |
help='JARs for which a main dex list should be ' |
'generated.') |
args = parser.parse_args() |
+ if args.multidex_configuration_path: |
+ with open(args.multidex_configuration_path) as multidex_config_file: |
+ multidex_config = json.loads(multidex_config_file.read()) |
+ |
+ if not multidex_config.get('enabled', False): |
+ return 0 |
+ args.paths.extend(multidex_config.get('libs', [])) |
+ |
with open(args.main_dex_list_path, 'w') as main_dex_list_file: |
shrinked_android_jar = os.path.abspath( |
@@ -58,7 +75,7 @@ def main(): |
main_dex_list = '' |
try: |
- build_utils.CheckOutput(proguard_cmd) |
+ build_utils.CheckOutput(proguard_cmd, print_stderr=False) |
java_cmd = [ |
'java', '-cp', dx_jar, |