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

Unified Diff: components/cronet/tools/cronet_licenses.py

Issue 2150933007: [Cronet] Use gn desc to find third party licenses on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Pass gn-path for gn inside of //buildtools. Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/cronet/android/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/cronet/tools/cronet_licenses.py
diff --git a/components/cronet/tools/cronet_licenses.py b/components/cronet/tools/cronet_licenses.py
index ab263886f23ad7f2575edf4d7bdab559e740878c..91c83a4fd7e182baf9b2cd2c1030250a9dea8a04 100755
--- a/components/cronet/tools/cronet_licenses.py
+++ b/components/cronet/tools/cronet_licenses.py
@@ -23,6 +23,7 @@ REPOSITORY_ROOT = os.path.abspath(os.path.join(
sys.path.append(os.path.join(REPOSITORY_ROOT, 'tools'))
import licenses
+# TODO(mef): Remove hard-coded list once GYP support is deprecated.
third_party_dirs = [
'base/third_party/libevent',
'third_party/ashmem',
@@ -51,7 +52,7 @@ def GenerateLicense():
content = [_ReadFile('LICENSE')]
# Add necessary third_party.
- for directory in sorted(third_party_dirs):
+ for directory in sorted(third_party_dirs, key=os.path.basename):
metadata = licenses.ParseDir(directory, REPOSITORY_ROOT,
require_license_file=True)
content.append('-' * 20)
@@ -80,9 +81,10 @@ def FindThirdPartyDeps(gn_path, gn_out_dir):
third_party_deps = []
for build_dep in gn_deps.split():
- if ("third_party" in build_dep and build_dep.endswith("/BUILD.gn")):
- third_party_deps.append(build_dep.replace("/BUILD.gn", ""))
- third_party_deps.sort()
+ # Look for third party deps that have separate license.
+ if ("third_party" in build_dep and not "android_tools" in build_dep and
+ os.path.basename(build_dep) == "BUILD.gn"):
+ third_party_deps.append(os.path.dirname(build_dep))
return third_party_deps
« no previous file with comments | « components/cronet/android/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698