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

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: Added comment. 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 160d13928686b02cc43dd60efec79311df51b41f..1c669aba6a32d04178f37c2f1ac4b416755771af 100755
--- a/components/cronet/tools/cronet_licenses.py
+++ b/components/cronet/tools/cronet_licenses.py
@@ -51,7 +51,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)
@@ -69,8 +69,8 @@ def FindThirdPartyDeps(gn_out_dir):
# Current gn directory cannot ba used because gn doesn't allow recursive
# invocations due to potential side effects.
try:
- tmp_dir = tempfile.mkdtemp(dir = gn_out_dir)
- shutil.copy(gn_out_dir + "/args.gn", tmp_dir)
+ tmp_dir = tempfile.mkdtemp(dir = os.path.join(gn_out_dir, ".."))
+ shutil.copy(os.path.join(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"])
@@ -80,9 +80,10 @@ def FindThirdPartyDeps(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