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

Side by Side Diff: pylib/gyp/generator/xcode.py

Issue 10535052: Make Ninja backend robust to rules and actions containing slashes (Closed) Base URL: http://git.chromium.org/external/gyp.git@master
Patch Set: Created 8 years, 6 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
« no previous file with comments | « pylib/gyp/generator/scons.py ('k') | test/sanitize-rule-names/sanitize-rule-names.gyp » ('j') | 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 import filecmp 5 import filecmp
6 import gyp.common 6 import gyp.common
7 import gyp.xcodeproj_file 7 import gyp.xcodeproj_file
8 import errno 8 import errno
9 import os 9 import os
10 import posixpath 10 import posixpath
(...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after
919 919
920 # Turn the list into a string that can be passed to a shell. 920 # Turn the list into a string that can be passed to a shell.
921 action_string = gyp.common.EncodePOSIXShellList(rule['action']) 921 action_string = gyp.common.EncodePOSIXShellList(rule['action'])
922 922
923 action = ExpandXcodeVariables(action_string, rule_input_dict) 923 action = ExpandXcodeVariables(action_string, rule_input_dict)
924 actions.append(action) 924 actions.append(action)
925 925
926 if len(concrete_outputs_all) > 0: 926 if len(concrete_outputs_all) > 0:
927 # TODO(mark): There's a possibilty for collision here. Consider 927 # TODO(mark): There's a possibilty for collision here. Consider
928 # target "t" rule "A_r" and target "t_A" rule "r". 928 # target "t" rule "A_r" and target "t_A" rule "r".
929 makefile_name = '%s_%s.make' % (target_name, rule['rule_name']) 929 makefile_name = '%s.make' % re.sub(
930 '[^a-zA-Z0-9_]', '_' , '%s_%s' % (target_name, rule['rule_name']))
930 makefile_path = os.path.join(xcode_projects[build_file].path, 931 makefile_path = os.path.join(xcode_projects[build_file].path,
931 makefile_name) 932 makefile_name)
932 # TODO(mark): try/close? Write to a temporary file and swap it only 933 # TODO(mark): try/close? Write to a temporary file and swap it only
933 # if it's got changes? 934 # if it's got changes?
934 makefile = open(makefile_path, 'wb') 935 makefile = open(makefile_path, 'wb')
935 936
936 # make will build the first target in the makefile by default. By 937 # make will build the first target in the makefile by default. By
937 # convention, it's called "all". List all (or at least one) 938 # convention, it's called "all". List all (or at least one)
938 # concrete output for each rule source as a prerequisite of the "all" 939 # concrete output for each rule source as a prerequisite of the "all"
939 # target. 940 # target.
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
1199 1200
1200 for build_file in build_files: 1201 for build_file in build_files:
1201 xcode_projects[build_file].Finalize1(xcode_targets, serialize_all_tests) 1202 xcode_projects[build_file].Finalize1(xcode_targets, serialize_all_tests)
1202 1203
1203 for build_file in build_files: 1204 for build_file in build_files:
1204 xcode_projects[build_file].Finalize2(xcode_targets, 1205 xcode_projects[build_file].Finalize2(xcode_targets,
1205 xcode_target_to_target_dict) 1206 xcode_target_to_target_dict)
1206 1207
1207 for build_file in build_files: 1208 for build_file in build_files:
1208 xcode_projects[build_file].Write() 1209 xcode_projects[build_file].Write()
OLDNEW
« no previous file with comments | « pylib/gyp/generator/scons.py ('k') | test/sanitize-rule-names/sanitize-rule-names.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698