Index: build/android/gyp/dex.py |
diff --git a/build/android/gyp/dex.py b/build/android/gyp/dex.py |
index 86f3878f7f0d4b456906d32745916b807918f415..0cd1261c15590aa4d95382423d9535218c049bbb 100755 |
--- a/build/android/gyp/dex.py |
+++ b/build/android/gyp/dex.py |
@@ -4,7 +4,6 @@ |
# Use of this source code is governed by a BSD-style license that can be |
# found in the LICENSE file. |
-import fnmatch |
import optparse |
import os |
import sys |
@@ -15,7 +14,10 @@ from util import md5_check |
def DoDex(options, paths): |
dx_binary = os.path.join(options.android_sdk_root, 'platform-tools', 'dx') |
- dex_cmd = [dx_binary, '--dex', '--output', options.dex_path] + paths |
+ dex_cmd = [dx_binary, '--dex', '--output', options.dex_path] |
+ if options.no_locals: |
+ dex_cmd.append('--no-locals') |
+ dex_cmd += paths |
record_path = '%s.md5.stamp' % options.dex_path |
md5_check.CallAndRecordIfStale( |
@@ -32,11 +34,14 @@ def main(argv): |
parser.add_option('--android-sdk-root', help='Android sdk root directory.') |
parser.add_option('--dex-path', help='Dex output path.') |
parser.add_option('--configuration-name', |
- help='The build CONFIGURATION_NAME.') |
+ help='The build CONFIGURATION_NAME.') |
parser.add_option('--proguard-enabled', |
- help='"true" if proguard is enabled.') |
+ help='"true" if proguard is enabled.') |
parser.add_option('--proguard-enabled-input-path', |
- help='Path to dex in Release mode when proguard is enabled.') |
+ help=('Path to dex in Release mode when proguard ' |
+ 'is enabled.')) |
+ parser.add_option('--no-locals', |
+ help='Exclude locals list from the dex file.') |
parser.add_option('--stamp', help='Path to touch on success.') |
# TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja. |
@@ -44,8 +49,8 @@ def main(argv): |
options, paths = parser.parse_args() |
- if (options.proguard_enabled == "true" |
- and options.configuration_name == "Release"): |
+ if (options.proguard_enabled == 'true' |
+ and options.configuration_name == 'Release'): |
paths = [options.proguard_enabled_input_path] |
DoDex(options, paths) |
@@ -56,4 +61,3 @@ def main(argv): |
if __name__ == '__main__': |
sys.exit(main(sys.argv)) |
- |