From ca97e973f97f94a3014bcb603bd24fb843273c8a Mon Sep 17 00:00:00 2001 From: Wagyourtail Date: Sun, 14 Jul 2024 12:59:25 -0500 Subject: [PATCH] fix copy resources in transform --- README.md | 2 +- gradle.properties | 2 +- .../xyz/wagyourtail/unimined/expect/TransformPlatform.java | 7 ++++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b041bb3..292012d 100644 --- a/README.md +++ b/README.md @@ -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' } ``` diff --git a/gradle.properties b/gradle.properties index a6f0cec..e0e2c0e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ kotlin.code.style=official -version = 1.0.4 +version = 1.0.5 asmVersion=9.7 diff --git a/src/shared/java/xyz/wagyourtail/unimined/expect/TransformPlatform.java b/src/shared/java/xyz/wagyourtail/unimined/expect/TransformPlatform.java index b24fc52..e80e868 100644 --- a/src/shared/java/xyz/wagyourtail/unimined/expect/TransformPlatform.java +++ b/src/shared/java/xyz/wagyourtail/unimined/expect/TransformPlatform.java @@ -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);