Choose Gradle version for Gradle model tests as for other tests

This commit is contained in:
Alexey Tsvetkov
2018-10-26 16:20:31 +03:00
parent f2a937ed97
commit 22064fd005
@@ -285,11 +285,18 @@ abstract class BaseGradleIT {
setupWorkingDir()
}
val connection = GradleConnector.newConnector().forProjectDirectory(projectDir).connect()
val options = defaultBuildOptions()
val arguments = mutableListOf("-Pkotlin_version=${options.kotlinVersion}")
options.androidGradlePluginVersion?.let { arguments.add("-Pandroid_tools_version=$it") }
val env = createEnvironmentVariablesMap(options)
val wrapperVersion = chooseWrapperVersionOrFinishTest()
prepareWrapper(wrapperVersion, env)
val connection = GradleConnector
.newConnector()
.useGradleVersion(wrapperVersion)
.forProjectDirectory(projectDir)
.connect()
val model = connection.action(ModelFetcherBuildAction(modelType)).withArguments(arguments).setEnvironmentVariables(env).run()
connection.close()
return model