From 107253704f19075f6765f3a53ed0534f90338ae0 Mon Sep 17 00:00:00 2001 From: kjellander Date: Tue, 12 Jan 2016 00:45:26 -0800 Subject: [PATCH] [Backport] Remove assumption on absolute paths in java_cpp_enum.py. The same issue in libyuv also affects us. Original commit message: In java_cpp_enum.py there were assumptions on 'build' being a component of the absolute path of the script invoking the script. This leads to problems when other projects are using the Chromium build toolchain (in this case libyuv), where the script invoking GYP is located in the root of the project dir (https://chromium.googlesource.com/libyuv/libyuv/+/master/gyp_libyuv). BUG=libyuv:536 Review URL: https://codereview.chromium.org/1571243003 BUG=XWALK-5749 --- build/android/gyp/java_cpp_enum.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/build/android/gyp/java_cpp_enum.py b/build/android/gyp/java_cpp_enum.py index a0c9a8fa04b19..247fbb470c4ae 100755 --- a/build/android/gyp/java_cpp_enum.py +++ b/build/android/gyp/java_cpp_enum.py @@ -229,10 +229,7 @@ def _ParseRegularLine(self, line): self._in_enum = True def GetScriptName(): - script_components = os.path.abspath(sys.argv[0]).split(os.path.sep) - build_index = script_components.index('build') - return os.sep.join(script_components[build_index:]) - + return os.path.basename(os.path.abspath(sys.argv[0])) def DoGenerate(source_paths): for source_path in source_paths: