From 8eeb0db77176efc56ec665af445f26008fd653e8 Mon Sep 17 00:00:00 2001 From: Alexey Tsvetkov <654232+AlexeyTsvetkov@users.noreply.github.com> Date: Mon, 22 Nov 2021 15:11:09 +0300 Subject: [PATCH] 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) --- .../compose/internal/publishing/DownloadFromSpaceTask.kt | 7 ++++++- compose/settings.gradle.kts | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/build-helpers/publishing/src/main/kotlin/org/jetbrains/compose/internal/publishing/DownloadFromSpaceTask.kt b/build-helpers/publishing/src/main/kotlin/org/jetbrains/compose/internal/publishing/DownloadFromSpaceTask.kt index f06a26f760..004e6e882f 100644 --- a/build-helpers/publishing/src/main/kotlin/org/jetbrains/compose/internal/publishing/DownloadFromSpaceTask.kt +++ b/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 - 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 { diff --git a/compose/settings.gradle.kts b/compose/settings.gradle.kts index ddf5eccb2a..11a54a9ae3 100644 --- a/compose/settings.gradle.kts +++ b/compose/settings.gradle.kts @@ -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") } } }