Chromium Code Reviews| Index: tools/licenses.py |
| diff --git a/tools/licenses.py b/tools/licenses.py |
| index 17dc94a3aab165e29e891a19b42189909aec5750..bdcbca9c7d31d197790843751585ecaf8798539f 100755 |
| --- a/tools/licenses.py |
| +++ b/tools/licenses.py |
| @@ -18,6 +18,7 @@ Commands: |
| import argparse |
| import cgi |
| import os |
| +import re |
| import subprocess |
| import sys |
| @@ -487,9 +488,12 @@ def FindThirdPartyDeps(gn_out_dir, gn_target): |
| "deps", "--as=buildfile", "--all"]) |
| third_party_deps = set() |
| for build_dep in gn_deps.split(): |
| - if ("third_party" in build_dep and |
| - os.path.basename(build_dep) == "BUILD.gn"): |
| - third_party_deps.add(os.path.dirname(build_dep)) |
| + # Note that it must always return the direct sub-directory of |
| + # third_party. e.g.: |
| + # .../third_party/cld_3/src/src/BUILD.gn -> .../third_party/cld_3 |
| + m = re.search(r"^(.+/third_party/[^/]+)/(.+/)?BUILD\.gn$", build_dep) |
|
Paweł Hajdan Jr.
2017/04/06 11:55:09
nit: Use single quotes ' .
Hiroshi Ichikawa
2017/04/07 05:07:51
Done.
|
| + if m: |
| + third_party_deps.add(m.group(1)) |
| return third_party_deps |