| OLD | NEW |
| 1 # Copyright (c) 2013 Google Inc. All rights reserved. | 1 # Copyright (c) 2013 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 copy | 5 import copy |
| 6 import hashlib | 6 import hashlib |
| 7 import multiprocessing | 7 import multiprocessing |
| 8 import os.path | 8 import os.path |
| 9 import re | 9 import re |
| 10 import signal | 10 import signal |
| (...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 755 generator_default_variables['PRODUCT_DIR'], | 755 generator_default_variables['PRODUCT_DIR'], |
| 756 self.xcode_settings, self.GypPathToNinja) | 756 self.xcode_settings, self.GypPathToNinja) |
| 757 if not info_plist: | 757 if not info_plist: |
| 758 return | 758 return |
| 759 out = self.ExpandSpecial(out) | 759 out = self.ExpandSpecial(out) |
| 760 if defines: | 760 if defines: |
| 761 # Create an intermediate file to store preprocessed results. | 761 # Create an intermediate file to store preprocessed results. |
| 762 intermediate_plist = self.GypPathToUniqueOutput( | 762 intermediate_plist = self.GypPathToUniqueOutput( |
| 763 os.path.basename(info_plist)) | 763 os.path.basename(info_plist)) |
| 764 defines = ' '.join([Define(d, self.flavor) for d in defines]) | 764 defines = ' '.join([Define(d, self.flavor) for d in defines]) |
| 765 info_plist = self.ninja.build(intermediate_plist, 'infoplist', info_plist, | 765 info_plist = self.ninja.build( |
| 766 variables=[('defines',defines)]) | 766 intermediate_plist, 'preprocess_infoplist', info_plist, |
| 767 variables=[('defines',defines)]) |
| 767 | 768 |
| 768 env = self.GetSortedXcodeEnv(additional_settings=extra_env) | 769 env = self.GetSortedXcodeEnv(additional_settings=extra_env) |
| 769 env = self.ComputeExportEnvString(env) | 770 env = self.ComputeExportEnvString(env) |
| 770 | 771 |
| 771 self.ninja.build(out, 'mac_tool', info_plist, | 772 keys = self.xcode_settings.GetExtraPlistItems() |
| 772 variables=[('mactool_cmd', 'copy-info-plist'), | 773 keys = [QuoteShellArgument(v, self.flavor) for v in sum(keys.items(), ())] |
| 773 ('env', env)]) | 774 self.ninja.build(out, 'copy_infoplist', info_plist, |
| 775 variables=[('env', env), ('keys', keys)]) |
| 774 bundle_depends.append(out) | 776 bundle_depends.append(out) |
| 775 | 777 |
| 776 def WriteSources(self, ninja_file, config_name, config, sources, predepends, | 778 def WriteSources(self, ninja_file, config_name, config, sources, predepends, |
| 777 precompiled_header, spec): | 779 precompiled_header, spec): |
| 778 """Write build rules to compile all of |sources|.""" | 780 """Write build rules to compile all of |sources|.""" |
| 779 if self.toolset == 'host': | 781 if self.toolset == 'host': |
| 780 self.ninja.variable('ar', '$ar_host') | 782 self.ninja.variable('ar', '$ar_host') |
| 781 self.ninja.variable('cc', '$cc_host') | 783 self.ninja.variable('cc', '$cc_host') |
| 782 self.ninja.variable('cxx', '$cxx_host') | 784 self.ninja.variable('cxx', '$cxx_host') |
| 783 self.ninja.variable('ld', '$ld_host') | 785 self.ninja.variable('ld', '$ld_host') |
| (...skipping 1181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1965 command=solink_base % {'suffix': solink_module_suffix, 'type': '-bundle'}, | 1967 command=solink_base % {'suffix': solink_module_suffix, 'type': '-bundle'}, |
| 1966 pool='link_pool') | 1968 pool='link_pool') |
| 1967 | 1969 |
| 1968 master_ninja.rule( | 1970 master_ninja.rule( |
| 1969 'link', | 1971 'link', |
| 1970 description='LINK $out, POSTBUILDS', | 1972 description='LINK $out, POSTBUILDS', |
| 1971 command=('$ld $ldflags -o $out ' | 1973 command=('$ld $ldflags -o $out ' |
| 1972 '$in $solibs $libs$postbuilds'), | 1974 '$in $solibs $libs$postbuilds'), |
| 1973 pool='link_pool') | 1975 pool='link_pool') |
| 1974 master_ninja.rule( | 1976 master_ninja.rule( |
| 1975 'infoplist', | 1977 'preprocess_infoplist', |
| 1976 description='INFOPLIST $out', | 1978 description='PREPROCESS INFOPLIST $out', |
| 1977 command=('$cc -E -P -Wno-trigraphs -x c $defines $in -o $out && ' | 1979 command=('$cc -E -P -Wno-trigraphs -x c $defines $in -o $out && ' |
| 1978 'plutil -convert xml1 $out $out')) | 1980 'plutil -convert xml1 $out $out')) |
| 1979 master_ninja.rule( | 1981 master_ninja.rule( |
| 1982 'copy_infoplist', |
| 1983 description='COPY INFOPLIST $in', |
| 1984 command='$env ./gyp-mac-tool copy-info-plist $in $out $keys') |
| 1985 master_ninja.rule( |
| 1980 'mac_tool', | 1986 'mac_tool', |
| 1981 description='MACTOOL $mactool_cmd $in', | 1987 description='MACTOOL $mactool_cmd $in', |
| 1982 command='$env ./gyp-mac-tool $mactool_cmd $in $out') | 1988 command='$env ./gyp-mac-tool $mactool_cmd $in $out') |
| 1983 master_ninja.rule( | 1989 master_ninja.rule( |
| 1984 'package_framework', | 1990 'package_framework', |
| 1985 description='PACKAGE FRAMEWORK $out, POSTBUILDS', | 1991 description='PACKAGE FRAMEWORK $out, POSTBUILDS', |
| 1986 command='./gyp-mac-tool package-framework $out $version$postbuilds ' | 1992 command='./gyp-mac-tool package-framework $out $version$postbuilds ' |
| 1987 '&& touch $out') | 1993 '&& touch $out') |
| 1988 if flavor == 'win': | 1994 if flavor == 'win': |
| 1989 master_ninja.rule( | 1995 master_ninja.rule( |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2124 arglists.append( | 2130 arglists.append( |
| 2125 (target_list, target_dicts, data, params, config_name)) | 2131 (target_list, target_dicts, data, params, config_name)) |
| 2126 pool.map(CallGenerateOutputForConfig, arglists) | 2132 pool.map(CallGenerateOutputForConfig, arglists) |
| 2127 except KeyboardInterrupt, e: | 2133 except KeyboardInterrupt, e: |
| 2128 pool.terminate() | 2134 pool.terminate() |
| 2129 raise e | 2135 raise e |
| 2130 else: | 2136 else: |
| 2131 for config_name in config_names: | 2137 for config_name in config_names: |
| 2132 GenerateOutputForConfig(target_list, target_dicts, data, params, | 2138 GenerateOutputForConfig(target_list, target_dicts, data, params, |
| 2133 config_name) | 2139 config_name) |
| OLD | NEW |