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

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

Issue 660163002: Collect license version as an optional_key in licenses.py (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed Required Text functionality Created 6 years, 1 month 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
« no previous file with comments | « no previous file | chrome/browser/resources/about_credits_entry.tmpl » ('j') | 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 2014 The Chromium Authors. All rights reserved. 2 # Copyright 2014 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 A list of directories. 56 A list of directories.
57 """ 57 """
58 58
59 result = [] 59 result = []
60 for directory in _FindThirdPartyDirs(): 60 for directory in _FindThirdPartyDirs():
61 if directory in known_issues.KNOWN_ISSUES: 61 if directory in known_issues.KNOWN_ISSUES:
62 result.append(directory) 62 result.append(directory)
63 continue 63 continue
64 try: 64 try:
65 metadata = licenses.ParseDir(directory, REPOSITORY_ROOT, 65 metadata = licenses.ParseDir(directory, REPOSITORY_ROOT,
66 require_license_file=False) 66 require_license_file=False,
67 optional_keys=['License Android Compatible'])
67 except licenses.LicenseError as e: 68 except licenses.LicenseError as e:
68 print 'Got LicenseError while scanning ' + directory 69 print 'Got LicenseError while scanning ' + directory
69 raise 70 raise
70 if metadata.get('License Android Compatible', 'no').upper() == 'YES': 71 if metadata.get('License Android Compatible', 'no').upper() == 'YES':
71 continue 72 continue
72 license = re.split(' [Ll]icenses?$', metadata['License'])[0] 73 license = re.split(' [Ll]icenses?$', metadata['License'])[0]
73 if not third_party.LicenseIsCompatibleWithAndroid(InputApi(), license): 74 if not third_party.LicenseIsCompatibleWithAndroid(InputApi(), license):
74 result.append(directory) 75 result.append(directory)
75 return result 76 return result
76 77
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 files = sys.stdin.read().splitlines() 363 files = sys.stdin.read().splitlines()
363 for f, c in \ 364 for f, c in \
364 zip(files, copyright_scanner.FindCopyrights(InputApi(), '.', files)): 365 zip(files, copyright_scanner.FindCopyrights(InputApi(), '.', files)):
365 print f, '\t', ' / '.join(sorted(c)) 366 print f, '\t', ' / '.join(sorted(c))
366 return ScanResult.Ok 367 return ScanResult.Ok
367 parser.print_help() 368 parser.print_help()
368 return ScanResult.Errors 369 return ScanResult.Errors
369 370
370 if __name__ == '__main__': 371 if __name__ == '__main__':
371 sys.exit(main()) 372 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/about_credits_entry.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698