Allow to specify JDK for build.
For now it disables debug option. ^KT-47940 In progress
This commit is contained in:
+5
@@ -23,6 +23,7 @@ import kotlin.test.assertTrue
|
|||||||
*
|
*
|
||||||
* @param [projectName] test project name in 'src/test/resources/testProject` directory.
|
* @param [projectName] test project name in 'src/test/resources/testProject` directory.
|
||||||
* @param [buildOptions] common Gradle build options
|
* @param [buildOptions] common Gradle build options
|
||||||
|
* @param [buildJdk] path to JDK build should run with. *Note*: providing it disables debug!
|
||||||
*/
|
*/
|
||||||
fun KGPBaseTest.project(
|
fun KGPBaseTest.project(
|
||||||
projectName: String,
|
projectName: String,
|
||||||
@@ -32,6 +33,7 @@ fun KGPBaseTest.project(
|
|||||||
addHeapDumpOptions: Boolean = true,
|
addHeapDumpOptions: Boolean = true,
|
||||||
enableGradleDebug: Boolean = false,
|
enableGradleDebug: Boolean = false,
|
||||||
projectPathAdditionalSuffix: String = "",
|
projectPathAdditionalSuffix: String = "",
|
||||||
|
buildJdk: String? = null,
|
||||||
test: TestProject.() -> Unit
|
test: TestProject.() -> Unit
|
||||||
): TestProject {
|
): TestProject {
|
||||||
val projectPath = setupProjectFromTestResources(
|
val projectPath = setupProjectFromTestResources(
|
||||||
@@ -50,6 +52,9 @@ fun KGPBaseTest.project(
|
|||||||
.withProjectDir(projectPath.toFile())
|
.withProjectDir(projectPath.toFile())
|
||||||
.withTestKitDir(testKitDir.toAbsolutePath().toFile())
|
.withTestKitDir(testKitDir.toAbsolutePath().toFile())
|
||||||
.withGradleVersion(gradleVersion.version)
|
.withGradleVersion(gradleVersion.version)
|
||||||
|
.also {
|
||||||
|
if (buildJdk != null) it.withEnvironment(mapOf("JAVA_HOME" to buildJdk))
|
||||||
|
}
|
||||||
|
|
||||||
val testProject = TestProject(
|
val testProject = TestProject(
|
||||||
gradleRunner,
|
gradleRunner,
|
||||||
|
|||||||
Reference in New Issue
Block a user