Delay default apps installation on Chrome OS for first time sign-in
[chromium-blink-merge.git] / build / ios / PRESUBMIT.py
bloba0d32f8b9e1cb89d0616fc483ee1c47617043a6f
1 # Copyright (c) 2012 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.
5 import os
7 """Chromium presubmit script for src/tools/ios.
9 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
10 for more details on the presubmit API built into gcl.
11 """
13 WHITELIST_FILE = 'build/ios/grit_whitelist.txt'
15 def _CheckWhitelistSorted(input_api, output_api):
16 for path in input_api.LocalPaths():
17 if WHITELIST_FILE == path:
18 lines = open(os.path.join('../..', WHITELIST_FILE)).readlines()
19 i = 0
20 while i < len(lines) - 1 and lines[i] <= lines[i + 1]:
21 i += 1
22 if i < len(lines) - 1:
23 return [output_api.PresubmitError(
24 'The file ' + WHITELIST_FILE + ' must be sorted. ' +
25 'First offending line: #' + str(i + 2))]
26 return []
28 def _CommonChecks(input_api, output_api):
29 """Checks common to both upload and commit."""
30 results = []
31 results.extend(_CheckWhitelistSorted(input_api, output_api))
32 return results
34 def CheckChangeOnUpload(input_api, output_api):
35 results = []
36 results.extend(_CommonChecks(input_api, output_api))
37 return results
39 def CheckChangeOnCommit(input_api, output_api):
40 results = []
41 results.extend(_CommonChecks(input_api, output_api))
42 return results