Index: build/ios/PRESUBMIT.py |
diff --git a/build/ios/PRESUBMIT.py b/build/ios/PRESUBMIT.py |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2a0420d93cb279b3001279127ea3aa662f988597 |
--- /dev/null |
+++ b/build/ios/PRESUBMIT.py |
@@ -0,0 +1,40 @@ |
+# Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+# Use of this source code is governed by a BSD-style license that can be |
+# found in the LICENSE file. |
+ |
+import os |
+ |
+"""Chromium presubmit script for src/tools/ios. |
+ |
+See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts |
+for more details on the presubmit API built into gcl. |
+""" |
+ |
+WHITELIST_FILE = 'build/ios/grit_whitelist.txt' |
+ |
+def _CheckWhitelistSorted(input_api, output_api): |
+ for path in input_api.LocalPaths(): |
+ if WHITELIST_FILE == path: |
+ lines = open(os.path.join('../..', WHITELIST_FILE)).readlines() |
+ sorted = all(lines[i] <= lines[i+1] for i in xrange(len(lines)-1)) |
+ if not sorted: |
+ return [ output_api.PresubmitError( |
+ 'The file ' + WHITELIST_FILE + ' must be sorted.') ] |
+ return [] |
+ |
+def _CommonChecks(input_api, output_api): |
+ """Checks common to both upload and commit.""" |
+ results = [] |
+ results.extend(_CheckWhitelistSorted(input_api, output_api)) |
+ return results |
+ |
+def CheckChangeOnUpload(input_api, output_api): |
+ results = [] |
+ results.extend(_CommonChecks(input_api, output_api)) |
+ return results |
+ |
stuartmorgan
2012/10/02 16:16:56
Remove the extra blank line.
msarda
2012/10/02 16:29:23
Done.
|
+ |
+def CheckChangeOnCommit(input_api, output_api): |
+ results = [] |
+ results.extend(_CommonChecks(input_api, output_api)) |
+ return results |