Use BUILD_NATIVE_TEST instead of BUILD_EXECUTABLE. This will generate makefiles for our tools (bench, tests, gm, dm) using the line "include $(BUILD_NATIVE_TEST)". This has been recommended by the Android team, as it builds both 32 bit and 64 bit versions of the test. Do not use LOCAL_MODULE_PATH, which is deprecated (see https://docs.google.com/a/google.com/document/d/1uLAuY7_KYGx1TSzJ9SXkyevT8qNpra2ZoIBkmCoq8VM/edit# ). Corresponds to ag/498302 , which makes this change just for bench. R=djsollen@google.com, halcanary@google.com Author: scroggo@google.com Review URL: https://codereview.chromium.org/369673002
diff --git a/platform_tools/android/bin/gyp_to_android.py b/platform_tools/android/bin/gyp_to_android.py index 0719543d..2f2b24d 100755 --- a/platform_tools/android/bin/gyp_to_android.py +++ b/platform_tools/android/bin/gyp_to_android.py
@@ -147,8 +147,7 @@ skia_lib_var_dict=common, local_module_name='skia_bench', local_module_tags=['tests'], - desired_targets=['bench'], - place_in_local_tmp=True) + desired_targets=['bench']) tool_makefile_writer.generate_tool(gyp_dir=tmp_folder, target_file='gm.gyp',
diff --git a/platform_tools/android/gyp_gen/tool_makefile_writer.py b/platform_tools/android/gyp_gen/tool_makefile_writer.py index 5579b86..451b201 100644 --- a/platform_tools/android/gyp_gen/tool_makefile_writer.py +++ b/platform_tools/android/gyp_gen/tool_makefile_writer.py
@@ -15,38 +15,30 @@ import vars_dict_lib -def write_tool_android_mk(target_dir, var_dict, place_in_local_tmp): +def write_tool_android_mk(target_dir, var_dict): """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') + + f.write('include $(BUILD_NATIVE_TEST)\n') def generate_tool(gyp_dir, target_file, skia_trunk, dest_dir, skia_lib_var_dict, local_module_name, local_module_tags, - desired_targets, - place_in_local_tmp=False): + desired_targets): """Common steps for building one of the skia tools. Parse a gyp file and create an Android.mk for this tool. @@ -64,8 +56,6 @@ local_module_name: Name for this tool, to set as LOCAL_MODULE. local_module_tags: Tags to pass to LOCAL_MODULE_TAG. desired_targets: List of targets to parse. - 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, @@ -103,5 +93,4 @@ if not os.path.exists(full_dest): os.mkdir(full_dest) - write_tool_android_mk(target_dir=full_dest, var_dict=var_dict, - place_in_local_tmp=place_in_local_tmp) + write_tool_android_mk(target_dir=full_dest, var_dict=var_dict)
diff --git a/platform_tools/android/tests/expectations/tool/Android.mk b/platform_tools/android/tests/expectations/tool/Android.mk index faac45d..0affe47 100644 --- a/platform_tools/android/tests/expectations/tool/Android.mk +++ b/platform_tools/android/tests/expectations/tool/Android.mk
@@ -38,4 +38,4 @@ local_module include external/stlport/libstlport.mk -include $(BUILD_EXECUTABLE) +include $(BUILD_NATIVE_TEST)
diff --git a/platform_tools/android/tests/makefile_writer_tests.py b/platform_tools/android/tests/makefile_writer_tests.py index 374c2dd..6b72657 100644 --- a/platform_tools/android/tests/makefile_writer_tests.py +++ b/platform_tools/android/tests/makefile_writer_tests.py
@@ -119,8 +119,7 @@ """ vars_dict = generate_dummy_vars_dict(None) tool_makefile_writer.write_tool_android_mk(target_dir=target_dir, - var_dict=vars_dict, - place_in_local_tmp=False) + var_dict=vars_dict) class MakefileWriterTest(unittest.TestCase):