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

Unified Diff: tools/vim/ninja_output.py

Issue 1940753002: Enable YouCompleteMe and :CrCompile to find GN build directory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change from 'out/Debug' to 'out/gn' directory in tests. Created 4 years, 8 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 | « tools/vim/ninja-build.vim ('k') | tools/vim/tests/chromium.ycm_extra_conf_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/vim/ninja_output.py
diff --git a/tools/vim/ninja_output.py b/tools/vim/ninja_output.py
index 5bb638ab6d96676c368d8e5afcc81e4f7ceba308..e6add1302c8c0b6938d09deef9aee73e224f4832 100644
--- a/tools/vim/ninja_output.py
+++ b/tools/vim/ninja_output.py
@@ -10,8 +10,8 @@ import itertools
import re
-def GetNinjaOutputDirectory(chrome_root, configuration=None):
- """Returns <chrome_root>/<output_dir>/(Release|Debug).
+def GetNinjaOutputDirectory(chrome_root):
+ """Returns <chrome_root>/<output_dir>/(Release|Debug|<other>).
If either of the following environment variables are set, their
value is used to determine the output directory:
@@ -20,11 +20,7 @@ def GetNinjaOutputDirectory(chrome_root, configuration=None):
Otherwise, all directories starting with the word out are examined.
- The output directory must contain {configuration}/build.ninja (if
- configuration is None, both Debug and Release will be checked).
-
- The configuration chosen is the one most recently generated/built,
- but can be overriden via the <configuration> parameter.
+ The configuration chosen is the one most recently generated/built.
"""
output_dirs = []
@@ -45,15 +41,13 @@ def GetNinjaOutputDirectory(chrome_root, configuration=None):
if os.path.isdir(out):
output_dirs.append(os.path.relpath(out, start = chrome_root))
- configs = ['Debug', 'Release', 'Default']
- if configuration:
- configs = [configuration]
-
def generate_paths():
- for out_dir, config in itertools.product(output_dirs, configs):
- path = os.path.join(chrome_root, out_dir, config)
- if os.path.exists(os.path.join(path, 'build.ninja')):
- yield path
+ for out_dir in output_dirs:
+ out_path = os.path.join(chrome_root, out_dir)
+ for config in os.listdir(out_path):
+ path = os.path.join(out_path, config)
+ if os.path.exists(os.path.join(path, 'build.ninja')):
+ yield path
def approx_directory_mtime(path):
# This is a heuristic; don't recurse into subdirectories.
« no previous file with comments | « tools/vim/ninja-build.vim ('k') | tools/vim/tests/chromium.ycm_extra_conf_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698