Skip to content

Commit 881835f

Browse files
committed
Reuse multiReleaseRegex
1 parent fc923a7 commit 881835f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/tasks/ShadowCopyAction.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,7 @@ constructor(
176176
} else {
177177
with(fileDetails) {
178178
// Temporarily remove the multi-release prefix.
179-
val multiReleasePrefix =
180-
"^META-INF/versions/\\d+/".toRegex().find(path)?.value.orEmpty()
179+
val multiReleasePrefix = multiReleaseRegex.find(path)?.value.orEmpty()
181180
val newPath = path.replace(multiReleasePrefix, "")
182181
val relocatedPath = multiReleasePrefix + relocators.relocatePath(newPath)
183182
writeToZip(entryName = relocatedPath, bytes = remapClass(relocators = relocators))
@@ -278,6 +277,7 @@ constructor(
278277

279278
public companion object {
280279
private val logger = Logging.getLogger(ShadowCopyAction::class.java)
280+
private val multiReleaseRegex = "^META-INF/versions/\\d+/".toRegex()
281281

282282
private val ZipOutputStream.entries: List<ZipEntry>
283283
get() =

0 commit comments

Comments
 (0)