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 from compiler.ast import Const | 5 from compiler.ast import Const |
6 from compiler.ast import Dict | 6 from compiler.ast import Dict |
7 from compiler.ast import Discard | 7 from compiler.ast import Discard |
8 from compiler.ast import List | 8 from compiler.ast import List |
9 from compiler.ast import Module | 9 from compiler.ast import Module |
10 from compiler.ast import Node | 10 from compiler.ast import Node |
(...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
815 if not generator_filelist_paths: | 815 if not generator_filelist_paths: |
816 path = os.path.join(build_file_dir, replacement) | 816 path = os.path.join(build_file_dir, replacement) |
817 else: | 817 else: |
818 if os.path.isabs(build_file_dir): | 818 if os.path.isabs(build_file_dir): |
819 toplevel = generator_filelist_paths['toplevel'] | 819 toplevel = generator_filelist_paths['toplevel'] |
820 rel_build_file_dir = gyp.common.RelativePath(build_file_dir, toplevel) | 820 rel_build_file_dir = gyp.common.RelativePath(build_file_dir, toplevel) |
821 else: | 821 else: |
822 rel_build_file_dir = build_file_dir | 822 rel_build_file_dir = build_file_dir |
823 qualified_out_dir = generator_filelist_paths['qualified_out_dir'] | 823 qualified_out_dir = generator_filelist_paths['qualified_out_dir'] |
824 path = os.path.join(qualified_out_dir, rel_build_file_dir, replacement) | 824 path = os.path.join(qualified_out_dir, rel_build_file_dir, replacement) |
825 if not os.path.isdir(os.path.dirname(path)): | 825 gyp.common.EnsureDirExists(path) |
826 os.makedirs(os.path.dirname(path)) | |
827 | 826 |
828 replacement = gyp.common.RelativePath(path, build_file_dir) | 827 replacement = gyp.common.RelativePath(path, build_file_dir) |
829 f = gyp.common.WriteOnDiff(path) | 828 f = gyp.common.WriteOnDiff(path) |
830 for i in contents_list[1:]: | 829 for i in contents_list[1:]: |
831 f.write('%s\n' % i) | 830 f.write('%s\n' % i) |
832 f.close() | 831 f.close() |
833 | 832 |
834 elif run_command: | 833 elif run_command: |
835 use_shell = True | 834 use_shell = True |
836 if match['is_array']: | 835 if match['is_array']: |
(...skipping 1964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2801 ValidateRunAsInTarget(target, target_dict, build_file) | 2800 ValidateRunAsInTarget(target, target_dict, build_file) |
2802 ValidateActionsInTarget(target, target_dict, build_file) | 2801 ValidateActionsInTarget(target, target_dict, build_file) |
2803 | 2802 |
2804 # Generators might not expect ints. Turn them into strs. | 2803 # Generators might not expect ints. Turn them into strs. |
2805 TurnIntIntoStrInDict(data) | 2804 TurnIntIntoStrInDict(data) |
2806 | 2805 |
2807 # TODO(mark): Return |data| for now because the generator needs a list of | 2806 # TODO(mark): Return |data| for now because the generator needs a list of |
2808 # build files that came in. In the future, maybe it should just accept | 2807 # build files that came in. In the future, maybe it should just accept |
2809 # a list, and not the whole data dict. | 2808 # a list, and not the whole data dict. |
2810 return [flat_list, targets, data] | 2809 return [flat_list, targets, data] |
OLD | NEW |