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

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

Issue 2246573002: Pass path to gn binary to cronet_licenses.py when building for iOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/ios/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 c68933d65d3cee71a0bcf663311a025ed5f12a4a..19dde639ffdcd70a25350f90fdb966b39d2523da 100755
--- a/components/cronet/tools/cronet_licenses.py
+++ b/components/cronet/tools/cronet_licenses.py
@@ -64,15 +64,15 @@ def GenerateLicense():
return '\n'.join(content)
-def FindThirdPartyDeps(gn_out_dir):
+def FindThirdPartyDeps(gn_path, gn_out_dir):
# Generate gn project in temp directory and use it to find dependencies.
# 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)
- subprocess.check_output(["gn", "gen", tmp_dir])
- gn_deps = subprocess.check_output(["gn", "desc", tmp_dir, \
+ subprocess.check_output([gn_path, "gen", tmp_dir])
+ gn_deps = subprocess.check_output([gn_path, "desc", tmp_dir,
"//net", "deps", "--as=buildfile", "--all"])
finally:
if os.path.exists(tmp_dir):
@@ -97,15 +97,18 @@ def main():
usage='%prog command [options]')
parser.add_option('--gn', help='Use gn deps to find third party dependencies',
action='store_true')
+ parser.add_option('--gn-path', default='gn',
+ help='Path to gn executable (default: %(default)s)')
parser.description = (__doc__ +
'\nCommands:\n' \
' license [filename]\n' \
' Generate Cronet LICENSE to filename or stdout.\n')
- (_, args) = parser.parse_args()
+ (flags, args) = parser.parse_args()
+ print flags
- if _.gn:
+ if flags.gn:
global third_party_dirs
- third_party_dirs = FindThirdPartyDeps(os.getcwd())
+ third_party_dirs = FindThirdPartyDeps(flags.gn_path, os.getcwd())
if not args:
parser.print_help()
« no previous file with comments | « components/cronet/ios/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698