Browse Source

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)
pull/1439/head
Alexey Tsvetkov 3 years ago committed by GitHub
parent
commit
8eeb0db771
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      build-helpers/publishing/src/main/kotlin/org/jetbrains/compose/internal/publishing/DownloadFromSpaceTask.kt
  2. 2
      compose/settings.gradle.kts

7
build-helpers/publishing/src/main/kotlin/org/jetbrains/compose/internal/publishing/DownloadFromSpaceTask.kt

@ -45,7 +45,10 @@ abstract class DownloadFromSpaceMavenRepoTask : DefaultTask() {
} }
val destinationDir = module.localDir 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")) { if (module.version.endsWith("-SNAPSHOT")) {
destinationDir.deleteRecursively() destinationDir.deleteRecursively()
} else { } else {
@ -65,6 +68,8 @@ abstract class DownloadFromSpaceMavenRepoTask : DefaultTask() {
} }
} }
} }
} else {
destinationDir.mkdirs()
} }
DownloadAction(project, this).apply { DownloadAction(project, this).apply {

2
compose/settings.gradle.kts

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

Loading…
Cancel
Save