Skip to content

Commit 761368d

Browse files
authored
[Cherry-pick] Fix Maven Central API uploading (#5353) (#5354)
## Release Notes #5353
2 parents 059caa2 + c2a7f85 commit 761368d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ci/build-helpers/publishing/src/main/kotlin/org/jetbrains/compose/internal/publishing/UploadToSonatypeTask.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,15 @@ abstract class UploadToSonatypeTask : DefaultTask() {
7979

8080
ZipOutputStream(FileOutputStream(zipFile)).use { zipOut ->
8181
val sourcesToDestinations = modules.map { it.localDir to it.mavenDirectory() }
82+
val addedEntries = mutableSetOf<String>()
8283

8384
for ((sourceDir, destDir) in sourcesToDestinations) {
8485
val files = sourceDir.listFiles() ?: continue
8586

8687
for (file in files) {
87-
if (file.isFile) {
88-
val entryPath = "$destDir/${file.name}"
88+
val entryPath = "$destDir/${file.name}"
89+
if (file.isFile && !addedEntries.contains(entryPath)) {
90+
addedEntries.add(entryPath)
8991
val entry = ZipEntry(entryPath)
9092
zipOut.putNextEntry(entry)
9193
file.inputStream().use { input ->

0 commit comments

Comments
 (0)