Chromium Code Reviews| Index: platform_tools/android/bin/android_framework_gyp.py |
| diff --git a/platform_tools/android/bin/android_framework_gyp.py b/platform_tools/android/bin/android_framework_gyp.py |
| index ac1d598efa67265dd0de77edec6951c517d9d6ac..a8bf1a773266687f273d4a1c619fa3b0c61842bb 100644 |
| --- a/platform_tools/android/bin/android_framework_gyp.py |
| +++ b/platform_tools/android/bin/android_framework_gyp.py |
| @@ -12,29 +12,35 @@ Modified version of gyp_skia, used by gyp_to_android.py to generate Android.mk |
| import os |
| import sys |
| -script_dir = os.path.dirname(__file__) |
| +SCRIPT_DIR = os.path.join(os.getcwd(), os.path.dirname(__file__)) |
|
epoger
2014/01/22 21:35:03
I think this would be clearer, and functionally eq
scroggo
2014/01/22 23:33:08
Done.
|
| # Unlike gyp_skia, this file is nested deep inside Skia. Move to Skia trunk. |
| # This line depends on the fact that the script is three levels deep |
| # (specifically, it is in platform_tools/android/bin). |
| -skia_dir = os.path.normpath(os.path.join(script_dir, os.pardir, os.pardir, |
| +SKIA_DIR = os.path.normpath(os.path.join(SCRIPT_DIR, os.pardir, os.pardir, |
| os.pardir)) |
| -dir_contents = os.listdir(skia_dir) |
| +dir_contents = os.listdir(SKIA_DIR) |
| assert 'third_party' in dir_contents and 'gyp' in dir_contents |
| # Directory within which we can find the gyp source. |
| -gyp_source_dir = os.path.join(skia_dir, 'third_party', 'externals', 'gyp') |
| - |
| -# Directory within which we can find most of Skia's gyp configuration files. |
| -gyp_config_dir = os.path.join(skia_dir, 'gyp') |
| +GYP_SOURCE_DIR = os.path.join(SKIA_DIR, 'third_party', 'externals', 'gyp') |
| # Ensure we import our current gyp source's module, not any version |
| # pre-installed in your PYTHONPATH. |
| -sys.path.insert(0, os.path.join(gyp_source_dir, 'pylib')) |
| +sys.path.insert(0, os.path.join(GYP_SOURCE_DIR, 'pylib')) |
| import gyp |
| -def main(skia_arch_type, have_neon): |
| +def main(target_dir, target_file, skia_arch_type, have_neon): |
| + """ |
| + Create gypd files based on target_file. |
| + @param target_dir Directory containing all gyp files, including common.gypi |
| + @param target_file Gyp file to start on. Other files within target_dir will |
| + be read if target_file depends on them. |
| + @param skia_arch_type Target architecture to pass to gyp. |
| + @param have_neon Whether to generate files including neon optimizations. |
| + Only meaningful if skia_arch_type is 'arm'. |
| + """ |
| # Set GYP_DEFINES for building for the android framework. |
| gyp_defines = ('skia_android_framework=1 OS=android skia_arch_type=%s ' |
| % skia_arch_type) |
| @@ -50,10 +56,9 @@ def main(skia_arch_type, have_neon): |
| args = [] |
| args.extend(['--depth', '.']) |
| - # Use the android_framework_lib file instead of skia.gyp |
| - args.extend([os.path.join(gyp_config_dir, 'android_framework_lib.gyp')]) |
| + args.extend([os.path.join(target_dir, target_file)]) |
| # Common conditions |
| - args.extend(['-I', 'gyp/common.gypi']) |
| + args.extend(['-I', os.path.join(target_dir, 'common.gypi')]) |
| # Use the debugging format. We'll use these to create one master make file. |
| args.extend(['-f', 'gypd']) |