Skip to content

Commit

Permalink
Support multi version jar files
Browse files Browse the repository at this point in the history
  • Loading branch information
SgtSilvio committed Feb 11, 2020
1 parent 2e4ebad commit 5544c26
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,13 @@ public void transform(final @NotNull TransformInvocation transformInvocation) {
return false;
}))
.map(ZipEntry::getName)
.map(s -> s.replaceAll("/", ".").replaceAll("\\\\", "."))
.map(s -> {
if (s.startsWith("META-INF/versions/")) {
final String substring = s.substring("META-INF/versions/".length());
s = substring.substring(substring.indexOf("/") + 1);
}
return s.replaceAll("/", ".").replaceAll("\\\\", ".");
})
.map(s -> s.substring(0, s.length() - ".class".length()))
.forEach(Lambdas.consumer(s -> transformClass(classPool, s, typeMap, methodMap, outputDir)));

Expand Down

0 comments on commit 5544c26

Please sign in to comment.