Skip to content

Commit

Permalink
fix copy resources in transform
Browse files Browse the repository at this point in the history
  • Loading branch information
wagyourtail committed Jul 14, 2024
1 parent 769e646 commit ca97e97
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pluginManagement {
and then add the plugin to your `build.gradle` file:
```gradle
plugins {
id 'xyz.wagyourtail.unimined.expect-platform' version '1.0.4'
id 'xyz.wagyourtail.unimined.expect-platform' version '1.0.5'
}
```

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kotlin.code.style=official

version = 1.0.4
version = 1.0.5

asmVersion=9.7
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,18 @@ public void transform(Path inputRoot, Path outputRoot) throws IOException {
if (parent != null) {
Files.createDirectories(outputRoot.resolve(inputRoot.relativize(parent).toString()));
}
Path output = outputRoot.resolve(inputRoot.relativize(path).toString());

if (!path.toString().endsWith(".class")) {
Files.copy(path, output, StandardCopyOption.REPLACE_EXISTING);
return;
}
ClassReader reader = new ClassReader(Files.newInputStream(path));
ClassNode classNode = new ClassNode();
reader.accept(classNode, 0);

classNode = transform(classNode);

Path output = outputRoot.resolve(inputRoot.relativize(path).toString());
ClassWriter writer = new ClassWriter(reader, 0);
classNode.accept(writer);

Expand Down

0 comments on commit ca97e97

Please sign in to comment.