Index: platform_tools/android/gyp_gen/android_framework_gyp.py |
diff --git a/platform_tools/android/bin/android_framework_gyp.py b/platform_tools/android/gyp_gen/android_framework_gyp.py |
similarity index 74% |
rename from platform_tools/android/bin/android_framework_gyp.py |
rename to platform_tools/android/gyp_gen/android_framework_gyp.py |
index 5d5befc0846594f58555e0791e4e7db3a0dd3e7a..67d391a8831f350829f35ed34738e471097f7537 100644 |
--- a/platform_tools/android/bin/android_framework_gyp.py |
+++ b/platform_tools/android/gyp_gen/android_framework_gyp.py |
@@ -16,7 +16,7 @@ SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__)) |
# Unlike gyp_skia, this file is nested deep inside Skia. Find Skia's trunk dir. |
# This line depends on the fact that the script is three levels deep |
-# (specifically, it is in platform_tools/android/bin). |
+# (specifically, it is in platform_tools/android/gyp_gen). |
SKIA_DIR = os.path.normpath(os.path.join(SCRIPT_DIR, os.pardir, os.pardir, |
os.pardir)) |
DIR_CONTENTS = os.listdir(SKIA_DIR) |
@@ -40,15 +40,18 @@ sys.path.insert(0, os.path.join(GYP_SOURCE_DIR, 'pylib')) |
import gyp |
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'. |
- @return path Path to root gypd file created by running gyp. |
+ """Create gypd files based on target_file. |
+ |
+ Args: |
+ target_dir: Directory containing all gyp files, including common.gypi |
+ target_file: Gyp file to start on. Other files within target_dir will |
+ be read if target_file depends on them. |
+ skia_arch_type: Target architecture to pass to gyp. |
+ have_neon: Whether to generate files including neon optimizations. |
+ Only meaningful if skia_arch_type is 'arm'. |
+ |
+ Returns: |
+ path: Path to root gypd file created by running gyp. |
""" |
# Set GYP_DEFINES for building for the android framework. |
gyp_defines = ('skia_android_framework=1 OS=android skia_arch_type=%s ' |
@@ -85,3 +88,16 @@ def main(target_dir, target_file, skia_arch_type, have_neon): |
raise Exception("gyp failed to produce gypd file!") |
return gypd_file |
+ |
+ |
+def clean_gypd_files(folder): |
+ """Remove the gypd files generated by main(). |
+ |
+ Args: |
+ folder: Folder in which to delete all files ending with 'gypd'. |
+ """ |
+ assert os.path.isdir(folder) |
+ files = os.listdir(folder) |
+ for f in files: |
+ if f.endswith('gypd'): |
+ os.remove(os.path.join(folder, f)) |