| 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 """Code for generating Android.mk for a tool.""" | 8 """Code for generating Android.mk for a tool.""" | 
| 9 | 9 | 
| 10 | 10 | 
| (...skipping 21 matching lines...) Expand all  Loading... | 
| 32     makefile_writer.write_local_vars(f, var_dict, False, None) | 32     makefile_writer.write_local_vars(f, var_dict, False, None) | 
| 33 | 33 | 
| 34     makefile_writer.write_group(f, 'LOCAL_PICKUP_FILES', | 34     makefile_writer.write_group(f, 'LOCAL_PICKUP_FILES', | 
| 35                                 ['$(LOCAL_PATH)/../resources'], False) | 35                                 ['$(LOCAL_PATH)/../resources'], False) | 
| 36 | 36 | 
| 37     f.write('include $(BUILD_NATIVE_TEST)\n') | 37     f.write('include $(BUILD_NATIVE_TEST)\n') | 
| 38 | 38 | 
| 39 | 39 | 
| 40 def generate_tool(gyp_dir, target_file, skia_trunk, dest_dir, | 40 def generate_tool(gyp_dir, target_file, skia_trunk, dest_dir, | 
| 41                   skia_lib_var_dict, local_module_name, local_module_tags, | 41                   skia_lib_var_dict, local_module_name, local_module_tags, | 
| 42                   desired_targets): | 42                   desired_targets, gyp_source_dir=None): | 
| 43   """Common steps for building one of the skia tools. | 43   """Common steps for building one of the skia tools. | 
| 44 | 44 | 
| 45   Parse a gyp file and create an Android.mk for this tool. | 45   Parse a gyp file and create an Android.mk for this tool. | 
| 46 | 46 | 
| 47   Args: | 47   Args: | 
| 48     gyp_dir: Directory containing gyp files. | 48     gyp_dir: Directory containing gyp files. | 
| 49     target_file: gyp file for the project to be built, contained in gyp_dir. | 49     target_file: gyp file for the project to be built, contained in gyp_dir. | 
| 50     skia_trunk: Trunk of Skia, used for determining the destination to write | 50     skia_trunk: Trunk of Skia, used for determining the destination to write | 
| 51       'Android.mk'. | 51       'Android.mk'. | 
| 52     dest_dir: Destination for 'Android.mk', relative to skia_trunk. Used for | 52     dest_dir: Destination for 'Android.mk', relative to skia_trunk. Used for | 
| 53       both writing relative paths in the makefile and for determining the | 53       both writing relative paths in the makefile and for determining the | 
| 54       destination to write the it. | 54       destination to write the it. | 
| 55     skia_lib_var_dict: VarsDict representing libskia. Used as a reference to | 55     skia_lib_var_dict: VarsDict representing libskia. Used as a reference to | 
| 56       ensure we do not duplicate anything in this Android.mk. | 56       ensure we do not duplicate anything in this Android.mk. | 
| 57     local_module_name: Name for this tool, to set as LOCAL_MODULE. | 57     local_module_name: Name for this tool, to set as LOCAL_MODULE. | 
| 58     local_module_tags: Tags to pass to LOCAL_MODULE_TAG. | 58     local_module_tags: Tags to pass to LOCAL_MODULE_TAG. | 
| 59     desired_targets: List of targets to parse. | 59     desired_targets: List of targets to parse. | 
|  | 60     gyp_source_dir: Source directory for gyp. | 
| 60   """ | 61   """ | 
| 61   result_file = android_framework_gyp.main(target_dir=gyp_dir, | 62   result_file = android_framework_gyp.main(target_dir=gyp_dir, | 
| 62                                            target_file=target_file, | 63                                            target_file=target_file, | 
| 63                                            skia_arch_type='other', | 64                                            skia_arch_type='other', | 
| 64                                            have_neon=False) | 65                                            have_neon=False, | 
|  | 66                                            gyp_source_dir=gyp_source_dir) | 
| 65 | 67 | 
| 66   var_dict = vars_dict_lib.VarsDict() | 68   var_dict = vars_dict_lib.VarsDict() | 
| 67 | 69 | 
| 68   # Add known targets from skia_lib, so we do not reparse them. | 70   # Add known targets from skia_lib, so we do not reparse them. | 
| 69   var_dict.KNOWN_TARGETS.set(skia_lib_var_dict.KNOWN_TARGETS) | 71   var_dict.KNOWN_TARGETS.set(skia_lib_var_dict.KNOWN_TARGETS) | 
| 70 | 72 | 
| 71   gypd_parser.parse_gypd(var_dict, result_file, dest_dir, desired_targets) | 73   gypd_parser.parse_gypd(var_dict, result_file, dest_dir, desired_targets) | 
| 72 | 74 | 
| 73   android_framework_gyp.clean_gypd_files(gyp_dir) | 75   android_framework_gyp.clean_gypd_files(gyp_dir) | 
| 74 | 76 | 
| (...skipping 13 matching lines...) Expand all  Loading... | 
| 88     full_dest = os.path.join(skia_trunk, dest_dir) | 90     full_dest = os.path.join(skia_trunk, dest_dir) | 
| 89   else: | 91   else: | 
| 90     full_dest = dest_dir | 92     full_dest = dest_dir | 
| 91 | 93 | 
| 92   # If the path does not exist, create it. This will happen during testing, | 94   # If the path does not exist, create it. This will happen during testing, | 
| 93   # where there is no subdirectory for each tool (just a temporary folder). | 95   # where there is no subdirectory for each tool (just a temporary folder). | 
| 94   if not os.path.exists(full_dest): | 96   if not os.path.exists(full_dest): | 
| 95     os.mkdir(full_dest) | 97     os.mkdir(full_dest) | 
| 96 | 98 | 
| 97   write_tool_android_mk(target_dir=full_dest, var_dict=var_dict) | 99   write_tool_android_mk(target_dir=full_dest, var_dict=var_dict) | 
| OLD | NEW | 
|---|