Chromium Code Reviews| 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..795ff36cf23208a3165a706d4663f0b5a26d73d1 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,9 @@ 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() |
| + if ("third_party" in build_dep and not "android_tools" in build_dep and |
|
xunjieli
2016/07/18 14:54:50
Could you add a brief comment here on why we are e
mef
2016/07/18 15:45:20
Done. There is no license in build/secondary/third
|
| + os.path.basename(build_dep) == "BUILD.gn"): |
| + third_party_deps.append(os.path.dirname(build_dep)) |
| return third_party_deps |