Explicitly include gyp_gen/android_framework_gyp.
authorcommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Tue, 29 Apr 2014 00:39:45 +0000 (00:39 +0000)
committercommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Tue, 29 Apr 2014 00:39:45 +0000 (00:39 +0000)
Add __init__.py to gyp_gen and explicitly include android_framework_gyp
from there.

Fixes a bug where after moving that file, python was looking for it in
its old location, where there was a compiled version of the file.

BUG=skia:2468
R=epoger@google.com

Author: scroggo@google.com

Review URL: https://codereview.chromium.org/251903003

git-svn-id: http://skia.googlecode.com/svn/trunk@14427 2bbb7eff-a529-9590-31e7-b0007b416f81

platform_tools/android/bin/gyp_to_android.py
platform_tools/android/gyp_gen/__init__.py [new file with mode: 0644]
platform_tools/android/tests/android_framework_gyp_tests.py

index f43d597..e885399 100755 (executable)
@@ -21,15 +21,15 @@ SKIA_DIR = os.path.normpath(os.path.join(SCRIPT_DIR, os.pardir, os.pardir,
                                          os.pardir))
 
 # Find the directory with our helper files, and add it to the path.
-GYP_GEN_DIR = os.path.join(SKIA_DIR, 'platform_tools', 'android', 'gyp_gen')
-sys.path.append(GYP_GEN_DIR)
-
-import android_framework_gyp
-import gypd_parser
-import generate_user_config
-import makefile_writer
-import tool_makefile_writer
-import vars_dict_lib
+ANDROID_TOOLS = os.path.join(SKIA_DIR, 'platform_tools', 'android')
+sys.path.append(ANDROID_TOOLS)
+
+import gyp_gen.android_framework_gyp as android_framework_gyp
+import gyp_gen.gypd_parser as gypd_parser
+import gyp_gen.generate_user_config as generate_user_config
+import gyp_gen.makefile_writer as makefile_writer
+import gyp_gen.tool_makefile_writer as tool_makefile_writer
+import gyp_gen.vars_dict_lib as vars_dict_lib
 
 # Folder containing all gyp files and generated gypd files.
 GYP_FOLDER = 'gyp'
diff --git a/platform_tools/android/gyp_gen/__init__.py b/platform_tools/android/gyp_gen/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
index 0b52c6b..085123f 100644 (file)
@@ -16,10 +16,9 @@ import tempfile
 import test_variables
 import unittest
 
-# Path to android_framework_gyp
-sys.path.append(test_variables.GYP_GEN_DIR)
+sys.path.append(test_variables.ANDROID_DIR)
 
-import android_framework_gyp
+import gyp_gen.android_framework_gyp
 
 GYPD_SUFFIX = ".gypd"
 GYP_SUFFIX = ".gyp"
@@ -61,7 +60,7 @@ class CleanGypdTest(unittest.TestCase):
   def test_clean(self):
     """Test that clean_gypd_files() deletes .gypd files, and leaves others.
     """
-    android_framework_gyp.clean_gypd_files(self.__tmp_dir)
+    gyp_gen.android_framework_gyp.clean_gypd_files(self.__tmp_dir)
     for i in range(self.__num_files):
       self.assert_file_exists('%s%s' % (str(i), GYPI_SUFFIX))
       self.assert_file_exists('%s%s' % (str(i), GYP_SUFFIX))