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

Side by Side Diff: android_webview/tools/webview_licenses.py

Issue 10993012: Fix webview license scan for clang (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 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 """Checks third-party licenses for the purposes of the Android WebView build. 6 """Checks third-party licenses for the purposes of the Android WebView build.
7 7
8 The Android tree includes a snapshot of Chromium in order to power the system 8 The Android tree includes a snapshot of Chromium in order to power the system
9 WebView. This tool checks that all code uses open-source licenses compatible 9 WebView. This tool checks that all code uses open-source licenses compatible
10 with Android, and that we meet the requirements of those licenses. It can also 10 with Android, and that we meet the requirements of those licenses. It can also
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 # This is a test output directory. 109 # This is a test output directory.
110 directory_list.append('data/page_cycler/') 110 directory_list.append('data/page_cycler/')
111 # 'Copyright' appears in strings. 111 # 'Copyright' appears in strings.
112 directory_list.append('chrome/app/resources/') 112 directory_list.append('chrome/app/resources/')
113 # This is a Chrome on Linux reference build, doesn't exist in the snapshot 113 # This is a Chrome on Linux reference build, doesn't exist in the snapshot
114 directory_list.append('chrome/tools/test/reference_build/chrome_linux/') 114 directory_list.append('chrome/tools/test/reference_build/chrome_linux/')
115 # Remoting internal tools, doesn't exist in the snapshot 115 # Remoting internal tools, doesn't exist in the snapshot
116 directory_list.append('remoting/appengine/') 116 directory_list.append('remoting/appengine/')
117 # Histogram tools, doesn't exist in the snapshot 117 # Histogram tools, doesn't exist in the snapshot
118 directory_list.append('tools/histograms/') 118 directory_list.append('tools/histograms/')
119 # Ignore clang builders.
120 directory_list.append('third_party/llvm-build/')
121 119
122 # Exclude files under listed directories and some known offenders. 120 # Exclude files under listed directories and some known offenders.
123 offending_files = [] 121 offending_files = []
124 for x in files: 122 for x in files:
125 x = os.path.normpath(x) 123 x = os.path.normpath(x)
126 is_in_listed_directory = False 124 is_in_listed_directory = False
127 for y in directory_list: 125 for y in directory_list:
128 if x.startswith(y): 126 if x.startswith(y):
129 is_in_listed_directory = True 127 is_in_listed_directory = True
130 break 128 break
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 """ 166 """
169 167
170 prune_paths = [ 168 prune_paths = [
171 # Placeholder directory, no third-party code. 169 # Placeholder directory, no third-party code.
172 os.path.join('third_party', 'adobe'), 170 os.path.join('third_party', 'adobe'),
173 # Apache 2.0 license. See 171 # Apache 2.0 license. See
174 # https://code.google.com/p/chromium/issues/detail?id=140478. 172 # https://code.google.com/p/chromium/issues/detail?id=140478.
175 os.path.join('third_party', 'bidichecker'), 173 os.path.join('third_party', 'bidichecker'),
176 # Isn't checked out on clients 174 # Isn't checked out on clients
177 os.path.join('third_party', 'gles2_conform'), 175 os.path.join('third_party', 'gles2_conform'),
176 # The llvm-build doesn't exist for non-clang builder
177 os.path.join('third_party', 'llvm-build'),
178 ] 178 ]
179 return licenses.FindThirdPartyDirs(prune_paths) 179 return licenses.FindThirdPartyDirs(prune_paths)
180 180
181 181
182 def _Scan(): 182 def _Scan():
183 """Checks that license meta-data is present for all third-party code. 183 """Checks that license meta-data is present for all third-party code.
184 Returns: 184 Returns:
185 Whether the check succeeded. 185 Whether the check succeeded.
186 """ 186 """
187 187
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 return 1 261 return 1
262 elif args[0] == 'notice': 262 elif args[0] == 'notice':
263 print GenerateNoticeFile() 263 print GenerateNoticeFile()
264 return 0 264 return 0
265 265
266 parser.print_help() 266 parser.print_help()
267 return 1 267 return 1
268 268
269 if __name__ == '__main__': 269 if __name__ == '__main__':
270 sys.exit(main()) 270 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698