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 collections | 5 import collections |
6 import copy | 6 import copy |
7 import hashlib | 7 import hashlib |
8 import json | 8 import json |
9 import multiprocessing | 9 import multiprocessing |
10 import os.path | 10 import os.path |
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 return outputs | 756 return outputs |
757 | 757 |
758 def WriteMacBundleResources(self, resources, bundle_depends): | 758 def WriteMacBundleResources(self, resources, bundle_depends): |
759 """Writes ninja edges for 'mac_bundle_resources'.""" | 759 """Writes ninja edges for 'mac_bundle_resources'.""" |
760 xcassets = [] | 760 xcassets = [] |
761 for output, res in gyp.xcode_emulation.GetMacBundleResources( | 761 for output, res in gyp.xcode_emulation.GetMacBundleResources( |
762 generator_default_variables['PRODUCT_DIR'], | 762 generator_default_variables['PRODUCT_DIR'], |
763 self.xcode_settings, map(self.GypPathToNinja, resources)): | 763 self.xcode_settings, map(self.GypPathToNinja, resources)): |
764 output = self.ExpandSpecial(output) | 764 output = self.ExpandSpecial(output) |
765 if os.path.splitext(output)[-1] != '.xcassets': | 765 if os.path.splitext(output)[-1] != '.xcassets': |
| 766 isBinary = self.xcode_settings.IsBinaryOutputFormat(self.config_name) |
766 self.ninja.build(output, 'mac_tool', res, | 767 self.ninja.build(output, 'mac_tool', res, |
767 variables=[('mactool_cmd', 'copy-bundle-resource')]) | 768 variables=[('mactool_cmd', 'copy-bundle-resource'), \ |
| 769 ('binary', isBinary)]) |
768 bundle_depends.append(output) | 770 bundle_depends.append(output) |
769 else: | 771 else: |
770 xcassets.append(res) | 772 xcassets.append(res) |
771 return xcassets | 773 return xcassets |
772 | 774 |
773 def WriteMacXCassets(self, xcassets, bundle_depends): | 775 def WriteMacXCassets(self, xcassets, bundle_depends): |
774 """Writes ninja edges for 'mac_bundle_resources' .xcassets files. | 776 """Writes ninja edges for 'mac_bundle_resources' .xcassets files. |
775 | 777 |
776 This add an invocation of 'actool' via the 'mac_tool.py' helper script. | 778 This add an invocation of 'actool' via the 'mac_tool.py' helper script. |
777 It assumes that the assets catalogs define at least one imageset and | 779 It assumes that the assets catalogs define at least one imageset and |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
837 env = self.ComputeExportEnvString(env) | 839 env = self.ComputeExportEnvString(env) |
838 | 840 |
839 if partial_info_plist: | 841 if partial_info_plist: |
840 intermediate_plist = self.GypPathToUniqueOutput('merged_info.plist') | 842 intermediate_plist = self.GypPathToUniqueOutput('merged_info.plist') |
841 info_plist = self.ninja.build( | 843 info_plist = self.ninja.build( |
842 intermediate_plist, 'merge_infoplist', | 844 intermediate_plist, 'merge_infoplist', |
843 [partial_info_plist, info_plist]) | 845 [partial_info_plist, info_plist]) |
844 | 846 |
845 keys = self.xcode_settings.GetExtraPlistItems(self.config_name) | 847 keys = self.xcode_settings.GetExtraPlistItems(self.config_name) |
846 keys = QuoteShellArgument(json.dumps(keys), self.flavor) | 848 keys = QuoteShellArgument(json.dumps(keys), self.flavor) |
| 849 isBinary = self.xcode_settings.IsBinaryOutputFormat(self.config_name) |
847 self.ninja.build(out, 'copy_infoplist', info_plist, | 850 self.ninja.build(out, 'copy_infoplist', info_plist, |
848 variables=[('env', env), ('keys', keys)]) | 851 variables=[('env', env), ('keys', keys), |
| 852 ('binary', isBinary)]) |
849 bundle_depends.append(out) | 853 bundle_depends.append(out) |
850 | 854 |
851 def WriteSources(self, ninja_file, config_name, config, sources, predepends, | 855 def WriteSources(self, ninja_file, config_name, config, sources, predepends, |
852 precompiled_header, spec): | 856 precompiled_header, spec): |
853 """Write build rules to compile all of |sources|.""" | 857 """Write build rules to compile all of |sources|.""" |
854 if self.toolset == 'host': | 858 if self.toolset == 'host': |
855 self.ninja.variable('ar', '$ar_host') | 859 self.ninja.variable('ar', '$ar_host') |
856 self.ninja.variable('cc', '$cc_host') | 860 self.ninja.variable('cc', '$cc_host') |
857 self.ninja.variable('cxx', '$cxx_host') | 861 self.ninja.variable('cxx', '$cxx_host') |
858 self.ninja.variable('ld', '$ld_host') | 862 self.ninja.variable('ld', '$ld_host') |
(...skipping 1327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2186 '$in $solibs $libs$postbuilds'), | 2190 '$in $solibs $libs$postbuilds'), |
2187 pool='link_pool') | 2191 pool='link_pool') |
2188 master_ninja.rule( | 2192 master_ninja.rule( |
2189 'preprocess_infoplist', | 2193 'preprocess_infoplist', |
2190 description='PREPROCESS INFOPLIST $out', | 2194 description='PREPROCESS INFOPLIST $out', |
2191 command=('$cc -E -P -Wno-trigraphs -x c $defines $in -o $out && ' | 2195 command=('$cc -E -P -Wno-trigraphs -x c $defines $in -o $out && ' |
2192 'plutil -convert xml1 $out $out')) | 2196 'plutil -convert xml1 $out $out')) |
2193 master_ninja.rule( | 2197 master_ninja.rule( |
2194 'copy_infoplist', | 2198 'copy_infoplist', |
2195 description='COPY INFOPLIST $in', | 2199 description='COPY INFOPLIST $in', |
2196 command='$env ./gyp-mac-tool copy-info-plist $in $out $keys') | 2200 command='$env ./gyp-mac-tool copy-info-plist $in $out $binary $keys') |
2197 master_ninja.rule( | 2201 master_ninja.rule( |
2198 'merge_infoplist', | 2202 'merge_infoplist', |
2199 description='MERGE INFOPLISTS $in', | 2203 description='MERGE INFOPLISTS $in', |
2200 command='$env ./gyp-mac-tool merge-info-plist $out $in') | 2204 command='$env ./gyp-mac-tool merge-info-plist $out $in') |
2201 master_ninja.rule( | 2205 master_ninja.rule( |
2202 'compile_xcassets', | 2206 'compile_xcassets', |
2203 description='COMPILE XCASSETS $in', | 2207 description='COMPILE XCASSETS $in', |
2204 command='$env ./gyp-mac-tool compile-xcassets $keys $in') | 2208 command='$env ./gyp-mac-tool compile-xcassets $keys $in') |
2205 master_ninja.rule( | 2209 master_ninja.rule( |
2206 'mac_tool', | 2210 'mac_tool', |
2207 description='MACTOOL $mactool_cmd $in', | 2211 description='MACTOOL $mactool_cmd $in', |
2208 command='$env ./gyp-mac-tool $mactool_cmd $in $out') | 2212 command='$env ./gyp-mac-tool $mactool_cmd $in $out $binary') |
2209 master_ninja.rule( | 2213 master_ninja.rule( |
2210 'package_framework', | 2214 'package_framework', |
2211 description='PACKAGE FRAMEWORK $out, POSTBUILDS', | 2215 description='PACKAGE FRAMEWORK $out, POSTBUILDS', |
2212 command='./gyp-mac-tool package-framework $out $version$postbuilds ' | 2216 command='./gyp-mac-tool package-framework $out $version$postbuilds ' |
2213 '&& touch $out') | 2217 '&& touch $out') |
2214 if flavor == 'win': | 2218 if flavor == 'win': |
2215 master_ninja.rule( | 2219 master_ninja.rule( |
2216 'stamp', | 2220 'stamp', |
2217 description='STAMP $out', | 2221 description='STAMP $out', |
2218 command='%s gyp-win-tool stamp $out' % sys.executable) | 2222 command='%s gyp-win-tool stamp $out' % sys.executable) |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2375 arglists.append( | 2379 arglists.append( |
2376 (target_list, target_dicts, data, params, config_name)) | 2380 (target_list, target_dicts, data, params, config_name)) |
2377 pool.map(CallGenerateOutputForConfig, arglists) | 2381 pool.map(CallGenerateOutputForConfig, arglists) |
2378 except KeyboardInterrupt, e: | 2382 except KeyboardInterrupt, e: |
2379 pool.terminate() | 2383 pool.terminate() |
2380 raise e | 2384 raise e |
2381 else: | 2385 else: |
2382 for config_name in config_names: | 2386 for config_name in config_names: |
2383 GenerateOutputForConfig(target_list, target_dicts, data, params, | 2387 GenerateOutputForConfig(target_list, target_dicts, data, params, |
2384 config_name) | 2388 config_name) |
OLD | NEW |