From 4273bbbb93a38e2be1de5ee7fd4188740dc726ba Mon Sep 17 00:00:00 2001 From: Luke Bemish Date: Mon, 30 Dec 2024 23:18:41 -0600 Subject: [PATCH] Avoid needless re-transformation of tools --- .../runtime/execution/ToolDaemonExecutor.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/main/java/dev/lukebemish/taskgraphrunner/runtime/execution/ToolDaemonExecutor.java b/src/main/java/dev/lukebemish/taskgraphrunner/runtime/execution/ToolDaemonExecutor.java index f0c084d..69dc0fd 100644 --- a/src/main/java/dev/lukebemish/taskgraphrunner/runtime/execution/ToolDaemonExecutor.java +++ b/src/main/java/dev/lukebemish/taskgraphrunner/runtime/execution/ToolDaemonExecutor.java @@ -39,14 +39,8 @@ public class ToolDaemonExecutor implements AutoCloseable { public static void execute(Path jar, Path logFile, String[] args, Context context, boolean classpathScoped) { - Path transformedJar; - try { - transformedJar = transform(jar, context); - } catch (IOException e) { - throw new UncheckedIOException(e); - } String mainClass; - try (var jarFile = new JarInputStream(Files.newInputStream(transformedJar))) { + try (var jarFile = new JarInputStream(Files.newInputStream(jar))) { var manifest = jarFile.getManifest(); mainClass = manifest.getMainAttributes().getValue("Main-Class"); } catch (IOException e) { @@ -55,7 +49,7 @@ public static void execute(Path jar, Path logFile, String[] args, Context contex if (mainClass == null) { throw new RuntimeException("No Main-Class attribute in manifest"); } - execute(List.of(transformedJar), mainClass, logFile, args, context, classpathScoped); + execute(List.of(jar), mainClass, logFile, args, context, classpathScoped); } public static void execute(Collection classpath, String mainClass, Path logFile, String[] args, Context context, boolean classpathScoped) {