Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(548)

Side by Side Diff: pylib/gyp/generator/android.py

Issue 113463003: Use gyp.common.EnsureDirExists() in more places. (Closed) Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pylib/gyp/generator/cmake.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 # Notes: 5 # Notes:
6 # 6 #
7 # This generates makefiles suitable for inclusion into the Android build system 7 # This generates makefiles suitable for inclusion into the Android build system
8 # via an Android.mk file. It is based on make.py, the standard makefile 8 # via an Android.mk file. It is based on make.py, the standard makefile
9 # generator. 9 # generator.
10 # 10 #
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 138
139 Arguments: 139 Arguments:
140 qualified_target: target we're generating 140 qualified_target: target we're generating
141 relative_target: qualified target name relative to the root 141 relative_target: qualified target name relative to the root
142 base_path: path relative to source root we're building in, used to resolve 142 base_path: path relative to source root we're building in, used to resolve
143 target-relative paths 143 target-relative paths
144 output_filename: output .mk file name to write 144 output_filename: output .mk file name to write
145 spec, configs: gyp info 145 spec, configs: gyp info
146 part_of_all: flag indicating this target is part of 'all' 146 part_of_all: flag indicating this target is part of 'all'
147 """ 147 """
148 make.ensure_directory_exists(output_filename) 148 gyp.common.EnsureDirExists(output_filename)
149 149
150 self.fp = open(output_filename, 'w') 150 self.fp = open(output_filename, 'w')
151 151
152 self.fp.write(header) 152 self.fp.write(header)
153 153
154 self.qualified_target = qualified_target 154 self.qualified_target = qualified_target
155 self.relative_target = relative_target 155 self.relative_target = relative_target
156 self.path = base_path 156 self.path = base_path
157 self.target = spec['target_name'] 157 self.target = spec['target_name']
158 self.type = spec['type'] 158 self.type = spec['type']
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after
976 default_configuration = spec['default_configuration'] 976 default_configuration = spec['default_configuration']
977 break 977 break
978 if not default_configuration: 978 if not default_configuration:
979 default_configuration = 'Default' 979 default_configuration = 'Default'
980 980
981 srcdir = '.' 981 srcdir = '.'
982 makefile_name = 'GypAndroid' + options.suffix + '.mk' 982 makefile_name = 'GypAndroid' + options.suffix + '.mk'
983 makefile_path = os.path.join(options.toplevel_dir, makefile_name) 983 makefile_path = os.path.join(options.toplevel_dir, makefile_name)
984 assert not options.generator_output, ( 984 assert not options.generator_output, (
985 'The Android backend does not support options.generator_output.') 985 'The Android backend does not support options.generator_output.')
986 make.ensure_directory_exists(makefile_path) 986 gyp.common.EnsureDirExists(makefile_path)
987 root_makefile = open(makefile_path, 'w') 987 root_makefile = open(makefile_path, 'w')
988 988
989 root_makefile.write(header) 989 root_makefile.write(header)
990 990
991 # We set LOCAL_PATH just once, here, to the top of the project tree. This 991 # We set LOCAL_PATH just once, here, to the top of the project tree. This
992 # allows all the other paths we use to be relative to the Android.mk file, 992 # allows all the other paths we use to be relative to the Android.mk file,
993 # as the Android build system expects. 993 # as the Android build system expects.
994 root_makefile.write('\nLOCAL_PATH := $(call my-dir)\n') 994 root_makefile.write('\nLOCAL_PATH := $(call my-dir)\n')
995 995
996 # Find the list of targets that derive from the gyp file(s) being built. 996 # Find the list of targets that derive from the gyp file(s) being built.
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
1060 1060
1061 # Write out the sorted list of includes. 1061 # Write out the sorted list of includes.
1062 root_makefile.write('\n') 1062 root_makefile.write('\n')
1063 for include_file in sorted(include_list): 1063 for include_file in sorted(include_list):
1064 root_makefile.write('include $(LOCAL_PATH)/' + include_file + '\n') 1064 root_makefile.write('include $(LOCAL_PATH)/' + include_file + '\n')
1065 root_makefile.write('\n') 1065 root_makefile.write('\n')
1066 1066
1067 root_makefile.write(SHARED_FOOTER) 1067 root_makefile.write(SHARED_FOOTER)
1068 1068
1069 root_makefile.close() 1069 root_makefile.close()
OLDNEW
« no previous file with comments | « no previous file | pylib/gyp/generator/cmake.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698