Create destination dir if it does not exist (#1438)

Otherwise DownloadAction might assume,
that the destination is actually a file,
when just one file is requested
(which is true for some POM only compose modules)
This commit is contained in:
Alexey Tsvetkov
2021-11-22 15:11:09 +03:00
committed by GitHub
parent 974ef56832
commit 8eeb0db771
2 changed files with 7 additions and 2 deletions

View File

@@ -45,7 +45,10 @@ abstract class DownloadFromSpaceMavenRepoTask : DefaultTask() {
}
val destinationDir = module.localDir
if (destinationDir.exists()) {
if (destinationDir.isFile)
error("Destination dir is a file: $destinationDir")
else if (destinationDir.exists()) {
if (module.version.endsWith("-SNAPSHOT")) {
destinationDir.deleteRecursively()
} else {
@@ -65,6 +68,8 @@ abstract class DownloadFromSpaceMavenRepoTask : DefaultTask() {
}
}
}
} else {
destinationDir.mkdirs()
}
DownloadAction(project, this).apply {

View File

@@ -6,7 +6,7 @@ pluginManagement {
maven("https://maven.pkg.jetbrains.space/public/p/space/maven")
}
dependencies {
classpath("org.jetbrains.compose.internal.build-helpers:publishing:0.1.4")
classpath("org.jetbrains.compose.internal.build-helpers:publishing:0.1.5")
}
}
}