Ensure task build directory always exist

#KT-14253 fixed
This commit is contained in:
Alexey Tsvetkov
2016-10-14 17:09:47 +03:00
parent d79679e647
commit 01e0bc8d5e
2 changed files with 3 additions and 3 deletions
@@ -74,7 +74,7 @@ class Kapt2IT: BaseGradleIT() {
val project = Project("simple", GRADLE_VERSION, directoryPrefix = "kapt2")
val classesDir = File(project.projectDir, "build/classes")
project.build("build", options = options) {
project.build("clean", "build", options = options) {
assertSuccessful()
assertKaptSuccessful()
assertContains(":compileKotlin")
@@ -120,8 +120,8 @@ open class KotlinCompile : AbstractKotlinCompile<K2JVMCompilerArguments>(), Kotl
private val sourceRoots = HashSet<File>()
// lazy because name is probably not available when constructor is called
internal val taskBuildDirectory: File by lazy { File(File(project.buildDir, KOTLIN_BUILD_DIR_NAME), name).apply { mkdirs() } }
internal val taskBuildDirectory: File
get() = File(File(project.buildDir, KOTLIN_BUILD_DIR_NAME), name).apply { mkdirs() }
private val cacheDirectory: File by lazy { File(taskBuildDirectory, CACHES_DIR_NAME) }
private val dirtySourcesSinceLastTimeFile: File by lazy { File(taskBuildDirectory, DIRTY_SOURCES_FILE_NAME) }
private val lastBuildInfoFile: File by lazy { File(taskBuildDirectory, LAST_BUILD_INFO_FILE_NAME) }