Ensure task build directory always exist
#KT-14253 fixed
This commit is contained in:
+1
-1
@@ -74,7 +74,7 @@ class Kapt2IT: BaseGradleIT() {
|
|||||||
val project = Project("simple", GRADLE_VERSION, directoryPrefix = "kapt2")
|
val project = Project("simple", GRADLE_VERSION, directoryPrefix = "kapt2")
|
||||||
val classesDir = File(project.projectDir, "build/classes")
|
val classesDir = File(project.projectDir, "build/classes")
|
||||||
|
|
||||||
project.build("build", options = options) {
|
project.build("clean", "build", options = options) {
|
||||||
assertSuccessful()
|
assertSuccessful()
|
||||||
assertKaptSuccessful()
|
assertKaptSuccessful()
|
||||||
assertContains(":compileKotlin")
|
assertContains(":compileKotlin")
|
||||||
|
|||||||
+2
-2
@@ -120,8 +120,8 @@ open class KotlinCompile : AbstractKotlinCompile<K2JVMCompilerArguments>(), Kotl
|
|||||||
|
|
||||||
private val sourceRoots = HashSet<File>()
|
private val sourceRoots = HashSet<File>()
|
||||||
|
|
||||||
// lazy because name is probably not available when constructor is called
|
internal val taskBuildDirectory: File
|
||||||
internal val taskBuildDirectory: File by lazy { File(File(project.buildDir, KOTLIN_BUILD_DIR_NAME), name).apply { mkdirs() } }
|
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 cacheDirectory: File by lazy { File(taskBuildDirectory, CACHES_DIR_NAME) }
|
||||||
private val dirtySourcesSinceLastTimeFile: File by lazy { File(taskBuildDirectory, DIRTY_SOURCES_FILE_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) }
|
private val lastBuildInfoFile: File by lazy { File(taskBuildDirectory, LAST_BUILD_INFO_FILE_NAME) }
|
||||||
|
|||||||
Reference in New Issue
Block a user