OLD | NEW |
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 Loading... |
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 Loading... |
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() |
OLD | NEW |