| 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 |
| 11 import android_framework_gyp | 11 import android_framework_gyp |
| 12 import gypd_parser | 12 import gypd_parser |
| 13 import makefile_writer | 13 import makefile_writer |
| 14 import os | 14 import os |
| 15 import vars_dict_lib | 15 import vars_dict_lib |
| 16 | 16 |
| 17 SKIA_RESOURCES = ( | 17 SKIA_RESOURCES = ( |
| 18 """ | 18 """ |
| 19 # Setup directory to store skia's resources in the directory structure that | 19 # Store skia's resources in the directory structure that the Android testing |
| 20 # the Android testing infrastructure expects | 20 # infrastructure expects. This requires that Skia maintain a symlinked |
| 21 skia_res_dir := $(call intermediates-dir-for,PACKAGING,skia_resources)/DATA | 21 # subdirectory in the DATA folder that points to the top level skia resources... |
| 22 $(shell mkdir -p $(skia_res_dir)) | 22 # i.e. external/skia/DATA/skia_resources --> ../resources |
| 23 $(shell cp -r $(LOCAL_PATH)/../resources/. $(skia_res_dir)/skia_resources) | 23 LOCAL_PICKUP_FILES := $(LOCAL_PATH)/../DATA |
| 24 LOCAL_PICKUP_FILES := $(skia_res_dir) | |
| 25 skia_res_dir := | |
| 26 | |
| 27 """ | 24 """ |
| 28 ) | 25 ) |
| 29 | 26 |
| 30 def write_tool_android_mk(target_dir, var_dict): | 27 def write_tool_android_mk(target_dir, var_dict): |
| 31 """Write Android.mk for a Skia tool. | 28 """Write Android.mk for a Skia tool. |
| 32 | 29 |
| 33 Args: | 30 Args: |
| 34 target_dir: Destination for the makefile. Must not be None. | 31 target_dir: Destination for the makefile. Must not be None. |
| 35 var_dict: VarsDict containing variables for the makefile. | 32 var_dict: VarsDict containing variables for the makefile. |
| 36 """ | 33 """ |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 full_dest = os.path.join(skia_trunk, dest_dir) | 97 full_dest = os.path.join(skia_trunk, dest_dir) |
| 101 else: | 98 else: |
| 102 full_dest = dest_dir | 99 full_dest = dest_dir |
| 103 | 100 |
| 104 # If the path does not exist, create it. This will happen during testing, | 101 # If the path does not exist, create it. This will happen during testing, |
| 105 # where there is no subdirectory for each tool (just a temporary folder). | 102 # where there is no subdirectory for each tool (just a temporary folder). |
| 106 if not os.path.exists(full_dest): | 103 if not os.path.exists(full_dest): |
| 107 os.mkdir(full_dest) | 104 os.mkdir(full_dest) |
| 108 | 105 |
| 109 write_tool_android_mk(target_dir=full_dest, var_dict=var_dict) | 106 write_tool_android_mk(target_dir=full_dest, var_dict=var_dict) |
| OLD | NEW |