OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Helper script for PPAPI's PRESUBMIT.py to detect if additions or removals of | 6 """Helper script for PPAPI's PRESUBMIT.py to detect if additions or removals of |
7 PPAPI interfaces have been propagated to the Native Client libraries (.dsc | 7 PPAPI interfaces have been propagated to the Native Client libraries (.dsc |
8 files). | 8 files). |
9 | 9 |
10 For example, if a user adds "ppapi/c/foo.h", we check that the interface has | 10 For example, if a user adds "ppapi/c/foo.h", we check that the interface has |
11 been added to "native_client_sdk/src/libraries/ppapi/library.dsc". | 11 been added to "native_client_sdk/src/libraries/ppapi/library.dsc". |
12 """ | 12 """ |
13 | 13 |
14 import argparse | 14 import argparse |
15 import os | 15 import os |
16 import sys | 16 import sys |
17 | 17 |
18 from build_paths import PPAPI_DIR, SRC_DIR, SDK_LIBRARY_DIR | 18 from build_paths import PPAPI_DIR, SRC_DIR, SDK_LIBRARY_DIR |
19 import parse_dsc | 19 import parse_dsc |
20 | 20 |
21 | 21 |
22 # Add a file to this list if it should not be added to a .dsc file; i.e. if it | 22 # Add a file to this list if it should not be added to a .dsc file; i.e. if it |
23 # should not be included in the Native Client SDK. This will silence the | 23 # should not be included in the Native Client SDK. This will silence the |
24 # presubmit warning. | 24 # presubmit warning. |
25 # | 25 # |
26 # Some examples of files that should not be added to the SDK are: Dev and | 26 # Some examples of files that should not be added to the SDK are: Dev and |
27 # Private interfaces that are either not available to NaCl plugins or are only | 27 # Private interfaces that are either not available to NaCl plugins or are only |
28 # available to Flash or other privileged plugins. | 28 # available to Flash or other privileged plugins. |
29 IGNORED_FILES = set([ | 29 IGNORED_FILES = set([ |
30 'ppb_font_dev.h', | |
31 'pp_video_dev.h', | 30 'pp_video_dev.h', |
32 ]) | 31 ]) |
33 | 32 |
34 | 33 |
35 class VerifyException(Exception): | 34 class VerifyException(Exception): |
36 def __init__(self, lib_path, expected, unexpected): | 35 def __init__(self, lib_path, expected, unexpected): |
37 self.expected = expected | 36 self.expected = expected |
38 self.unexpected = unexpected | 37 self.unexpected = unexpected |
39 | 38 |
40 msg = 'In %s:\n' % lib_path | 39 msg = 'In %s:\n' % lib_path |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 is_private = lib_name == 'ppapi_cpp_private' | 190 is_private = lib_name == 'ppapi_cpp_private' |
192 if not VerifyOrPrintError(rel_dsc_filename, dsc_sources_and_headers, | 191 if not VerifyOrPrintError(rel_dsc_filename, dsc_sources_and_headers, |
193 changed_filenames, removed_filenames, | 192 changed_filenames, removed_filenames, |
194 is_private=is_private): | 193 is_private=is_private): |
195 retval = 1 | 194 retval = 1 |
196 return retval | 195 return retval |
197 | 196 |
198 | 197 |
199 if __name__ == '__main__': | 198 if __name__ == '__main__': |
200 sys.exit(main(sys.argv[1:])) | 199 sys.exit(main(sys.argv[1:])) |
OLD | NEW |