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

Unified Diff: tools/generate_includes_cpp.py

Issue 753313002: fix for the msvs gyp generator that produces nonposix path separators (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/generate_includes_cpp.py
diff --git a/tools/generate_includes_cpp.py b/tools/generate_includes_cpp.py
index 1a6f117c630a3b922d94217e5a8369063b187647..abea1377d84133e6df97808c7659ab3c440ddeb4 100644
--- a/tools/generate_includes_cpp.py
+++ b/tools/generate_includes_cpp.py
@@ -15,7 +15,7 @@ import re
def is_ignored(full_path, ignore_list):
for ignore_path in ignore_list:
- if re.match(full_path, ignore_path, re.I):
+ if re.search(ignore_path, full_path, re.I):
return True
return False
@@ -66,7 +66,18 @@ def main():
include_dirs: directories to traverse for include files""")
(options, args) = parser.parse_args()
- GenerateIncludeCPP(args[0], args[1:], options.ignore.split())
+ # The MSVS gyp generator uses windows path separators so we intercept those
+ # strings and normalize them to our expected posix representation
+ include_dirs = []
+ for include_dir in args[1:]:
+ include_dirs.append(include_dir.replace("\\", "/"))
+ ignore_list = options.ignore.replace("\\", "/")
+
+ # We can strip off the relative portion of the path to ensure that when we
+ # compare for regex matches we don't fail based on relative path depth
+ ignore_list = ignore_list.replace("../", "")
+
+ GenerateIncludeCPP(args[0], include_dirs, ignore_list.split())
if __name__ == "__main__":
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698