未验证 提交 e4dc3c67 编写于 作者: D Dan Field 提交者: GitHub

Set ANDROID_HOME in run_gradle.py (#27371)

上级 0ae9b106
......@@ -11,13 +11,21 @@ import os
import sys
import subprocess
SCRIPT_PATH = os.path.dirname(os.path.realpath(__file__))
ANDROID_HOME = os.path.join(SCRIPT_PATH, '..', '..', '..', '..', 'third_party',
'android_tools', 'sdk')
def main():
if not os.path.isdir(ANDROID_HOME):
raise Exception('%s (ANDROID_HOME) is not a directory' % ANDROID_HOME)
BAT = '.bat' if sys.platform.startswith(('cygwin', 'win')) else ''
android_dir = os.path.abspath(os.path.dirname(__file__))
gradle_bin = os.path.join('.', 'gradlew%s' % BAT)
result = subprocess.check_output(
args=[gradle_bin] + sys.argv[1:],
cwd=android_dir,
env=dict(os.environ, ANDROID_HOME=ANDROID_HOME),
)
return 0
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册