From 7c37a5c37028df2a632a7ff05e3443cb8d483c55 Mon Sep 17 00:00:00 2001 From: s809 <43530948+s809@users.noreply.github.com> Date: Sun, 27 Apr 2025 00:40:12 +0500 Subject: [PATCH] Run prepare only when needed --- buildSrc/src/main/java/NativeRelocator.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/buildSrc/src/main/java/NativeRelocator.java b/buildSrc/src/main/java/NativeRelocator.java index f11f682d9..f1788784f 100644 --- a/buildSrc/src/main/java/NativeRelocator.java +++ b/buildSrc/src/main/java/NativeRelocator.java @@ -12,14 +12,15 @@ class NativeRelocator /** * Initializes the NativeRelocator by preparing the environment if necessary. * Executes the appropriate preparation script based on the OS. - * - * @throws Exception if the preparation script fails or an unsupported OS is detected. */ - NativeRelocator(Path rootDirectory) throws Exception + NativeRelocator(Path rootDirectory) { this.rootDirectory = rootDirectory; this.cacheRoot = this.rootDirectory.resolve("cache"); - + } + + private void prepare() throws Exception + { if (this.rootDirectory.resolve(".venv").toFile().exists()) { return; @@ -197,6 +198,7 @@ class NativeRelocator } System.out.println("Relocating to " + outputPath + "..."); + this.prepare(); for (Map.Entry replacement : replacements.entrySet()) {