External dependencies: throw exception if jdk ouput directory cannot be deleted

This commit is contained in:
Alexander Zolotov
2017-10-24 17:51:57 +03:00
parent 01139daf73
commit cfd6b7c14c
+5 -1
View File
@@ -56,7 +56,11 @@ task setupJdk18(dependsOn: downloadJdk18) {
def unpackJdk(jdkArchive, outputDir) {
logger.info("Unpacking $jdkArchive to ${outputDir}")
file(outputDir).deleteDir()
if (file(outputDir).exists()) {
if (!file(outputDir).deleteDir()) {
throw new Exception("unpackJdk: Unable to delete folder: $outputDir")
}
}
def currentOs = org.gradle.internal.os.OperatingSystem.current()
if (currentOs.isWindows()) {
copy {