Avoid flushing cache removed by clean

#KT-16298 fixed
This commit is contained in:
Jonathan Leitschuh
2017-04-13 12:53:50 -04:00
committed by Alexey Tsvetkov
parent 180233b78e
commit 0ed4b7f58a
@@ -120,7 +120,12 @@ internal class KotlinGradleBuildServices private constructor(gradle: Gradle): Bu
}
}
buildCacheStorage.flush(memoryCachesOnly = false)
if (workingDir.exists()) {
// The working directory may have been removed by the clean task.
// https://youtrack.jetbrains.com/issue/KT-16298
buildCacheStorage.flush(memoryCachesOnly = false)
}
buildCacheStorage.close()
gradle.removeListener(this)