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

Side by Side Diff: pylib/gyp/msvs_emulation.py

Issue 10337008: ninja windows: fix program path normalization (Closed) Base URL: https://gyp.googlecode.com/svn/trunk
Patch Set: Created 8 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 Google Inc. All rights reserved. 1 # Copyright (c) 2012 Google Inc. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """ 5 """
6 This module helps emulate Visual Studio 2008 behavior on top of other 6 This module helps emulate Visual Studio 2008 behavior on top of other
7 build systems, primarily ninja. 7 build systems, primarily ninja.
8 """ 8 """
9 9
10 import os 10 import os
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 53
54 def EncodeRspFileList(args): 54 def EncodeRspFileList(args):
55 """Process a list of arguments using QuoteCmdExeArgument.""" 55 """Process a list of arguments using QuoteCmdExeArgument."""
56 # Note that the first argument is assumed to be the command. Don't add 56 # Note that the first argument is assumed to be the command. Don't add
57 # quotes around it because then commands like 'call x.bat' or shell 57 # quotes around it because then commands like 'call x.bat' or shell
58 # built-ins like 'echo', etc. won't work. Also, don't bother special casing 58 # built-ins like 'echo', etc. won't work. Also, don't bother special casing
59 # to get quotes around the remainder (after 'call') since other generators 59 # to get quotes around the remainder (after 'call') since other generators
60 # and gyp in general don't really support spaces in paths. 60 # and gyp in general don't really support spaces in paths.
61 if not args: return '' 61 if not args: return ''
62 program = args[0] 62 program = os.path.normpath(args[0])
63 return program + ' ' + ' '.join(QuoteForRspFile(arg) for arg in args[1:]) 63 return program + ' ' + ' '.join(QuoteForRspFile(arg) for arg in args[1:])
64 64
65 65
66 def _GenericRetrieve(root, default, path): 66 def _GenericRetrieve(root, default, path):
67 """Given a list of dictionary keys |path| and a tree of dicts |root|, find 67 """Given a list of dictionary keys |path| and a tree of dicts |root|, find
68 value at path, or return |default| if any of the path doesn't exist.""" 68 value at path, or return |default| if any of the path doesn't exist."""
69 if not root: 69 if not root:
70 return default 70 return default
71 if not path: 71 if not path:
72 return root 72 return root
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 return vs.SetupScript() 463 return vs.SetupScript()
464 464
465 def ExpandMacros(string, expansions): 465 def ExpandMacros(string, expansions):
466 """Expand $(Variable) per expansions dict. See MsvsSettings.GetVSMacroEnv 466 """Expand $(Variable) per expansions dict. See MsvsSettings.GetVSMacroEnv
467 for the canonical way to retrieve a suitable dict.""" 467 for the canonical way to retrieve a suitable dict."""
468 if '$' in string: 468 if '$' in string:
469 for old, new in expansions.iteritems(): 469 for old, new in expansions.iteritems():
470 assert '$(' not in new, new 470 assert '$(' not in new, new
471 string = string.replace(old, new) 471 string = string.replace(old, new)
472 return string 472 return string
OLDNEW
« 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