Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(329)

Side by Side Diff: build/android/gyp/util/build_utils.py

Issue 321883002: Make test apks only dex files not in tested apk (proguard version) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « build/android/gyp/apk_obfuscate.py ('k') | build/java_aidl.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import contextlib 5 import contextlib
6 import fnmatch 6 import fnmatch
7 import json 7 import json
8 import os 8 import os
9 import pipes 9 import pipes
10 import shlex 10 import shlex
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 for option_name in required: 78 for option_name in required:
79 if getattr(options, option_name) is None: 79 if getattr(options, option_name) is None:
80 parser.error('--%s is required' % option_name.replace('_', '-')) 80 parser.error('--%s is required' % option_name.replace('_', '-'))
81 81
82 def WriteJson(obj, path, only_if_changed=False): 82 def WriteJson(obj, path, only_if_changed=False):
83 old_dump = None 83 old_dump = None
84 if os.path.exists(path): 84 if os.path.exists(path):
85 with open(path, 'r') as oldfile: 85 with open(path, 'r') as oldfile:
86 old_dump = oldfile.read() 86 old_dump = oldfile.read()
87 87
88 new_dump = json.dumps(obj) 88 new_dump = json.dumps(obj, sort_keys=True, indent=2, separators=(',', ': '))
89 89
90 if not only_if_changed or old_dump != new_dump: 90 if not only_if_changed or old_dump != new_dump:
91 with open(path, 'w') as outfile: 91 with open(path, 'w') as outfile:
92 outfile.write(new_dump) 92 outfile.write(new_dump)
93 93
94 def ReadJson(path): 94 def ReadJson(path):
95 with open(path, 'r') as jsonfile: 95 with open(path, 'r') as jsonfile:
96 return json.load(jsonfile) 96 return json.load(jsonfile)
97 97
98 98
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 202
203 203
204 def PrintWarning(message): 204 def PrintWarning(message):
205 print 'WARNING: ' + message 205 print 'WARNING: ' + message
206 206
207 207
208 def PrintBigWarning(message): 208 def PrintBigWarning(message):
209 print '***** ' * 8 209 print '***** ' * 8
210 PrintWarning(message) 210 PrintWarning(message)
211 print '***** ' * 8 211 print '***** ' * 8
OLDNEW
« no previous file with comments | « build/android/gyp/apk_obfuscate.py ('k') | build/java_aidl.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698