OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
3 # Copyright 2014 Google Inc. | 3 # Copyright 2014 Google Inc. |
4 # | 4 # |
5 # Use of this source code is governed by a BSD-style license that can be | 5 # Use of this source code is governed by a BSD-style license that can be |
6 # found in the LICENSE file. | 6 # found in the LICENSE file. |
7 | 7 |
8 """ | 8 """ |
9 Functions for creating an Android.mk from already created dictionaries. | 9 Functions for creating an Android.mk from already created dictionaries. |
10 """ | 10 """ |
11 | 11 |
12 import os | 12 import os |
13 | 13 |
14 # TODO(scroggo): Add unit tests for this file. | |
15 def write_group(f, name, items, append): | 14 def write_group(f, name, items, append): |
16 """ | 15 """ |
17 Helper function to list all names passed to a variable. | 16 Helper function to list all names passed to a variable. |
18 @param f File open for writing (Android.mk) | 17 @param f File open for writing (Android.mk) |
19 @param name Name of the makefile variable (e.g. LOCAL_CFLAGS) | 18 @param name Name of the makefile variable (e.g. LOCAL_CFLAGS) |
20 @param items list of strings to be passed to the variable. | 19 @param items list of strings to be passed to the variable. |
21 @param append Whether to append to the variable or overwrite it. | 20 @param append Whether to append to the variable or overwrite it. |
22 """ | 21 """ |
23 if not items: | 22 if not items: |
24 return | 23 return |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 f.write('ifeq ($(%s), true)\n' % data.condition) | 193 f.write('ifeq ($(%s), true)\n' % data.condition) |
195 write_local_vars(f, data.vars_dict, True, data.name) | 194 write_local_vars(f, data.vars_dict, True, data.name) |
196 if data.condition: | 195 if data.condition: |
197 f.write('endif\n\n') | 196 f.write('endif\n\n') |
198 | 197 |
199 f.write('include external/stlport/libstlport.mk\n') | 198 f.write('include external/stlport/libstlport.mk\n') |
200 f.write('LOCAL_MODULE:= libskia\n') | 199 f.write('LOCAL_MODULE:= libskia\n') |
201 f.write('include $(BUILD_SHARED_LIBRARY)\n') | 200 f.write('include $(BUILD_SHARED_LIBRARY)\n') |
202 f.write(SKIA_TOOLS) | 201 f.write(SKIA_TOOLS) |
203 | 202 |
OLD | NEW |