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

Unified Diff: tools/licenses.py

Issue 2728913002: [remoting android] Generate trimmed-down credits.html. (Closed)
Patch Set: Use GN binary from //buildtools. Created 3 years, 9 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 | « remoting/credits/credits_js.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/licenses.py
diff --git a/tools/licenses.py b/tools/licenses.py
index b5b68ff9a6d7f5ffd1beddf2276ad3f133f4d2a3..17dc94a3aab165e29e891a19b42189909aec5750 100755
--- a/tools/licenses.py
+++ b/tools/licenses.py
@@ -462,11 +462,28 @@ def FindThirdPartyDirsWithFiles(root):
return FilterDirsWithFiles(third_party_dirs, root)
+# Many builders do not contain 'gn' in their PATH, so use the GN binary from
+# //buildtools.
+def _GnBinary():
+ exe = 'gn'
+ if sys.platform == 'linux2':
+ subdir = 'linux64'
+ elif sys.platform == 'darwin':
+ subdir = 'mac'
+ elif sys.platform == 'win32':
+ subdir, exe = 'win', 'gn.exe'
+ else:
+ raise RuntimeError("Unsupported platform '%s'." % sys.platform)
+
+ return os.path.join(_REPOSITORY_ROOT, 'buildtools', subdir, exe)
+
+
def FindThirdPartyDeps(gn_out_dir, gn_target):
if not gn_out_dir:
raise RuntimeError("--gn-out-dir is required if --gn-target is used.")
- gn_deps = subprocess.check_output(["gn", "desc", gn_out_dir, gn_target,
+ gn_deps = subprocess.check_output([_GnBinary(), "desc", gn_out_dir,
+ gn_target,
"deps", "--as=buildfile", "--all"])
third_party_deps = set()
for build_dep in gn_deps.split():
« no previous file with comments | « remoting/credits/credits_js.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698