Set ANDROID_HOME in test_gradle_bench.py
This env var is required. Do it in script so that
no prior setup is needed to run this script.
Change-Id: Ieaedc6c88a82e308610cee3460a62e34400f134f
diff --git a/tools/test_gradle_benchmarks.py b/tools/test_gradle_benchmarks.py
index e843753..6720c4a 100755
--- a/tools/test_gradle_benchmarks.py
+++ b/tools/test_gradle_benchmarks.py
@@ -42,6 +42,7 @@
moduleName = ""
buildCommand = ""
cleanCommand = ""
+ env = {}
def __init__(self, displayName, benchmarkDir, moduleName, buildCommand, cleanCommand):
self.displayName = displayName
@@ -50,6 +51,9 @@
self.moduleName = moduleName
self.buildCommand = buildCommand
self.cleanCommand = cleanCommand
+ self.env = os.environ.copy()
+ self.env["ANDROID_HOME"] = os.path.join(utils.REPO_ROOT, 'third_party', 'benchmarks',
+ 'android-sdk')
def RunGradle(self, command, tool, desugarMode):
@@ -72,7 +76,7 @@
args.extend(command)
- return gradle.RunGradleWrapperInGetOutput(args, self.appPath)
+ return gradle.RunGradleWrapperInGetOutput(args, self.appPath, env=self.env)
def Build(self, tool, desugarMode):
return self.RunGradle(self.buildCommand, tool, desugarMode)