Set JAVA and ANDROID_HOME when fetching Gradle models

In BaseGradleIT
This commit is contained in:
Lucas Smaira
2018-07-27 17:16:28 +01:00
committed by Sergey Igushkin
parent 8cb03fcdec
commit 52990c9eb1
@@ -286,7 +286,8 @@ abstract class BaseGradleIT {
val options = defaultBuildOptions()
val arguments = mutableListOf("-Pkotlin_version=${options.kotlinVersion}")
options.androidGradlePluginVersion?.let { arguments.add("-Pandroid_tools_version=$it") }
val model = connection.action(ModelFetcherBuildAction(modelType)).withArguments(arguments).run()
val env = createEnvironmentVariablesMap(options)
val model = connection.action(ModelFetcherBuildAction(modelType)).withArguments(arguments).setEnvironmentVariables(env).run()
connection.close()
return model
}