aboutsummaryrefslogtreecommitdiffhomepage
path: root/platform_tools/android
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-05-16 13:15:41 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-05-16 13:15:41 +0000
commit61744ec1d2b0e287a652a419dac285c6a803e270 (patch)
treeacc84ed655a85ad418a877fccfb2807add466c00 /platform_tools/android
parent69031a44273ccb7656df88c6bcb7b62f4d2731bb (diff)
Generate bench/Android.mk from gyp.
For now, remove json functionality and do not depend on json. This allows us to build and run until solving skbug.com/2448. bench/DeferredSurfaceCopyBench.cpp: Include GrRenderTarget last, so SK_SUPPORT_GPU will be set properly. bench/ResultsWriter.h: bench/benchmain.cpp: Remove JSONResultsWriter when SK_BUILD_JSON_WRITER is not defined, which is the case for the Android framework build. gyp/bench.gyp: Depend on skia and cutils (for android_atomic_inc etc). gyp/common_conditions.gypi: Define SK_BUILD_JSON_WRITER when skia_build_json_writer is set. gyp/common_variables.gypi: Add a flag for skia_build_json_writer, and set it only when skia_android_framework is not set. gyp/jsoncpp.gyp: Do not build jsoncpp when skia_build_json_writer is not defined. include/utils/SkJSONCPP.h: Do not include json headers when SK_BUILD_JSON_WRITER is not defined. platform_tools/android/bin/gyp_to_android.py: Generate bench/Android.mk. platform_tools/android/gyp_gen/gypd_parser.py: Skip dest_dir when checking for include_dirs. platform_tools/android/gyp_gen/makefile_writer.py: Build bench/Android.mk when building external/skia. platform_tools/android/gyp_gen/tool_makefile_writer.py: Add a parameter for putting the binary into /data/local/tmp. BUG=skia:2447 BUG=skia:2448 R=halcanary@google.com, reed@google.com Author: scroggo@google.com Review URL: https://codereview.chromium.org/282053002 git-svn-id: http://skia.googlecode.com/svn/trunk@14760 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'platform_tools/android')
-rwxr-xr-xplatform_tools/android/bin/gyp_to_android.py16
-rw-r--r--platform_tools/android/gyp_gen/gypd_parser.py3
-rw-r--r--platform_tools/android/gyp_gen/makefile_writer.py2
-rw-r--r--platform_tools/android/gyp_gen/tool_makefile_writer.py19
4 files changed, 28 insertions, 12 deletions
diff --git a/platform_tools/android/bin/gyp_to_android.py b/platform_tools/android/bin/gyp_to_android.py
index e885399644..8994efdf05 100755
--- a/platform_tools/android/bin/gyp_to_android.py
+++ b/platform_tools/android/bin/gyp_to_android.py
@@ -135,14 +135,14 @@ def main(target_dir=None, require_sk_user_config=False):
local_module_name='skia_test',
local_module_tags=['eng', 'tests'])
- # TODO (scroggo): Generate bench/Android.mk. See skbug.com/2448
- #tool_makefile_writer.generate_tool(gyp_dir=tmp_folder,
- # target_file='bench.gyp',
- # skia_trunk=target_dir,
- # dest_dir='bench',
- # skia_lib_var_dict=common,
- # local_module_name='skia_bench',
- # local_module_tags=['tests'])
+ tool_makefile_writer.generate_tool(gyp_dir=tmp_folder,
+ target_file='bench.gyp',
+ skia_trunk=target_dir,
+ dest_dir='bench',
+ skia_lib_var_dict=common,
+ local_module_name='skia_bench',
+ local_module_tags=['tests'],
+ place_in_local_tmp=True)
# Now that the defines have been written to SkUserConfig and they've been
# used to skip adding them to the tools makefiles, they are not needed in
diff --git a/platform_tools/android/gyp_gen/gypd_parser.py b/platform_tools/android/gyp_gen/gypd_parser.py
index b0e1417046..e992637637 100644
--- a/platform_tools/android/gyp_gen/gypd_parser.py
+++ b/platform_tools/android/gyp_gen/gypd_parser.py
@@ -97,6 +97,9 @@ def parse_dictionary(var_dict, d, current_target_name, dest_dir):
# wants relative to dest_dir.
rel_include = os.path.relpath(include, os.pardir)
rel_include = os.path.relpath(rel_include, dest_dir)
+ # No need to include the base directory.
+ if rel_include is os.curdir:
+ continue
rel_include = os.path.join('$(LOCAL_PATH)', rel_include)
# Remove a trailing slash, if present.
diff --git a/platform_tools/android/gyp_gen/makefile_writer.py b/platform_tools/android/gyp_gen/makefile_writer.py
index 212979925c..1c927601df 100644
--- a/platform_tools/android/gyp_gen/makefile_writer.py
+++ b/platform_tools/android/gyp_gen/makefile_writer.py
@@ -117,7 +117,7 @@ SKIA_TOOLS = (
#
# benchmark (timings)
-#include $(BASE_PATH)/bench/Android.mk
+include $(BASE_PATH)/bench/Android.mk
# golden-master (fidelity / regression test)
#include $(BASE_PATH)/gm/Android.mk
diff --git a/platform_tools/android/gyp_gen/tool_makefile_writer.py b/platform_tools/android/gyp_gen/tool_makefile_writer.py
index bdcd8846b7..ac2a75857e 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)