| 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 """Xcode project file generator. | 5 """Xcode project file generator. |
| 6 | 6 |
| 7 This module is both an Xcode project file generator and a documentation of the | 7 This module is both an Xcode project file generator and a documentation of the |
| 8 Xcode project file format. Knowledge of the project file format was gained | 8 Xcode project file format. Knowledge of the project file format was gained |
| 9 based on extensive experience with Xcode, and by making changes to projects in | 9 based on extensive experience with Xcode, and by making changes to projects in |
| 10 Xcode.app and observing the resultant changes in the associated project files. | 10 Xcode.app and observing the resultant changes in the associated project files. |
| (...skipping 1933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1944 'name': [0, str, 0, 0], | 1944 'name': [0, str, 0, 0], |
| 1945 }) | 1945 }) |
| 1946 | 1946 |
| 1947 # path_tree_re matches "$(DIR)/path" or just "$(DIR)". Match group 1 is | 1947 # path_tree_re matches "$(DIR)/path" or just "$(DIR)". Match group 1 is |
| 1948 # "DIR", match group 3 is "path" or None. | 1948 # "DIR", match group 3 is "path" or None. |
| 1949 path_tree_re = re.compile('^\\$\\((.*)\\)(/(.*)|)$') | 1949 path_tree_re = re.compile('^\\$\\((.*)\\)(/(.*)|)$') |
| 1950 | 1950 |
| 1951 # path_tree_to_subfolder maps names of Xcode variables to the associated | 1951 # path_tree_to_subfolder maps names of Xcode variables to the associated |
| 1952 # dstSubfolderSpec property value used in a PBXCopyFilesBuildPhase object. | 1952 # dstSubfolderSpec property value used in a PBXCopyFilesBuildPhase object. |
| 1953 path_tree_to_subfolder = { | 1953 path_tree_to_subfolder = { |
| 1954 'BUILT_FRAMEWORKS_DIR': 10, # Frameworks Directory |
| 1954 'BUILT_PRODUCTS_DIR': 16, # Products Directory | 1955 'BUILT_PRODUCTS_DIR': 16, # Products Directory |
| 1955 # Other types that can be chosen via the Xcode UI. | 1956 # Other types that can be chosen via the Xcode UI. |
| 1956 # TODO(mark): Map Xcode variable names to these. | 1957 # TODO(mark): Map Xcode variable names to these. |
| 1957 # : 1, # Wrapper | 1958 # : 1, # Wrapper |
| 1958 # : 6, # Executables: 6 | 1959 # : 6, # Executables: 6 |
| 1959 # : 7, # Resources | 1960 # : 7, # Resources |
| 1960 # : 15, # Java Resources | 1961 # : 15, # Java Resources |
| 1961 # : 10, # Frameworks | |
| 1962 # : 11, # Shared Frameworks | 1962 # : 11, # Shared Frameworks |
| 1963 # : 12, # Shared Support | 1963 # : 12, # Shared Support |
| 1964 # : 13, # PlugIns | 1964 # : 13, # PlugIns |
| 1965 } | 1965 } |
| 1966 | 1966 |
| 1967 def Name(self): | 1967 def Name(self): |
| 1968 if 'name' in self._properties: | 1968 if 'name' in self._properties: |
| 1969 return self._properties['name'] | 1969 return self._properties['name'] |
| 1970 | 1970 |
| 1971 return 'CopyFiles' | 1971 return 'CopyFiles' |
| (...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2915 self._XCPrint(file, 0, '/* Begin ' + class_name + ' section */\n') | 2915 self._XCPrint(file, 0, '/* Begin ' + class_name + ' section */\n') |
| 2916 for object in sorted(objects_by_class[class_name], | 2916 for object in sorted(objects_by_class[class_name], |
| 2917 cmp=lambda x, y: cmp(x.id, y.id)): | 2917 cmp=lambda x, y: cmp(x.id, y.id)): |
| 2918 object.Print(file) | 2918 object.Print(file) |
| 2919 self._XCPrint(file, 0, '/* End ' + class_name + ' section */\n') | 2919 self._XCPrint(file, 0, '/* End ' + class_name + ' section */\n') |
| 2920 | 2920 |
| 2921 if self._should_print_single_line: | 2921 if self._should_print_single_line: |
| 2922 self._XCPrint(file, 0, '}; ') | 2922 self._XCPrint(file, 0, '}; ') |
| 2923 else: | 2923 else: |
| 2924 self._XCPrint(file, 1, '};\n') | 2924 self._XCPrint(file, 1, '};\n') |
| OLD | NEW |