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

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

Issue 2162213002: Revert of [Cronet] Use gn desc to find third party licenses on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 10cbe71fc432bed405aea6dbf3408e1c59f665ce..160d13928686b02cc43dd60efec79311df51b41f 100755
--- a/components/cronet/tools/cronet_licenses.py
+++ b/components/cronet/tools/cronet_licenses.py
@@ -23,7 +23,6 @@
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',
@@ -52,7 +51,7 @@
content = [_ReadFile('LICENSE')]
# Add necessary third_party.
- for directory in sorted(third_party_dirs, key=os.path.basename):
+ for directory in sorted(third_party_dirs):
metadata = licenses.ParseDir(directory, REPOSITORY_ROOT,
require_license_file=True)
content.append('-' * 20)
@@ -70,8 +69,8 @@
# Current gn directory cannot ba used because gn doesn't allow recursive
# invocations due to potential side effects.
try:
- tmp_dir = tempfile.mkdtemp(dir = os.path.join(gn_out_dir, ".."))
- shutil.copy(os.path.join(gn_out_dir, "args.gn"), tmp_dir)
+ tmp_dir = tempfile.mkdtemp(dir = gn_out_dir)
+ shutil.copy(gn_out_dir + "/args.gn", tmp_dir)
subprocess.check_output(["gn", "gen", tmp_dir])
gn_deps = subprocess.check_output(["gn", "desc", tmp_dir, \
"//net", "deps", "--as=buildfile", "--all"])
@@ -81,10 +80,9 @@
third_party_deps = []
for build_dep in gn_deps.split():
- # 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))
+ 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()
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