From 84834c6ae1d777a2b47e1876398d1cc759f0ec1c Mon Sep 17 00:00:00 2001 From: porum <48167317+porum@users.noreply.github.com> Date: Wed, 21 Feb 2024 03:11:50 +0000 Subject: [PATCH] [GH] Fix ModifyClassesTask.kt This is an imported pull request from https://github.com/android/gradle-recipes/pull/41. Resolves #41 Github-Pr-Head-Sha: 93bc749029f5da8dcd894618744d983e9e9d9026 GitOrigin-RevId: 70ba9ccfc703ed9058b8194454740ddd12fcfdfa Change-Id: I6b0378faebb24624b053d197c8a41107217f8405 --- .../build-logic/plugins/src/main/kotlin/ModifyClassesTask.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/transformAllClasses/build-logic/plugins/src/main/kotlin/ModifyClassesTask.kt b/recipes/transformAllClasses/build-logic/plugins/src/main/kotlin/ModifyClassesTask.kt index a748a6b9..099426fe 100644 --- a/recipes/transformAllClasses/build-logic/plugins/src/main/kotlin/ModifyClassesTask.kt +++ b/recipes/transformAllClasses/build-logic/plugins/src/main/kotlin/ModifyClassesTask.kt @@ -125,7 +125,7 @@ abstract class ModifyClassesTask: DefaultTask() { private fun JarOutputStream.writeEntity(relativePath: String, byteArray: ByteArray) { // check for duplication name first - if (jarPaths.contains(path)) { + if (jarPaths.contains(relativePath)) { printDuplicatedMessage(relativePath) } else { putNextEntry(JarEntry(relativePath)) @@ -137,4 +137,4 @@ abstract class ModifyClassesTask: DefaultTask() { private fun printDuplicatedMessage(name: String) = println("Cannot add ${name}, because output Jar already has file with the same name.") -} \ No newline at end of file +}