OLD | NEW |
(Empty) | |
| 1 #!/usr/bin/env python |
| 2 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. |
| 5 |
| 6 |
| 7 import argparse |
| 8 import json |
| 9 import sys |
| 10 |
| 11 from util import build_utils |
| 12 |
| 13 |
| 14 def ParseArgs(): |
| 15 parser = argparse.ArgumentParser() |
| 16 parser.add_argument('--configuration-name', required=True, |
| 17 help='The build CONFIGURATION_NAME.') |
| 18 parser.add_argument('--enabled-configurations', default=[], |
| 19 help='The configuration(s) for which multidex should be ' |
| 20 'enabled. If not specified and --enable-multidex is ' |
| 21 'passed, multidex will be enabled for all ' |
| 22 'configurations.') |
| 23 parser.add_argument('--multidex-configuration-path', required=True, |
| 24 help='The path to which the multidex configuration JSON ' |
| 25 'should be saved.') |
| 26 |
| 27 args = parser.parse_args() |
| 28 |
| 29 if args.enabled_configurations: |
| 30 args.enabled_configurations = build_utils.ParseGypList( |
| 31 args.enabled_configurations) |
| 32 |
| 33 return args |
| 34 |
| 35 |
| 36 def main(): |
| 37 args = ParseArgs() |
| 38 |
| 39 multidex_enabled = ( |
| 40 (not args.enabled_configurations |
| 41 or args.configuration_name in args.enabled_configurations)) |
| 42 |
| 43 config = { |
| 44 'enabled': multidex_enabled, |
| 45 } |
| 46 |
| 47 with open(args.multidex_configuration_path, 'w') as f: |
| 48 f.write(json.dumps(config)) |
| 49 |
| 50 return 0 |
| 51 |
| 52 |
| 53 if __name__ == '__main__': |
| 54 sys.exit(main()) |
| 55 |
OLD | NEW |