Allow to specify JDK for build.

For now it disables debug option.

^KT-47940 In progress
This commit is contained in:
Yahor Berdnikau
2021-07-28 14:30:25 +02:00
committed by Space
parent 9148094bbd
commit bab5a4a6c9
@@ -23,6 +23,7 @@ import kotlin.test.assertTrue
*
* @param [projectName] test project name in 'src/test/resources/testProject` directory.
* @param [buildOptions] common Gradle build options
* @param [buildJdk] path to JDK build should run with. *Note*: providing it disables debug!
*/
fun KGPBaseTest.project(
projectName: String,
@@ -32,6 +33,7 @@ fun KGPBaseTest.project(
addHeapDumpOptions: Boolean = true,
enableGradleDebug: Boolean = false,
projectPathAdditionalSuffix: String = "",
buildJdk: String? = null,
test: TestProject.() -> Unit
): TestProject {
val projectPath = setupProjectFromTestResources(
@@ -50,6 +52,9 @@ fun KGPBaseTest.project(
.withProjectDir(projectPath.toFile())
.withTestKitDir(testKitDir.toAbsolutePath().toFile())
.withGradleVersion(gradleVersion.version)
.also {
if (buildJdk != null) it.withEnvironment(mapOf("JAVA_HOME" to buildJdk))
}
val testProject = TestProject(
gradleRunner,