Skip to content

Commit

Permalink
fix(core.transform-kit): 忽略根目录的module-info.class
Browse files Browse the repository at this point in the history
有些第三方库的module-info.class没有放到`META-INF/`目录下。

fix Tencent#704
  • Loading branch information
shifujun committed Dec 7, 2021
1 parent 7b02667 commit de2abfd
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,12 @@ abstract class AbstractTransform(

private fun CtClass.debugWriteJar(outputEntryName: String?, outputStream: ZipOutputStream) {
//忽略META-INF
if (outputEntryName?.startsWith("META-INF/") == true) {
return
}
if (outputEntryName != null
&& listOf<(String) -> Boolean>(
{ it.startsWith("META-INF/") },
{ it == "module-info.class" },
).any { it(outputEntryName) }
) return

try {
val entryName = outputEntryName ?: (name.replace('.', '/') + ".class")
Expand Down

0 comments on commit de2abfd

Please sign in to comment.