Skip to content

Commit 76f0768

Browse files
committed
Simplify the message
1 parent 24e660c commit 76f0768

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/DeduplicatingResourceTransformer.kt

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,17 @@ public open class DeduplicatingResourceTransformer(
8383
val duplicatePaths = duplicateContentViolations()
8484

8585
if (duplicatePaths.isNotEmpty()) {
86-
val message = "Found ${duplicatePaths.size} path duplicate(s) with different content in the shadowed JAR:" +
87-
duplicatePaths
88-
.map { (path, infos) ->
89-
" * $path\n${
90-
infos.filesPerHash.flatMap { (hash, files) ->
91-
files.map { file -> " * ${file.path} (SHA256: $hash)" }
92-
}.joinToString("\n")
93-
}"
86+
val message = buildString {
87+
append("Found ${duplicatePaths.size} path duplicate(s) with different content in the shadowed JAR:\n")
88+
duplicatePaths.forEach { (path, infos) ->
89+
append(" * $path\n")
90+
infos.filesPerHash.forEach { (hash, files) ->
91+
files.forEach { file ->
92+
append(" * ${file.path} (SHA256: $hash)\n")
93+
}
9494
}
95-
.joinToString("\n", "\n", "")
95+
}
96+
}
9697
throw GradleException(message)
9798
}
9899
}

0 commit comments

Comments
 (0)