aboutsummaryrefslogtreecommitdiffhomepage
path: root/gn/gn_to_bp.py
diff options
context:
space:
mode:
authorGravatar Leon Scroggins III <scroggo@google.com>2016-12-19 09:32:21 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-12-19 16:21:53 +0000
commit4f8a467a47c0cf98bac728b8fb80d0b8b5ff421e (patch)
treed3ab4abae16680334265cad5816e1b501ae11df1 /gn/gn_to_bp.py
parent932efed7c89c69616e283fdfef65e86b9d9da381 (diff)
Allow running gn_to_bp.py from another script
Use __file__ to determine where 'here' is. Necessary for https://chrome-internal-review.googlesource.com/313075. Change-Id: I1b9571847c761da311012039e2c885fad0a593cb Reviewed-on: https://skia-review.googlesource.com/6230 Reviewed-by: Mike Klein <mtklein@chromium.org> Reviewed-by: Ravi Mistry <rmistry@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
Diffstat (limited to 'gn/gn_to_bp.py')
-rw-r--r--gn/gn_to_bp.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/gn/gn_to_bp.py b/gn/gn_to_bp.py
index 39bac2f944..4ba5db8b18 100644
--- a/gn/gn_to_bp.py
+++ b/gn/gn_to_bp.py
@@ -12,7 +12,6 @@ import os
import pprint
import string
import subprocess
-import sys
import tempfile
# First we start off with a template for Android.bp,
@@ -159,7 +158,7 @@ def get_path_info(path, kind):
builtins = { 'get_path_info': get_path_info }
defs = {}
-here = os.path.dirname(sys.argv[0])
+here = os.path.dirname(__file__)
execfile(os.path.join(here, 'opts.gni'), builtins, defs)
execfile(os.path.join(here, 'android_framework_defines.gni'), builtins, defs)