Ensure that skia's test resources are properly packaged on Android
authordjsollen <djsollen@google.com>
Mon, 23 Feb 2015 20:37:32 +0000 (12:37 -0800)
committerCommit bot <commit-bot@chromium.org>
Mon, 23 Feb 2015 20:37:32 +0000 (12:37 -0800)
Review URL: https://codereview.chromium.org/949853003

platform_tools/android/gyp_gen/tool_makefile_writer.py
platform_tools/android/tests/expectations/tool/Android.mk

index 897a2b8..ac00be8 100644 (file)
@@ -14,6 +14,18 @@ import makefile_writer
 import os
 import vars_dict_lib
 
+SKIA_RESOURCES = (
+"""
+# Setup directory to store skia's resources in the directory structure that
+# the Android testing infrastructure expects
+skia_res_dir := $(call intermediates-dir-for,PACKAGING,skia_resources)/DATA
+$(shell mkdir -p $(skia_res_dir))
+$(shell cp -r $(LOCAL_PATH)/../resources/. $(skia_res_dir)/skia_resources)
+LOCAL_PICKUP_FILES := $(skia_res_dir)
+skia_res_dir :=
+
+"""
+)
 
 def write_tool_android_mk(target_dir, var_dict):
   """Write Android.mk for a Skia tool.
@@ -31,9 +43,7 @@ def write_tool_android_mk(target_dir, var_dict):
 
     makefile_writer.write_local_vars(f, var_dict, False, None)
 
-    makefile_writer.write_group(f, 'LOCAL_PICKUP_FILES',
-                                ['$(LOCAL_PATH)/../resources'], False)
-
+    f.write(SKIA_RESOURCES)
     f.write('include $(BUILD_NATIVE_TEST)\n')
 
 
index 7cb3e83..8c0389d 100644 (file)
@@ -39,7 +39,13 @@ LOCAL_MODULE_TAGS := \
 LOCAL_MODULE := \
        local_module
 
-LOCAL_PICKUP_FILES := \
-       $(LOCAL_PATH)/../resources
+
+# Setup directory to store skia's resources in the directory structure that
+# the Android testing infrastructure expects
+skia_res_dir := $(call intermediates-dir-for,PACKAGING,skia_resources)/DATA
+$(shell mkdir -p $(skia_res_dir))
+$(shell cp -r $(LOCAL_PATH)/../resources/. $(skia_res_dir)/skia_resources)
+LOCAL_PICKUP_FILES := $(skia_res_dir)
+skia_res_dir :=
 
 include $(BUILD_NATIVE_TEST)