mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Set ANDROID_HOME in run_gradle.py (flutter/engine#27371)
This commit is contained in:
parent
233a06b114
commit
b15aea39f1
@ -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
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user