Add a test for project.buildDir lazy evaluation
(cherry picked from commit ab0f9cd)
This commit is contained in:
+20
@@ -1,6 +1,7 @@
|
||||
package org.jetbrains.kotlin.gradle
|
||||
|
||||
import org.jetbrains.kotlin.gradle.util.checkBytecodeContains
|
||||
import org.jetbrains.kotlin.gradle.util.modify
|
||||
import org.junit.Test
|
||||
import java.io.File
|
||||
import kotlin.test.assertTrue
|
||||
@@ -170,4 +171,23 @@ class SimpleKotlinGradleIT : BaseGradleIT() {
|
||||
assertSuccessful()
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testBuildDirLazyEvaluation() {
|
||||
val project = Project("kotlinProject", GRADLE_VERSION)
|
||||
project.setupWorkingDir()
|
||||
|
||||
File(project.projectDir, "build").writeText("This file prevents Gradle from using 'build' as a directory")
|
||||
|
||||
// Change the build directory in the end of the build script:
|
||||
val customBuildDirName = "customBuild"
|
||||
File(project.projectDir, "build.gradle").modify {
|
||||
it + "\nbuildDir = '$customBuildDirName'\n"
|
||||
}
|
||||
|
||||
project.build("build") {
|
||||
assertSuccessful()
|
||||
assertFileExists("$customBuildDirName/classes")
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user