Index: platform_tools/android/gyp_gen/tool_makefile_writer.py |
diff --git a/platform_tools/android/gyp_gen/tool_makefile_writer.py b/platform_tools/android/gyp_gen/tool_makefile_writer.py |
index bdcd8846b7072fd0a58f00a6cb4296a8bccdc6c1..ac2a75857e7cac4aa75d311bc0736311c7bf0713 100644 |
--- a/platform_tools/android/gyp_gen/tool_makefile_writer.py |
+++ b/platform_tools/android/gyp_gen/tool_makefile_writer.py |
@@ -15,27 +15,37 @@ import os |
import vars_dict_lib |
-def write_tool_android_mk(target_dir, var_dict): |
+def write_tool_android_mk(target_dir, var_dict, place_in_local_tmp): |
"""Write Android.mk for a Skia tool. |
Args: |
target_dir: Destination for the makefile. Must not be None. |
var_dict: VarsDict containing variables for the makefile. |
+ place_in_local_tmp: If True, the executable will be synced to |
+ /data/local/tmp. |
""" |
target_file = os.path.join(target_dir, 'Android.mk') |
with open(target_file, 'w') as f: |
f.write(makefile_writer.AUTOGEN_WARNING) |
+ |
+ if place_in_local_tmp: |
+ f.write('local_target_dir := $(TARGET_OUT_DATA)/local/tmp\n') |
+ |
makefile_writer.write_local_path(f) |
makefile_writer.write_clear_vars(f) |
makefile_writer.write_local_vars(f, var_dict, False, None) |
+ if place_in_local_tmp: |
+ f.write('LOCAL_MODULE_PATH := $(local_target_dir)\n') |
+ |
makefile_writer.write_include_stlport(f) |
f.write('include $(BUILD_EXECUTABLE)\n') |
def generate_tool(gyp_dir, target_file, skia_trunk, dest_dir, |
- skia_lib_var_dict, local_module_name, local_module_tags): |
+ skia_lib_var_dict, local_module_name, local_module_tags, |
+ place_in_local_tmp=False): |
"""Common steps for building one of the skia tools. |
Parse a gyp file and create an Android.mk for this tool. |
@@ -52,6 +62,8 @@ def generate_tool(gyp_dir, target_file, skia_trunk, dest_dir, |
ensure we do not duplicate anything in this Android.mk. |
local_module_name: Name for this tool, to set as LOCAL_MODULE. |
local_module_tags: Tags to pass to LOCAL_MODULE_TAG. |
+ place_in_local_tmp: If True, the executable will be synced to |
+ /data/local/tmp. |
""" |
result_file = android_framework_gyp.main(target_dir=gyp_dir, |
target_file=target_file, |
@@ -89,4 +101,5 @@ def generate_tool(gyp_dir, target_file, skia_trunk, dest_dir, |
if not os.path.exists(full_dest): |
os.mkdir(full_dest) |
- write_tool_android_mk(target_dir=full_dest, var_dict=var_dict) |
+ write_tool_android_mk(target_dir=full_dest, var_dict=var_dict, |
+ place_in_local_tmp=place_in_local_tmp) |